Bug 1061056 - Fix more bad implicit constructors in WebRTC; r=jesup

This commit is contained in:
Ehsan Akhgari 2014-09-01 17:43:17 -04:00
parent 6b291cbc20
commit 19b55cc477
20 changed files with 34 additions and 34 deletions

View File

@ -44,7 +44,7 @@ class Destructor {
*destroyed_ = true;
}
public:
Destructor(bool* destroyed) : destroyed_(destroyed) {}
explicit Destructor(bool* destroyed) : destroyed_(destroyed) {}
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Destructor)
@ -54,7 +54,7 @@ class Destructor {
class TargetClass {
public:
TargetClass(int *ran) : ran_(ran) {}
explicit TargetClass(int *ran) : ran_(ran) {}
void m1(int x) {
std::cerr << __FUNCTION__ << " " << x << std::endl;

View File

@ -78,7 +78,7 @@ class SocketTransportServiceTest : public ::testing::Test {
// Received an event.
class EventReceived : public nsRunnable {
public:
EventReceived(SocketTransportServiceTest *test) :
explicit EventReceived(SocketTransportServiceTest *test) :
test_(test) {}
NS_IMETHOD Run() {
@ -93,7 +93,7 @@ public:
// Register our listener on the socket
class RegisterEvent : public nsRunnable {
public:
RegisterEvent(SocketTransportServiceTest *test) :
explicit RegisterEvent(SocketTransportServiceTest *test) :
test_(test) {}
NS_IMETHOD Run() {
@ -107,7 +107,7 @@ public:
class SocketHandler : public nsASocketHandler {
public:
SocketHandler(SocketTransportServiceTest *test) : test_(test) {
explicit SocketHandler(SocketTransportServiceTest *test) : test_(test) {
}
void OnSocketReady(PRFileDesc *fd, int16_t outflags) {

View File

@ -334,7 +334,7 @@ class DtlsInspectorInjector : public DtlsRecordInspector {
// Make a copy of the first instance of a message.
class DtlsInspectorRecordHandshakeMessage : public DtlsRecordInspector {
public:
DtlsInspectorRecordHandshakeMessage(uint8_t handshake_type)
explicit DtlsInspectorRecordHandshakeMessage(uint8_t handshake_type)
: handshake_type_(handshake_type),
buffer_() {}

View File

@ -69,7 +69,7 @@ private:
class AutoLockNSPR {
public:
AutoLockNSPR(LockNSPR& lock) : lock_(lock) {
explicit AutoLockNSPR(LockNSPR& lock) : lock_(lock) {
lock_.Acquire();
}
~AutoLockNSPR() {

View File

@ -54,7 +54,7 @@ public:
class ImageHandle
{
public:
ImageHandle(layers::Image* image) : mImage(image) {}
explicit ImageHandle(layers::Image* image) : mImage(image) {}
const RefPtr<layers::Image>& GetImage() const { return mImage; }

View File

@ -16,7 +16,7 @@ namespace CSF
public:
// device names are in UTF-8 encoding
AudioControlWrapper(AudioControl * audioControl){_realAudioControl = audioControl;};
explicit AudioControlWrapper(AudioControl * audioControl){_realAudioControl = audioControl;};
virtual std::vector<std::string> getRecordingDevices();
virtual std::vector<std::string> getPlayoutDevices();

View File

@ -21,7 +21,7 @@ namespace CSF
class ECC_API VideoControlWrapper : public VideoControl
{
public:
VideoControlWrapper(VideoControl * videoControl){_realVideoControl = videoControl;};
explicit VideoControlWrapper(VideoControl * videoControl){_realVideoControl = videoControl;};
virtual void setVideoMode( bool enable );

View File

@ -343,7 +343,7 @@ class GenericReceiveListener;
class GenericReceiveCallback : public TrackAddedCallback
{
public:
GenericReceiveCallback(GenericReceiveListener* listener)
explicit GenericReceiveCallback(GenericReceiveListener* listener)
: listener_(listener) {}
void TrackAdded(TrackTicks time) {
@ -357,7 +357,7 @@ class GenericReceiveCallback : public TrackAddedCallback
class ConduitDeleteEvent: public nsRunnable
{
public:
ConduitDeleteEvent(TemporaryRef<MediaSessionConduit> aConduit) :
explicit ConduitDeleteEvent(TemporaryRef<MediaSessionConduit> aConduit) :
mConduit(aConduit) {}
/* we exist solely to proxy release of the conduit */
@ -435,7 +435,7 @@ public:
class PipelineListener : public MediaStreamDirectListener {
friend class MediaPipelineTransmit;
public:
PipelineListener(const RefPtr<MediaSessionConduit>& conduit)
explicit PipelineListener(const RefPtr<MediaSessionConduit>& conduit)
: conduit_(conduit),
track_id_(TRACK_INVALID),
mMutex("MediaPipelineTransmit::PipelineListener"),
@ -692,7 +692,7 @@ class MediaPipelineReceiveVideo : public MediaPipelineReceive {
private:
class PipelineRenderer : public VideoRenderer {
public:
PipelineRenderer(MediaPipelineReceiveVideo *pipeline) :
explicit PipelineRenderer(MediaPipelineReceiveVideo *pipeline) :
pipeline_(pipeline) {}
void Detach() { pipeline_ = nullptr; }

View File

@ -35,7 +35,7 @@ class WebrtcGlobalInformation;
class SipccOfferOptions {
public:
SipccOfferOptions();
SipccOfferOptions(const dom::RTCOfferOptions &aOther);
explicit SipccOfferOptions(const dom::RTCOfferOptions &aOther);
cc_media_options_t* build() const;
protected:
cc_media_options_t mOptions;

View File

@ -57,7 +57,7 @@ class Fake_AudioGenerator {
public:
typedef mozilla::DOMMediaStream DOMMediaStream;
Fake_AudioGenerator(DOMMediaStream* aStream) : mStream(aStream), mCount(0) {
explicit Fake_AudioGenerator(DOMMediaStream* aStream) : mStream(aStream), mCount(0) {
mTimer = do_CreateInstance("@mozilla.org/timer;1");
MOZ_ASSERT(mTimer);
@ -99,7 +99,7 @@ class Fake_VideoGenerator {
typedef mozilla::DOMMediaStream DOMMediaStream;
typedef mozilla::gfx::IntSize IntSize;
Fake_VideoGenerator(DOMMediaStream* aStream) {
explicit Fake_VideoGenerator(DOMMediaStream* aStream) {
mStream = aStream;
mCount = 0;
mTimer = do_CreateInstance("@mozilla.org/timer;1");
@ -289,7 +289,7 @@ class PeerConnectionMedia : public sigslot::has_slots<> {
~PeerConnectionMedia() {}
public:
PeerConnectionMedia(PeerConnectionImpl *parent);
explicit PeerConnectionMedia(PeerConnectionImpl *parent);
nsresult Init(const std::vector<mozilla::NrIceStunServer>& stun_servers,
const std::vector<mozilla::NrIceTurnServer>& turn_servers);

View File

@ -64,7 +64,7 @@ namespace CSF
CSF_DECLARE_WRAP(CC_SIPCCCall, cc_call_handle_t);
private:
cc_call_handle_t callHandle;
CC_SIPCCCall (cc_call_handle_t aCallHandle);
explicit CC_SIPCCCall (cc_call_handle_t aCallHandle);
CC_SIPCCCallMediaDataPtr pMediaData;
std::string peerconnection; // The peerconnection handle

View File

@ -25,7 +25,7 @@ namespace CSF
private:
cc_callinfo_ref_t callinfo_ref;
CC_SIPCCCallInfo (cc_callinfo_ref_t callinfo);
explicit CC_SIPCCCallInfo (cc_callinfo_ref_t callinfo);
CSF_DECLARE_WRAP(CC_SIPCCCallInfo, cc_callinfo_ref_t);

View File

@ -17,7 +17,7 @@ namespace CSF
private:
cc_callserver_ref_t callserverinfo_ref;
CC_SIPCCCallServerInfo (cc_callserver_ref_t aCallServerInfo);
explicit CC_SIPCCCallServerInfo (cc_callserver_ref_t aCallServerInfo);
CSF_DECLARE_WRAP(CC_SIPCCCallServerInfo, cc_callserver_ref_t);

View File

@ -18,7 +18,7 @@ namespace CSF
CSF_DECLARE_WRAP(CC_SIPCCDevice, cc_device_handle_t);
static CC_DevicePtr create (const std::string & phoneConfigFileNameStr);
CC_SIPCCDevice (cc_device_handle_t aDeviceHandle);
explicit CC_SIPCCDevice (cc_device_handle_t aDeviceHandle);
public:

View File

@ -15,7 +15,7 @@ namespace CSF
class CC_SIPCCDeviceInfo : public CC_DeviceInfo
{
private:
CC_SIPCCDeviceInfo (cc_deviceinfo_ref_t aDeviceInfo);
explicit CC_SIPCCDeviceInfo (cc_deviceinfo_ref_t aDeviceInfo);
cc_deviceinfo_ref_t deviceinfo_ref;
CSF_DECLARE_WRAP(CC_SIPCCDeviceInfo, cc_deviceinfo_ref_t);

View File

@ -16,7 +16,7 @@ namespace CSF
{
private:
cc_featureinfo_ref_t featureinfo_ref;
CC_SIPCCFeatureInfo (cc_featureinfo_ref_t aFeatureInfo);
explicit CC_SIPCCFeatureInfo (cc_featureinfo_ref_t aFeatureInfo);
CSF_DECLARE_WRAP(CC_SIPCCFeatureInfo, cc_featureinfo_ref_t);
public:

View File

@ -20,7 +20,7 @@ namespace CSF
CSF_DECLARE_WRAP(CC_SIPCCLine, cc_lineid_t);
cc_lineid_t lineId;
CC_SIPCCLine (cc_lineid_t aLineId) : lineId(aLineId) { }
explicit CC_SIPCCLine (cc_lineid_t aLineId) : lineId(aLineId) { }
public:
virtual std::string toString() {

View File

@ -19,7 +19,7 @@ namespace CSF
private:
cc_lineinfo_ref_t lineinfo;
CC_SIPCCLineInfo (cc_lineinfo_ref_t lineinfo);
explicit CC_SIPCCLineInfo (cc_lineinfo_ref_t lineinfo);
CSF_DECLARE_WRAP(CC_SIPCCLineInfo, cc_lineinfo_ref_t);
public:

View File

@ -104,8 +104,8 @@ class Fake_MediaStream {
class Fake_MediaPeriodic : public nsITimerCallback {
public:
Fake_MediaPeriodic(Fake_MediaStream *aStream) : mStream(aStream),
mCount(0) {}
explicit Fake_MediaPeriodic(Fake_MediaStream *aStream) : mStream(aStream),
mCount(0) {}
void Detach() {
mStream = nullptr;
}
@ -217,7 +217,7 @@ class Fake_DOMMediaStream;
class Fake_MediaStreamTrack : public mozilla::RefCounted<Fake_MediaStreamTrack>
{
public:
Fake_MediaStreamTrack(bool aIsVideo) : mIsVideo (aIsVideo) {}
explicit Fake_MediaStreamTrack(bool aIsVideo) : mIsVideo (aIsVideo) {}
mozilla::TrackID GetTrackID() { return mIsVideo ? 1 : 0; }
Fake_DOMMediaStream *GetStream() { return nullptr; }
const Fake_MediaStreamTrack* AsVideoStreamTrack() const
@ -241,7 +241,7 @@ protected:
}
public:
Fake_DOMMediaStream(Fake_MediaStream *stream = nullptr)
explicit Fake_DOMMediaStream(Fake_MediaStream *stream = nullptr)
: mMediaStream(stream? stream : new Fake_MediaStream())
, mVideoTrack(new Fake_MediaStreamTrack(true))
, mAudioTrack(new Fake_MediaStreamTrack(false)) {}

View File

@ -527,7 +527,7 @@ TestObserver::OnAddIceCandidateError(uint32_t code, const char *message, ER&)
class ParsedSDP {
public:
ParsedSDP(const std::string &sdp)
explicit ParsedSDP(const std::string &sdp)
{
Parse(sdp);
}
@ -684,7 +684,7 @@ class PCDispatchWrapper : public nsSupportsWeakReference
virtual ~PCDispatchWrapper() {}
public:
PCDispatchWrapper(sipcc::PeerConnectionImpl *peerConnection) {
explicit PCDispatchWrapper(sipcc::PeerConnectionImpl *peerConnection) {
pc_ = peerConnection;
}
@ -941,7 +941,7 @@ NS_IMPL_ISUPPORTS(PCDispatchWrapper, nsISupportsWeakReference)
class SignalingAgent {
public:
SignalingAgent(const std::string &aName,
explicit SignalingAgent(const std::string &aName,
const std::string stun_addr = g_stun_server_address,
uint16_t stun_port = g_stun_server_port) : pc(nullptr), name(aName) {
cfg_.addStunServer(stun_addr, stun_port);
@ -1972,7 +1972,7 @@ static void SetMaxFsFr(nsCOMPtr<nsIPrefBranch> prefs,
class FsFrPrefClearer {
public:
FsFrPrefClearer(nsCOMPtr<nsIPrefBranch> prefs): mPrefs(prefs) {}
explicit FsFrPrefClearer(nsCOMPtr<nsIPrefBranch> prefs): mPrefs(prefs) {}
~FsFrPrefClearer() {
gMainThread->Dispatch(
WrapRunnableNM(FsFrPrefClearer::ClearUserPrefOnMainThread,