Bug 615745 - Make CookieServiceChild add strong pref observers. r=dwitte a=blocking-fennec
authorJosh Matthews <josh@joshmatthews.net>
Tue, 30 Nov 2010 21:47:08 -0500
changeset 59212 e65c1b9d95fbcf63254f57d7fa57332f5168ae71
parent 59211 5a4959ebd32631c7a73a7553e7c54cba42704092
child 59213 42b6d032e3122b8337ad16ca086fdff3c350e9f4
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwitte, blocking-fennec
bugs615745
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 615745 - Make CookieServiceChild add strong pref observers. r=dwitte a=blocking-fennec
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceChild.h
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -62,17 +62,20 @@ CookieServiceChild::GetSingleton()
 {
   if (!gCookieService)
     gCookieService = new CookieServiceChild();
 
   NS_ADDREF(gCookieService);
   return gCookieService;
 }
 
-NS_IMPL_ISUPPORTS2(CookieServiceChild, nsICookieService, nsIObserver)
+NS_IMPL_ISUPPORTS3(CookieServiceChild,
+                   nsICookieService,
+                   nsIObserver,
+                   nsISupportsWeakReference)
 
 CookieServiceChild::CookieServiceChild()
   : mCookieBehavior(BEHAVIOR_ACCEPT)
   , mThirdPartySession(false)
 {
   NS_ASSERTION(IsNeckoChild(), "not a child process");
 
   // This corresponds to Release() in DeallocPCookieService.
--- a/netwerk/cookie/CookieServiceChild.h
+++ b/netwerk/cookie/CookieServiceChild.h
@@ -39,23 +39,25 @@
 #ifndef mozilla_net_CookieServiceChild_h__
 #define mozilla_net_CookieServiceChild_h__
 
 #include "mozilla/net/PCookieServiceChild.h"
 #include "nsICookieService.h"
 #include "nsIObserver.h"
 #include "nsIPrefBranch.h"
 #include "mozIThirdPartyUtil.h"
+#include "nsWeakReference.h"
 
 namespace mozilla {
 namespace net {
 
 class CookieServiceChild : public PCookieServiceChild
                          , public nsICookieService
                          , public nsIObserver
+                         , public nsSupportsWeakReference
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICOOKIESERVICE
   NS_DECL_NSIOBSERVER
 
   CookieServiceChild();
   virtual ~CookieServiceChild();