diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 14:32:03 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 14:32:03 +0200 |
commit | b7d9dad58e5a3f87a6c767412941700bc8010044 (patch) | |
tree | f5e99b3029cf54409ae5951e9e91cca3a54addc7 /dom/base | |
parent | 73cdd6117df7c17b76aad93952cf574c494351aa (diff) | |
download | uxp-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.gz |
Remove MOZ_B2G leftovers and some dead B2G-only components.
Diffstat (limited to 'dom/base')
-rw-r--r-- | dom/base/nsGlobalWindow.cpp | 111 | ||||
-rw-r--r-- | dom/base/nsGlobalWindow.h | 12 | ||||
-rw-r--r-- | dom/base/nsPIDOMWindow.h | 18 |
3 files changed, 0 insertions, 141 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 4ffccde9d3..9663a6dbf7 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -249,10 +249,6 @@ #include "mozilla/dom/SpeechSynthesis.h" #endif -#ifdef MOZ_B2G -#include "nsPISocketTransportService.h" -#endif - // Apple system headers seem to have a check() macro. <sigh> #ifdef check class nsIScriptTimeoutHandler; @@ -1557,10 +1553,6 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow) #ifdef DEBUG mSetOpenerWindowCalled(false), #endif -#ifdef MOZ_B2G - mNetworkUploadObserverEnabled(false), - mNetworkDownloadObserverEnabled(false), -#endif mCleanedUp(false), mDialogAbuseCount(0), mAreDialogsEnabled(true), @@ -1913,11 +1905,6 @@ nsGlobalWindow::CleanUp() os->RemoveObserver(mObserver, "dom-storage2-changed"); } -#ifdef MOZ_B2G - DisableNetworkEvent(eNetworkUpload); - DisableNetworkEvent(eNetworkDownload); -#endif // MOZ_B2G - if (mIdleService) { mIdleService->RemoveIdleObserver(mObserver, MIN_IDLE_NOTIFICATION_TIME_S); } @@ -1986,9 +1973,6 @@ nsGlobalWindow::CleanUp() mHasGamepad = false; DisableVRUpdates(); mHasVREvents = false; -#ifdef MOZ_B2G - DisableTimeChangeNotifications(); -#endif DisableIdleCallbackRequests(); } else { MOZ_ASSERT(!mHasGamepad); @@ -12133,27 +12117,6 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic, return NS_OK; } -#ifdef MOZ_B2G - if (!nsCRT::strcmp(aTopic, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC) || - !nsCRT::strcmp(aTopic, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC)) { - MOZ_ASSERT(IsInnerWindow()); - if (!AsInner()->IsCurrentInnerWindow()) { - return NS_OK; - } - - RefPtr<Event> event = NS_NewDOMEvent(this, nullptr, nullptr); - event->InitEvent( - !nsCRT::strcmp(aTopic, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC) - ? NETWORK_UPLOAD_EVENT_NAME - : NETWORK_DOWNLOAD_EVENT_NAME, - false, false); - event->SetTrusted(true); - - bool dummy; - return DispatchEvent(event, &dummy); - } -#endif // MOZ_B2G - if (!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) { MOZ_ASSERT(!NS_strcmp(aData, u"intl.accept_languages")); MOZ_ASSERT(IsInnerWindow()); @@ -15053,80 +15016,6 @@ nsGlobalWindow::GetIsPrerendered() return docShell && docShell->GetIsPrerendered(); } -#ifdef MOZ_B2G -void -nsGlobalWindow::EnableNetworkEvent(EventMessage aEventMessage) -{ - MOZ_ASSERT(IsInnerWindow()); - - nsCOMPtr<nsIPermissionManager> permMgr = - services::GetPermissionManager(); - if (!permMgr) { - NS_ERROR("No PermissionManager available!"); - return; - } - - uint32_t permission = nsIPermissionManager::DENY_ACTION; - permMgr->TestExactPermissionFromPrincipal(GetPrincipal(), "network-events", - &permission); - - if (permission != nsIPermissionManager::ALLOW_ACTION) { - return; - } - - nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService(); - if (!os) { - NS_ERROR("ObserverService should be available!"); - return; - } - - switch (aEventMessage) { - case eNetworkUpload: - if (!mNetworkUploadObserverEnabled) { - mNetworkUploadObserverEnabled = true; - os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC, false); - } - break; - case eNetworkDownload: - if (!mNetworkDownloadObserverEnabled) { - mNetworkDownloadObserverEnabled = true; - os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC, false); - } - break; - default: - break; - } -} - -void -nsGlobalWindow::DisableNetworkEvent(EventMessage aEventMessage) -{ - MOZ_ASSERT(IsInnerWindow()); - - nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService(); - if (!os) { - return; - } - - switch (aEventMessage) { - case eNetworkUpload: - if (mNetworkUploadObserverEnabled) { - mNetworkUploadObserverEnabled = false; - os->RemoveObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC); - } - break; - case eNetworkDownload: - if (mNetworkDownloadObserverEnabled) { - mNetworkDownloadObserverEnabled = false; - os->RemoveObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC); - } - break; - default: - break; - } -} -#endif // MOZ_B2G - void nsGlobalWindow::RedefineProperty(JSContext* aCx, const char* aPropName, JS::Handle<JS::Value> aValue, diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 78bee63a19..94d565bf32 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -639,13 +639,6 @@ public: virtual void EnableTimeChangeNotifications() override; virtual void DisableTimeChangeNotifications() override; -#ifdef MOZ_B2G - // Inner windows only. - virtual void EnableNetworkEvent(mozilla::EventMessage aEventMessage) override; - virtual void DisableNetworkEvent( - mozilla::EventMessage aEventMessage) override; -#endif // MOZ_B2G - virtual nsresult SetArguments(nsIArray* aArguments) override; void MaybeForgiveSpamCount(); @@ -1941,11 +1934,6 @@ protected: nsCOMPtr<nsIURI> mLastOpenedURI; #endif -#ifdef MOZ_B2G - bool mNetworkUploadObserverEnabled; - bool mNetworkDownloadObserverEnabled; -#endif // MOZ_B2G - bool mCleanedUp; nsCOMPtr<nsIDOMOfflineResourceList> mApplicationCache; diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 45823057a5..3fd666beba 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -452,24 +452,6 @@ public: virtual void EnableTimeChangeNotifications() = 0; virtual void DisableTimeChangeNotifications() = 0; -#ifdef MOZ_B2G - /** - * Tell the window that it should start to listen to the network event of the - * given aType. - * - * Inner windows only. - */ - virtual void EnableNetworkEvent(mozilla::EventMessage aEventMessage) = 0; - - /** - * Tell the window that it should stop to listen to the network event of the - * given aType. - * - * Inner windows only. - */ - virtual void DisableNetworkEvent(mozilla::EventMessage aEventMessage) = 0; -#endif // MOZ_B2G - /** * Tell this window that there is an observer for gamepad input * |