Bug 993734: Stop pretending that the observer service is threadsafe. r=bsmedberg
☠☠ backed out by e2cf132023be ☠ ☠
authorKyle Huey <khuey@kylehuey.com>
Mon, 14 Apr 2014 12:04:26 -0700
changeset 196896 3797f7c91ed2f88712b6a847380b9a75dbbfa7cf
parent 196895 9d4032c2f2372b2d9af180404f0d26fdfa3f6d36
child 196897 e2d5b2be4142f7407be4e58afb9a23eba667105f
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [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);