Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "CSFLog.h"
7 #include "CC_Common.h"
9 #include "CC_SIPCCLine.h"
10 #include "CC_SIPCCCall.h"
11 #include "CC_SIPCCLineInfo.h"
13 extern "C"
14 {
15 #include "ccapi_line.h"
16 #include "ccapi_line_listener.h"
17 }
19 using namespace std;
20 using namespace CSF;
22 CSF_IMPLEMENT_WRAP(CC_SIPCCLine, cc_lineid_t);
24 cc_lineid_t CC_SIPCCLine::getID()
25 {
26 return lineId;
27 }
29 CC_LineInfoPtr CC_SIPCCLine::getLineInfo ()
30 {
31 cc_lineinfo_ref_t lineInfoRef = CCAPI_Line_getLineInfo(lineId);
32 CC_LineInfoPtr lineInfoPtr = CC_SIPCCLineInfo::wrap(lineInfoRef).get();
34 //A call to CCAPI_Line_getLineInfo() needs a matching call to CCAPI_Line_releaseLineInfo()
35 //However, the CC_SIPCCLineInfo() ctor/dtor does a retain/release internally, so I need to explicitly release
36 //here to match up with the call to CCAPI_Line_getLineInfo().
38 CCAPI_Line_releaseLineInfo(lineInfoRef);
40 //CCAPI_Line_getLineInfo() --> requires release be called.
41 //CC_SIPCCLineInfo::CC_SIPCCLineInfo() -> Call retain (wrapped in smart_ptr)
42 //CCAPI_Line_releaseLineInfo() --> this maps to the call to CCAPI_Line_getLineInfo()
43 //CC_SIPCCLineInfo::~CC_SIPCCLineInfo() --> CCAPI_Line_releaseLineInfo() (when smart pointer destroyed)
45 return lineInfoPtr;
46 }
48 CC_CallPtr CC_SIPCCLine::createCall ()
49 {
50 cc_call_handle_t callHandle = CCAPI_Line_CreateCall(lineId);
52 return CC_SIPCCCall::wrap(callHandle).get();
53 }