Back out fe7fa32e9423 (bug 848423) for Windows build bustage

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2013-03-06 15:26:43 -08:00
parent 61f53621b2
commit cec898a4b9
35 changed files with 59 additions and 105 deletions

View File

@ -6,7 +6,6 @@
#include "CC_Common.h"
#include "ECC_Types.h"
#include "mozilla/RefPtr.h"
extern "C"
{
@ -17,9 +16,6 @@ namespace CSF
{
class ECC_API CC_Call
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Call)
protected:
CC_Call () { }
@ -289,7 +285,6 @@ namespace CSF
virtual const std::string& getPeerConnection() const = 0;
virtual void addICECandidate(const std::string & candidate, const std::string & mid, unsigned short level) = 0;
};
}

View File

@ -20,8 +20,6 @@ namespace CSF
class ECC_API CC_CallInfo
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallInfo)
protected:
CC_CallInfo() { }

View File

@ -17,8 +17,6 @@ namespace CSF
{
class ECC_API CC_CallServerInfo
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallServerInfo)
protected:
CC_CallServerInfo() { }

View File

@ -18,17 +18,17 @@
namespace CSF
{
DECLARE_NS_PTR(CallControlManager)
DECLARE_NS_PTR_VECTOR(PhoneDetails)
DECLARE_NS_PTR(CC_Service)
DECLARE_NS_PTR(VideoControl)
DECLARE_NS_PTR(AudioControl)
DECLARE_NS_PTR_VECTOR(CC_Device)
DECLARE_NS_PTR(CC_DeviceInfo)
DECLARE_NS_PTR(CC_CallServerInfo)
DECLARE_NS_PTR(CC_FeatureInfo)
DECLARE_NS_PTR_VECTOR(CC_Line)
DECLARE_NS_PTR(CC_LineInfo)
DECLARE_NS_PTR_VECTOR(CC_Call)
DECLARE_NS_PTR(CC_CallInfo)
DECLARE_PTR(CallControlManager)
DECLARE_PTR_VECTOR(PhoneDetails)
DECLARE_PTR(CC_Service)
DECLARE_PTR(VideoControl)
DECLARE_PTR(AudioControl)
DECLARE_PTR_VECTOR(CC_Device)
DECLARE_PTR(CC_DeviceInfo)
DECLARE_PTR(CC_CallServerInfo)
DECLARE_PTR(CC_FeatureInfo)
DECLARE_PTR_VECTOR(CC_Line)
DECLARE_PTR(CC_LineInfo)
DECLARE_PTR_VECTOR(CC_Call)
DECLARE_PTR(CC_CallInfo)
}

View File

@ -16,8 +16,6 @@ namespace CSF
class ECC_API CC_Device
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Device)
protected:
CC_Device() {}

View File

@ -17,8 +17,6 @@ namespace CSF
{
class ECC_API CC_DeviceInfo
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_DeviceInfo)
protected:
CC_DeviceInfo() { }

View File

@ -15,8 +15,6 @@ namespace CSF
{
class ECC_API CC_FeatureInfo
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_FeatureInfo)
protected:
CC_FeatureInfo() { }

View File

@ -15,8 +15,6 @@ namespace CSF
{
class ECC_API CC_Line
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Line)
protected:
CC_Line () { }

View File

@ -18,8 +18,6 @@ namespace CSF
{
class ECC_API CC_LineInfo
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_LineInfo)
protected:
CC_LineInfo() { }

View File

@ -19,8 +19,6 @@ namespace CSF
{
class ECC_API CC_Service
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Service)
protected:
CC_Service() {}
public:

View File

@ -8,11 +8,10 @@
namespace CSF
{
DECLARE_NS_PTR(AudioControl)
DECLARE_PTR(AudioControl);
class ECC_API AudioControl
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AudioControl)
// device names are in UTF-8 encoding
virtual std::vector<std::string> getRecordingDevices() = 0;

View File

@ -12,11 +12,10 @@
namespace CSF
{
DECLARE_NS_PTR(VideoControl)
DECLARE_PTR(VideoControl);
class ECC_API VideoControl
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoControl)
virtual ~VideoControl() {};
virtual void setVideoMode( bool enable ) = 0;

View File

