diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp index 3aaeefeb52d8..ac91693a6508 100644 --- a/dom/src/storage/nsDOMStorage.cpp +++ b/dom/src/storage/nsDOMStorage.cpp @@ -70,8 +70,8 @@ using mozilla::dom::StorageChild; #include "nsIPrivateBrowsingService.h" #include "nsDOMString.h" #include "nsNetCID.h" -#include "nsIProxyObjectManager.h" #include "mozilla/Preferences.h" +#include "nsThreadUtils.h" using namespace mozilla; @@ -1898,6 +1898,34 @@ nsDOMStorage2::StorageType() return nsPIDOMStorage::Unknown; } +namespace { + +class StorageNotifierRunnable : public nsRunnable +{ +public: + StorageNotifierRunnable(nsISupports* aSubject) + : mSubject(aSubject) + { } + + NS_DECL_NSIRUNNABLE + +private: + nsCOMPtr mSubject; +}; + +NS_IMETHODIMP +StorageNotifierRunnable::Run() +{ + nsCOMPtr observerService = + mozilla::services::GetObserverService(); + if (observerService) { + observerService->NotifyObservers(mSubject, "dom-storage2-changed", nsnull); + } + return NS_OK; +} + +} // anonymous namespace + void nsDOMStorage2::BroadcastChangeNotification(const nsSubstring &aKey, const nsSubstring &aOldValue, @@ -1917,26 +1945,8 @@ nsDOMStorage2::BroadcastChangeNotification(const nsSubstring &aKey, return; } - nsCOMPtr observerService = - mozilla::services::GetObserverService(); - if (!observerService) { - return; - } - - nsCOMPtr observerServiceProxy; - rv = NS_GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIObserverService), - observerService, - NS_PROXY_ASYNC | NS_PROXY_ALWAYS, - getter_AddRefs(observerServiceProxy)); - if (NS_FAILED(rv)) { - return; - } - - // Fire off a notification that a storage object changed. - observerServiceProxy->NotifyObservers(event, - "dom-storage2-changed", - nsnull); + nsRefPtr r = new StorageNotifierRunnable(event); + NS_DispatchToMainThread(r); } NS_IMETHODIMP diff --git a/modules/libpr0n/src/imgLoader.cpp b/modules/libpr0n/src/imgLoader.cpp index 0488b1650f6f..04faeb86f556 100644 --- a/modules/libpr0n/src/imgLoader.cpp +++ b/modules/libpr0n/src/imgLoader.cpp @@ -62,7 +62,6 @@ #include "nsIProgressEventSink.h" #include "nsIChannelEventSink.h" #include "nsIAsyncVerifyRedirectCallback.h" -#include "nsIProxyObjectManager.h" #include "nsIServiceManager.h" #include "nsIFileURL.h" #include "nsThreadUtils.h" diff --git a/modules/libpr0n/src/imgRequest.cpp b/modules/libpr0n/src/imgRequest.cpp index 36e857fd5d41..c24354cb8ee9 100644 --- a/modules/libpr0n/src/imgRequest.cpp +++ b/modules/libpr0n/src/imgRequest.cpp @@ -67,7 +67,6 @@ #include "nsIComponentManager.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIProxyObjectManager.h" #include "nsIServiceManager.h" #include "nsISupportsPrimitives.h" #include "nsIScriptSecurityManager.h"