Bug 1036877: add private dtor for Reference-counted RIL components. r=hsinyi

This commit is contained in:
Vicamo Yang 2014-07-11 15:58:01 +08:00
parent d65ed48c6f
commit fc819e312b
10 changed files with 44 additions and 2 deletions

View File

@ -37,6 +37,12 @@ public:
MOZ_ASSERT(mCellBroadcast); MOZ_ASSERT(mCellBroadcast);
mCellBroadcast = nullptr; mCellBroadcast = nullptr;
} }
private:
~Listener()
{
MOZ_ASSERT(!mCellBroadcast);
}
}; };
NS_IMPL_ISUPPORTS(CellBroadcast::Listener, nsICellBroadcastListener) NS_IMPL_ISUPPORTS(CellBroadcast::Listener, nsICellBroadcastListener)

View File

@ -21,7 +21,6 @@ public:
NS_DECL_NSIICCLISTENER NS_DECL_NSIICCLISTENER
IccListener(IccManager* aIccManager, uint32_t aClientId); IccListener(IccManager* aIccManager, uint32_t aClientId);
~IccListener();
void void
Shutdown(); Shutdown();
@ -32,6 +31,9 @@ public:
return mIcc; return mIcc;
} }
private:
~IccListener();
private: private:
uint32_t mClientId; uint32_t mClientId;
// We did not setup 'mIcc' and 'mIccManager' being a participant of cycle // We did not setup 'mIcc' and 'mIccManager' being a participant of cycle

View File

@ -26,7 +26,6 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IccManager, DOMEventTargetHelper) NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IccManager, DOMEventTargetHelper)
IccManager(nsPIDOMWindow* aWindow); IccManager(nsPIDOMWindow* aWindow);
~IccManager();
void void
Shutdown(); Shutdown();
@ -52,6 +51,9 @@ public:
virtual JSObject* virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE; WrapObject(JSContext* aCx) MOZ_OVERRIDE;
private:
~IccManager();
private: private:
nsTArray<nsRefPtr<IccListener>> mIccListeners; nsTArray<nsRefPtr<IccListener>> mIccListeners;
}; };

View File

@ -43,6 +43,9 @@ public:
return mInfo; return mInfo;
} }
private:
~DOMMMIError() {}
private: private:
nsString mServiceCode; nsString mServiceCode;
Nullable<int16_t> mInfo; Nullable<int16_t> mInfo;

View File

@ -78,6 +78,9 @@ public:
return mCdmaNetworkId; return mCdmaNetworkId;
} }
private:
~MobileCellInfo() {}
private: private:
nsCOMPtr<nsPIDOMWindow> mWindow; nsCOMPtr<nsPIDOMWindow> mWindow;
int32_t mGsmLocationAreaCode; int32_t mGsmLocationAreaCode;

View File

@ -62,6 +62,12 @@ public:
MOZ_ASSERT(mMobileConnection); MOZ_ASSERT(mMobileConnection);
mMobileConnection = nullptr; mMobileConnection = nullptr;
} }
private:
~Listener()
{
MOZ_ASSERT(!mMobileConnection);
}
}; };
NS_IMPL_ISUPPORTS(MobileConnection::Listener, nsIMobileConnectionListener) NS_IMPL_ISUPPORTS(MobileConnection::Listener, nsIMobileConnectionListener)
@ -130,6 +136,11 @@ MobileConnection::Shutdown()
} }
} }
MobileConnection::~MobileConnection()
{
MOZ_ASSERT(!(mProvider || mListener || mVoice || mData));
}
JSObject* JSObject*
MobileConnection::WrapObject(JSContext* aCx) MobileConnection::WrapObject(JSContext* aCx)
{ {

View File

@ -155,6 +155,9 @@ public:
IMPL_EVENT_HANDLER(radiostatechange) IMPL_EVENT_HANDLER(radiostatechange)
IMPL_EVENT_HANDLER(clirmodechange) IMPL_EVENT_HANDLER(clirmodechange)
private:
~MobileConnection();
private: private:
uint32_t mClientId; uint32_t mClientId;
nsCOMPtr<nsIMobileConnectionProvider> mProvider; nsCOMPtr<nsIMobileConnectionProvider> mProvider;

View File

@ -93,6 +93,9 @@ public:
return mCellInfo; return mCellInfo;
} }
private:
~MobileConnectionInfo() {}
private: private:
bool mConnected; bool mConnected;
bool mEmergencyCallsOnly; bool mEmergencyCallsOnly;

View File

@ -61,6 +61,9 @@ public:
return Nullable<MobileNetworkState>(); return Nullable<MobileNetworkState>();
} }
private:
~MobileNetworkInfo() {}
private: private:
nsCOMPtr<nsPIDOMWindow> mWindow; nsCOMPtr<nsPIDOMWindow> mWindow;
nsString mShortName; nsString mShortName;

View File

@ -39,6 +39,12 @@ public:
MOZ_ASSERT(mVoicemail); MOZ_ASSERT(mVoicemail);
mVoicemail = nullptr; mVoicemail = nullptr;
} }
private:
~Listener()
{
MOZ_ASSERT(!mVoicemail);
}
}; };
NS_IMPL_ISUPPORTS(Voicemail::Listener, nsIVoicemailListener) NS_IMPL_ISUPPORTS(Voicemail::Listener, nsIVoicemailListener)