@ -34,7 +34,7 @@
namespace CSF
{
DECLARE_NS_PTR(CallControlManager)
DECLARE_PTR(CallControlManager)
/**
* CallControlManager
*
@ -48,7 +48,6 @@ namespace CSF
class ECC_API CallControlManager
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CallControlManager)
/**
* Use create() to create a CallControlManager instance.
*

View File

@ -11,11 +11,10 @@
namespace CSF
{
DECLARE_NS_PTR_VECTOR(PhoneDetails);
DECLARE_PTR_VECTOR(PhoneDetails);
class ECC_API PhoneDetails
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PhoneDetails)
virtual ~PhoneDetails() {}
/**
* Get the device name (the CUCM device name) and the free text description.

View File

@ -6,7 +6,6 @@
#include <vector>
#include "base/linked_ptr.h"
#include "nsAutoPtr.h"
#ifndef DECLARE_PTR
#define DECLARE_PTR(className)\
@ -26,19 +25,3 @@
#ifndef NULL_PTR
#define NULL_PTR(className) linked_ptr<className>()
#endif
// NSPR Variations of the above, to help with migration
// from linked_ptr to nsRefPtr
#ifndef DECLARE_NS_PTR
#define DECLARE_NS_PTR(className)\
class className;\
typedef nsRefPtr<className> className##Ptr;
#endif
#ifndef DECLARE_NS_PTR_VECTOR
#define DECLARE_NS_PTR_VECTOR(className)\
DECLARE_NS_PTR(className)\
typedef std::vector<className##Ptr> className##Vtr;\
typedef linked_ptr<className##Vtr> className##Vtr##Ptr;
#endif

View File

@ -234,8 +234,8 @@ bool CallControlManagerImpl::disconnect()
phone->removeCCObserver(this);
phone->stop();
phone->destroy();
phone = nullptr;
softPhone = nullptr;
phone.reset();
softPhone.reset();
return true;
}
@ -275,7 +275,7 @@ PhoneDetailsVtrPtr CallControlManagerImpl::getAvailablePhoneDetails()
PhoneDetailsVtrPtr result = PhoneDetailsVtrPtr(new PhoneDetailsVtr());
for(PhoneDetailsMap::iterator it = phoneDetailsMap.begin(); it != phoneDetailsMap.end(); it++)
{
PhoneDetailsPtr details = it->second.get();
PhoneDetailsPtr details = it->second;
result->push_back(details);
}
return result;
@ -286,7 +286,7 @@ PhoneDetailsPtr CallControlManagerImpl::getAvailablePhoneDetails(const std::stri
PhoneDetailsMap::iterator it = phoneDetailsMap.find(deviceName);
if(it != phoneDetailsMap.end())
{
return it->second.get();
return it->second;
}
return PhoneDetailsPtr();
}

View File

@ -8,7 +8,7 @@
namespace CSF
{
DECLARE_NS_PTR(PhoneDetailsImpl);
DECLARE_PTR(PhoneDetailsImpl);
class PhoneDetailsImpl: public PhoneDetails
{
public:

View File

@ -9,7 +9,7 @@
namespace CSF
{
DECLARE_NS_PTR(AudioControlWrapper)
DECLARE_PTR(AudioControlWrapper);
class ECC_API AudioControlWrapper : public AudioControl
{
public:

View File

@ -15,9 +15,9 @@
namespace CSF
{
DECLARE_NS_PTR(VideoControlWrapper)
typedef void *VideoWindowHandle;
DECLARE_PTR(VideoControlWrapper);
class ECC_API VideoControlWrapper : public VideoControl
{
public:

View File

@ -126,7 +126,7 @@ CC_CallInfoPtr CC_SIPCCCall::getCallInfo ()
cc_callinfo_ref_t callInfo = CCAPI_Call_getCallInfo(callHandle);
CC_SIPCCCallInfoPtr callInfoPtr = CC_SIPCCCallInfo::wrap(callInfo);
callInfoPtr->setMediaData( pMediaData);
return callInfoPtr.get();
return callInfoPtr;
}

View File

@ -23,12 +23,11 @@ namespace CSF
};
typedef std::map<int, StreamInfo> StreamMapType;
DECLARE_NS_PTR(CC_SIPCCCallMediaData);
DECLARE_PTR(CC_SIPCCCallMediaData);
class CC_SIPCCCallMediaData
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_SipCCCAllMediaData)
CC_SIPCCCallMediaData():
remoteWindow(NULL),
streamMapMutex("CC_SIPCCCallMediaData"),
@ -55,7 +54,7 @@ namespace CSF
CC_SIPCCCallMediaData& operator=(const CC_SIPCCCallMediaData&);
};
DECLARE_NS_PTR(CC_SIPCCCall);
DECLARE_PTR(CC_SIPCCCall);
class CC_SIPCCCall : public CC_Call
{

View File

@ -286,7 +286,7 @@ string CC_SIPCCCallInfo::getAlternateNumber()
CC_LinePtr CC_SIPCCCallInfo::getline ()
{
cc_lineid_t lineId = CCAPI_CallInfo_getLine(callinfo_ref);
return CC_SIPCCLine::wrap(lineId).get();
return CC_SIPCCLine::wrap(lineId);
}
string CC_SIPCCCallInfo::getOriginalCalledPartyName()

View File

@ -18,7 +18,7 @@ extern "C" {
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCCallInfo);
DECLARE_PTR(CC_SIPCCCallInfo);
class CC_SIPCCCallInfo : public CC_CallInfo
{

View File

@ -11,7 +11,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCCallServerInfo);
DECLARE_PTR(CC_SIPCCCallServerInfo);
class CC_SIPCCCallServerInfo : public CC_CallServerInfo
{
private:

View File

@ -31,7 +31,7 @@ CC_DevicePtr CC_SIPCCDevice::createDevice ()
CC_SIPCCDevicePtr pSIPCCDevice = CC_SIPCCDevice::wrap(deviceHandle);
return pSIPCCDevice.get();
return pSIPCCDevice;
}
CC_SIPCCDevice::CC_SIPCCDevice (cc_device_handle_t aDeviceHandle)
@ -44,8 +44,7 @@ CC_SIPCCDevice::CC_SIPCCDevice (cc_device_handle_t aDeviceHandle)
CC_DeviceInfoPtr CC_SIPCCDevice::getDeviceInfo ()
{
cc_deviceinfo_ref_t deviceInfoRef = CCAPI_Device_getDeviceInfo(deviceHandle);
CC_DeviceInfoPtr deviceInfoPtr =
CC_SIPCCDeviceInfo::wrap(deviceInfoRef).get();
CC_DeviceInfoPtr deviceInfoPtr = CC_SIPCCDeviceInfo::wrap(deviceInfoRef);
//A call to CCAPI_Device_getDeviceInfo() needs a matching call to CCAPI_Device_releaseDeviceInfo()
//However, the CC_SIPCCDeviceInfo() ctor/dtor does a retain/release internally, so I need to explicitly release
@ -74,7 +73,7 @@ CC_CallPtr CC_SIPCCDevice::createCall ()
{
cc_call_handle_t callHandle = CCAPI_Device_CreateCall(deviceHandle);
return CC_SIPCCCall::wrap(callHandle).get();
return CC_SIPCCCall::wrap(callHandle);
}
void CC_SIPCCDevice::enableVideo(bool enable)

View File

@ -11,7 +11,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCDevice);
DECLARE_PTR(CC_SIPCCDevice);
class CC_SIPCCDevice : public CC_Device
{
private:

View File

@ -59,7 +59,7 @@ vector<CC_CallPtr> CC_SIPCCDeviceInfo::getCalls ()
for (int i=0; i<numHandles; i++)
{
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]).get();
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]);
callsVector.push_back(callPtr);
}
@ -77,7 +77,7 @@ vector<CC_LinePtr> CC_SIPCCDeviceInfo::getLines ()
for (int i=0; i<numLines; i++)
{
CC_LinePtr linePtr = CC_SIPCCLine::wrap(lines[i]).get();
CC_LinePtr linePtr = CC_SIPCCLine::wrap(lines[i]);
linesVector.push_back(linePtr);
}
@ -95,8 +95,7 @@ vector<CC_FeatureInfoPtr> CC_SIPCCDeviceInfo::getFeatures ()
for (int i=0; i<numFeatureInfos; i++)
{
CC_FeatureInfoPtr featurePtr =
CC_SIPCCFeatureInfo::wrap(features[i]).get();
CC_FeatureInfoPtr featurePtr = CC_SIPCCFeatureInfo::wrap(features[i]);
featuresVector.push_back(featurePtr);
}
@ -114,8 +113,7 @@ vector<CC_CallServerInfoPtr> CC_SIPCCDeviceInfo::getCallServers ()
for (int i=0; i<numCallServerInfos; i++)
{
CC_CallServerInfoPtr callServerPtr =
CC_SIPCCCallServerInfo::wrap(callServers[i]).get();
CC_CallServerInfoPtr callServerPtr = CC_SIPCCCallServerInfo::wrap(callServers[i]);
callServersVector.push_back(callServerPtr);
}

View File

@ -11,7 +11,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCDeviceInfo);
DECLARE_PTR(CC_SIPCCDeviceInfo);
class CC_SIPCCDeviceInfo : public CC_DeviceInfo
{
private:

View File

@ -11,7 +11,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCFeatureInfo);
DECLARE_PTR(CC_SIPCCFeatureInfo);
class CC_SIPCCFeatureInfo : public CC_FeatureInfo
{
private:

View File

@ -29,7 +29,7 @@ cc_lineid_t CC_SIPCCLine::getID()
CC_LineInfoPtr CC_SIPCCLine::getLineInfo ()
{
cc_lineinfo_ref_t lineInfoRef = CCAPI_Line_getLineInfo(lineId);
CC_LineInfoPtr lineInfoPtr = CC_SIPCCLineInfo::wrap(lineInfoRef).get();
CC_LineInfoPtr lineInfoPtr = CC_SIPCCLineInfo::wrap(lineInfoRef);
//A call to CCAPI_Line_getLineInfo() needs a matching call to CCAPI_Line_releaseLineInfo()
//However, the CC_SIPCCLineInfo() ctor/dtor does a retain/release internally, so I need to explicitly release
@ -49,7 +49,7 @@ CC_CallPtr CC_SIPCCLine::createCall ()
{
cc_call_handle_t callHandle = CCAPI_Line_CreateCall(lineId);
return CC_SIPCCCall::wrap(callHandle).get();
return CC_SIPCCCall::wrap(callHandle);
}

View File

@ -13,7 +13,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCLine);
DECLARE_PTR(CC_SIPCCLine);
class CC_SIPCCLine : public CC_Line
{
private:

View File

@ -104,7 +104,7 @@ vector<CC_CallPtr> CC_SIPCCLineInfo::getCalls (CC_LinePtr linePtr)
for (int i=0; i<numCalls; i++)
{
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]).get();
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]);
callsVector.push_back(callPtr);
}
@ -122,7 +122,7 @@ vector<CC_CallPtr> CC_SIPCCLineInfo::getCallsByState (CC_LinePtr linePtr, cc_cal
for (int i=0; i<numCalls; i++)
{
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]).get();
CC_CallPtr callPtr = CC_SIPCCCall::wrap(handles[i]);
callsVector.push_back(callPtr);
}

View File

@ -11,7 +11,7 @@
namespace CSF
{
DECLARE_NS_PTR(CC_SIPCCLineInfo);
DECLARE_PTR(CC_SIPCCLineInfo);
class CC_SIPCCLineInfo : public CC_LineInfo
{
public:

View File

@ -480,7 +480,7 @@ bool CC_SIPCCService::isStarted()
// method are not safe except from ccapp_thread.
CC_DevicePtr CC_SIPCCService::getActiveDevice()
{
return CC_SIPCCDevice::wrap(CCAPI_Device_getDeviceID()).get();
return CC_SIPCCDevice::wrap(CCAPI_Device_getDeviceID());
}
// !!! Note that accessing *Ptr instances from multiple threads can
@ -493,7 +493,7 @@ vector<CC_DevicePtr> CC_SIPCCService::getDevices()
CC_SIPCCDevicePtr pDevice = CC_SIPCCDevice::wrap(CCAPI_Device_getDeviceID());
if(pDevice != NULL)
{
devices.push_back(pDevice.get());
devices.push_back(pDevice);
}
return devices;
@ -506,12 +506,12 @@ AudioControlPtr CC_SIPCCService::getAudioControl ()
{
if(audioControlWrapper != NULL)
{
return audioControlWrapper.get();
return audioControlWrapper;
}
else
{
audioControlWrapper = AudioControlWrapperPtr(new AudioControlWrapper(VcmSIPCCBinding::getAudioControl()));
return audioControlWrapper.get();
return audioControlWrapper;
}
}
@ -522,12 +522,12 @@ VideoControlPtr CC_SIPCCService::getVideoControl ()
{
if(videoControlWrapper != NULL)
{
return videoControlWrapper.get();
return videoControlWrapper;
}
else
{
videoControlWrapper = VideoControlWrapperPtr(new VideoControlWrapper(VcmSIPCCBinding::getVideoControl()));
return videoControlWrapper.get();
return videoControlWrapper;
}
}
@ -626,7 +626,7 @@ void CC_SIPCCService::onDeviceEvent(ccapi_device_event_e type, cc_device_handle_
device_event_getname(type),
devicePtr->toString().c_str(),
infoPtr->getDeviceName().c_str());
_self->notifyDeviceEventObservers(type, devicePtr.get(), infoPtr.get());
_self->notifyDeviceEventObservers(type, devicePtr, infoPtr);
}
void CC_SIPCCService::onFeatureEvent(ccapi_device_event_e type, cc_deviceinfo_ref_t /* device_info */, cc_featureinfo_ref_t feature_info)
@ -641,14 +641,14 @@ void CC_SIPCCService::onFeatureEvent(ccapi_device_event_e type, cc_deviceinfo_re
mozilla::MutexAutoLock lock(_self->m_lock);
cc_device_handle_t hDevice = CCAPI_Device_getDeviceID();
CC_DevicePtr devicePtr = CC_SIPCCDevice::wrap(hDevice).get();
CC_DevicePtr devicePtr = CC_SIPCCDevice::wrap(hDevice);
if (devicePtr == NULL)
{
CSFLogError( logTag, "Unable to notify device observers for device handle (%u), as failed to create CC_DevicePtr", hDevice);
return;
}
CC_FeatureInfoPtr infoPtr = CC_SIPCCFeatureInfo::wrap(feature_info).get();
CC_FeatureInfoPtr infoPtr = CC_SIPCCFeatureInfo::wrap(feature_info);
if (infoPtr == NULL)
{
CSFLogError( logTag, "Unable to notify call observers for feature info handle (%u), as failed to create CC_FeatureInfoPtr", feature_info);
@ -672,14 +672,14 @@ void CC_SIPCCService::onLineEvent(ccapi_line_event_e eventType, cc_lineid_t line
mozilla::MutexAutoLock lock(_self->m_lock);
CC_LinePtr linePtr = CC_SIPCCLine::wrap(line).get();
CC_LinePtr linePtr = CC_SIPCCLine::wrap(line);
if (linePtr == NULL)
{
CSFLogError( logTag, "Unable to notify line observers for line lineId (%u), as failed to create CC_LinePtr", line);
return;
}
CC_LineInfoPtr infoPtr = CC_SIPCCLineInfo::wrap(info).get();
CC_LineInfoPtr infoPtr = CC_SIPCCLineInfo::wrap(info);
if (infoPtr == NULL)
{
CSFLogError( logTag, "Unable to notify line observers for line lineId (%u), as failed to create CC_LineInfoPtr", line);
@ -722,7 +722,7 @@ void CC_SIPCCService::onCallEvent(ccapi_call_event_e eventType, cc_call_handle_t
CSFLogInfo( logTag, "onCallEvent(%s, %s, [%s|%s]",
call_event_getname(eventType), callPtr->toString().c_str(),
call_state_getname(infoPtr->getCallState()), CC_CallCapabilityEnum::toString(capSet).c_str());
_self->notifyCallEventObservers(eventType, callPtr.get(), infoPtr.get());
_self->notifyCallEventObservers(eventType, callPtr, infoPtr);
}
void CC_SIPCCService::addCCObserver ( CC_Observer * observer )

View File

@ -33,7 +33,7 @@ extern "C" {
namespace CSF
{
class PhoneConfig;
DECLARE_NS_PTR(CC_SIPCCService);
DECLARE_PTR(CC_SIPCCService);
class CC_SIPCCService : public CC_Service, public StreamObserver, public MediaProviderObserver
{