Bug 993734: Stop pretending that the observer service is threadsafe. r=bsmedberg
authorKyle Huey <khuey@kylehuey.com>
Mon, 14 Apr 2014 12:04:26 -0700
changeset 178722 04c91d627ba3a032c0641552aa4ca08530c5b20e
parent 178721 33f44f401f6ba9d83cf20964f038289a5bd01653
child 178723 11d4032a418ae260c6facc6e1c1d472d392be5b0
push id26594
push userryanvm@gmail.com
push dateWed, 16 Apr 2014 03:26:44 +0000
treeherdermozilla-central@dd50745d7f35 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs993734
milestone31.0a1
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 993734: Stop pretending that the observer service is threadsafe. r=bsmedberg
xpcom/ds/nsObserverService.cpp
xpcom/ds/nsObserverService.h
--- a/xpcom/ds/nsObserverService.cpp
+++ b/xpcom/ds/nsObserverService.cpp
@@ -217,17 +217,17 @@ nsObserverService::Create(nsISupports* o
         NS_NewRunnableMethod(os, &nsObserverService::RegisterReporter);
     NS_DispatchToCurrentThread(registerRunnable);
 
     return os->QueryInterface(aIID, aInstancePtr);
 }
 
 #define NS_ENSURE_VALIDCALL \
     if (!NS_IsMainThread()) {                                     \
-        NS_ERROR("Using observer service off the main thread!");  \
+        MOZ_CRASH("Using observer service off the main thread!"); \
         return NS_ERROR_UNEXPECTED;                               \
     }                                                             \
     if (mShuttingDown) {                                          \
         NS_ERROR("Using observer service after XPCOM shutdown!"); \
         return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;                  \
     }
 
 NS_IMETHODIMP
--- a/xpcom/ds/nsObserverService.h
+++ b/xpcom/ds/nsObserverService.h
@@ -22,17 +22,17 @@ class nsObserverService MOZ_FINAL
   : public nsIObserverService
   , public nsIMemoryReporter
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_OBSERVERSERVICE_CID)
 
   nsObserverService();
 
-  NS_DECL_THREADSAFE_ISUPPORTS
+  NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVERSERVICE
   NS_DECL_NSIMEMORYREPORTER
 
   void Shutdown();
 
   static nsresult
   Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);