From 01f545fea7e55045aa2a11db4fe5e4e465ea2b33 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Tue, 8 Aug 2017 14:41:05 -0700 Subject: [PATCH] Bug 1386825 - Part 1: Remove MOZ_B2G from dom. r=bkelly MozReview-Commit-ID: 1zzP2r01B7U --- dom/base/nsGkAtomList.h | 3 - dom/base/nsGlobalWindow.cpp | 111 -------------------- dom/base/nsGlobalWindow.h | 12 --- dom/base/nsPIDOMWindow.h | 18 ---- dom/events/EventListenerManager.cpp | 34 ------ dom/events/EventNameList.h | 15 --- dom/events/KeyNameList.h | 4 - dom/events/TouchEvent.cpp | 2 +- dom/html/HTMLInputElement.cpp | 15 +-- dom/indexedDB/ActorsParent.cpp | 24 ----- dom/indexedDB/IDBObjectStore.cpp | 8 -- dom/indexedDB/IDBObjectStore.h | 2 - dom/ipc/ContentChild.cpp | 2 +- dom/ipc/ContentParent.cpp | 6 +- dom/ipc/TabContext.cpp | 4 - dom/media/AudioStream.cpp | 8 -- dom/media/CubebUtils.cpp | 27 ----- dom/media/CubebUtils.h | 3 - dom/media/GraphDriver.cpp | 8 -- dom/media/MediaManager.cpp | 8 -- dom/media/PeerConnection.js | 2 +- dom/media/webrtc/MediaEngine.h | 5 +- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 2 - dom/notification/DesktopNotification.h | 4 - dom/security/nsCSPContext.cpp | 9 -- dom/webidl/Window.webidl | 6 -- dom/webidl/moz.build | 8 -- 27 files changed, 7 insertions(+), 343 deletions(-) diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index c918285d934a..d96c54c1f18c 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -927,11 +927,8 @@ GK_ATOM(onmozkeydownonplugin, "onmozkeydownonplugin") GK_ATOM(onmozkeyuponplugin, "onmozkeyuponplugin") GK_ATOM(onmozpointerlockchange, "onmozpointerlockchange") GK_ATOM(onmozpointerlockerror, "onmozpointerlockerror") -GK_ATOM(onmoztimechange, "onmoztimechange") GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll") GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged") -GK_ATOM(onmoznetworkupload, "onmoznetworkupload") -GK_ATOM(onmoznetworkdownload, "onmoznetworkdownload") GK_ATOM(onmapfolderlistingreq, "onmapfolderlistingreq") GK_ATOM(onmapmessageslistingreq, "onmapmessageslistingreq") GK_ATOM(onmapgetmessagereq, "onmapgetmessagereq") diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 69d4ff0df96c..fc14b68439de 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -257,10 +257,6 @@ #include "mozilla/dom/SpeechSynthesis.h" #endif -#ifdef MOZ_B2G -#include "nsPISocketTransportService.h" -#endif - // Apple system headers seem to have a check() macro. #ifdef check class nsIScriptTimeoutHandler; @@ -1622,10 +1618,6 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow) mIdleRequestExecutor(nullptr), #ifdef DEBUG mSetOpenerWindowCalled(false), -#endif -#ifdef MOZ_B2G - mNetworkUploadObserverEnabled(false), - mNetworkDownloadObserverEnabled(false), #endif mCleanedUp(false), mDialogAbuseCount(0), @@ -1971,11 +1963,6 @@ nsGlobalWindow::CleanUp() sns->Unregister(mObserver); } -#ifdef MOZ_B2G - DisableNetworkEvent(eNetworkUpload); - DisableNetworkEvent(eNetworkDownload); -#endif // MOZ_B2G - if (mIdleService) { mIdleService->RemoveIdleObserver(mObserver, MIN_IDLE_NOTIFICATION_TIME_S); } @@ -2047,9 +2034,6 @@ nsGlobalWindow::CleanUp() DisableVRUpdates(); mHasVREvents = false; mHasVRDisplayActivateEvents = false; -#ifdef MOZ_B2G - DisableTimeChangeNotifications(); -#endif DisableIdleCallbackRequests(); } else { MOZ_ASSERT(!mHasGamepad); @@ -12168,27 +12152,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 = 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()); @@ -14667,80 +14630,6 @@ nsGlobalWindow::ReportLargeAllocStatus() message); } -#ifdef MOZ_B2G -void -nsGlobalWindow::EnableNetworkEvent(EventMessage aEventMessage) -{ - MOZ_ASSERT(IsInnerWindow()); - - nsCOMPtr 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 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 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 aValue, diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 3a291bc815e8..c218dbe8d487 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -653,13 +653,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(); @@ -1977,11 +1970,6 @@ protected: nsCOMPtr mLastOpenedURI; #endif -#ifdef MOZ_B2G - bool mNetworkUploadObserverEnabled; - bool mNetworkDownloadObserverEnabled; -#endif // MOZ_B2G - bool mCleanedUp; nsCOMPtr mApplicationCache; diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 65c751f89c1a..b2f1d892db21 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -493,24 +493,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 * diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index 870fb39df3bd..765bb1cedb4d 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -13,9 +13,6 @@ #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventListenerManager.h" -#ifdef MOZ_B2G -#include "mozilla/Hal.h" -#endif // #ifdef MOZ_B2G #include "mozilla/HalSensor.h" #include "mozilla/InternalMutationEvent.h" #include "mozilla/JSEventHandler.h" @@ -350,14 +347,6 @@ EventListenerManager::AddEventListenerInternal( } else if (aTypeAtom == nsGkAtoms::onorientationchange) { EnableDevice(eOrientationChange); #endif -#ifdef MOZ_B2G - } else if (aTypeAtom == nsGkAtoms::onmoztimechange) { - EnableDevice(eTimeChange); - } else if (aTypeAtom == nsGkAtoms::onmoznetworkupload) { - EnableDevice(eNetworkUpload); - } else if (aTypeAtom == nsGkAtoms::onmoznetworkdownload) { - EnableDevice(eNetworkDownload); -#endif // MOZ_B2G } else if (aTypeAtom == nsGkAtoms::ontouchstart || aTypeAtom == nsGkAtoms::ontouchend || aTypeAtom == nsGkAtoms::ontouchmove || @@ -492,11 +481,6 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage) case eUserProximity: #if defined(MOZ_WIDGET_ANDROID) case eOrientationChange: -#endif -#ifdef MOZ_B2G - case eTimeChange: - case eNetworkUpload: - case eNetworkDownload: #endif return true; default: @@ -548,15 +532,6 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage) case eOrientationChange: window->EnableOrientationChangeListener(); break; -#endif -#ifdef MOZ_B2G - case eTimeChange: - window->EnableTimeChangeNotifications(); - break; - case eNetworkUpload: - case eNetworkDownload: - window->EnableNetworkEvent(aEventMessage); - break; #endif default: NS_WARNING("Enabling an unknown device sensor."); @@ -604,15 +579,6 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage) window->DisableOrientationChangeListener(); break; #endif -#ifdef MOZ_B2G - case eTimeChange: - window->DisableTimeChangeNotifications(); - break; - case eNetworkUpload: - case eNetworkDownload: - window->DisableNetworkEvent(aEventMessage); - break; -#endif // MOZ_B2G default: NS_WARNING("Disabling an unknown device sensor."); break; diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 680650db62ef..463a06aa81f6 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -642,21 +642,6 @@ WINDOW_ONLY_EVENT(appinstalled, eBasicEventClass) -#ifdef MOZ_B2G -WINDOW_ONLY_EVENT(moztimechange, - eTimeChange, - EventNameType_None, - eBasicEventClass) -WINDOW_ONLY_EVENT(moznetworkupload, - eNetworkUpload, - EventNameType_None, - eBasicEventClass) -WINDOW_ONLY_EVENT(moznetworkdownload, - eNetworkDownload, - EventNameType_None, - eBasicEventClass) -#endif // MOZ_B2G - TOUCH_EVENT(touchstart, eTouchStart, EventNameType_All, diff --git a/dom/events/KeyNameList.h b/dom/events/KeyNameList.h index 6bb9830b2a53..43ce191f625d 100644 --- a/dom/events/KeyNameList.h +++ b/dom/events/KeyNameList.h @@ -32,10 +32,6 @@ DEFINE_KEYNAME_INTERNAL(PrintableKey, "MozPrintableKey") DEFINE_KEYNAME_INTERNAL(SoftLeft, "MozSoftLeft") DEFINE_KEYNAME_INTERNAL(SoftRight, "MozSoftRight") -#ifdef MOZ_B2G -DEFINE_KEYNAME_INTERNAL(HomeScreen, "MozHomeScreen") -#endif // #ifdef MOZ_B2G - /****************************************************************************** * Modifier Keys *****************************************************************************/ diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index e17ff3fb0120..4d5fa07f687e 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -203,7 +203,7 @@ TouchEvent::PrefEnabled(nsIDocShell* aDocShell) enabled = false; } else { if (sPrefCacheValue == 2) { -#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID) +#if defined(MOZ_WIDGET_ANDROID) // Touch support is always enabled on B2G and android. enabled = true; #elif defined(XP_WIN) || MOZ_WIDGET_GTK == 3 diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 1f4bb9d0277d..986b8f529677 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -1025,13 +1025,6 @@ UploadLastDir::FetchDirectoryAndDisplayPicker(nsIDocument* aDoc, nsCOMPtr prefCallback = new UploadLastDir::ContentPrefCallback(aFilePicker, aFpCallback); -#ifdef MOZ_B2G - if (XRE_IsContentProcess()) { - prefCallback->HandleCompletion(nsIContentPrefCallback2::COMPLETE_ERROR); - return NS_OK; - } -#endif - // Attempt to get the CPS, if it's not present we'll fallback to use the Desktop folder nsCOMPtr contentPrefService = do_GetService(NS_CONTENT_PREF_SERVICE_CONTRACTID); @@ -1056,12 +1049,6 @@ UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir) return NS_OK; } -#ifdef MOZ_B2G - if (XRE_IsContentProcess()) { - return NS_OK; - } -#endif - nsCOMPtr docURI = aDoc->GetDocumentURI(); NS_PRECONDITION(docURI, "docURI is null"); @@ -5921,7 +5908,7 @@ HTMLInputElement::ChooseDirectory(ErrorResult& aRv) // "Pick Folder..." button on platforms that don't have a directory picker // we have to redirect to the file picker here. InitFilePicker( -#if defined(ANDROID) || defined(MOZ_B2G) +#if defined(ANDROID) // No native directory picker - redirect to plain file picker FILE_PICKER_FILE #else diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index cfe92921867e..d67ce2b070c5 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -3647,8 +3647,6 @@ UpgradeSchemaFrom18_0To19_0(mozIStorageConnection* aConnection) return NS_OK; } -#if !defined(MOZ_B2G) - class NormalJSContext; class UpgradeFileIdsFunction final @@ -3684,8 +3682,6 @@ private: nsIVariant** aResult) override; }; -#endif // MOZ_B2G - nsresult UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory, mozIStorageConnection* aConnection) @@ -3695,20 +3691,6 @@ UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory, AUTO_PROFILER_LABEL("UpgradeSchemaFrom19_0To20_0", STORAGE); -#if defined(MOZ_B2G) - - // We don't have to do the upgrade of file ids on B2G. The old format was - // only used by the previous single process implementation and B2G was - // always multi process. This is a nice optimization since the upgrade needs - // to deserialize all structured clones which reference a stored file or - // a mutable file. - nsresult rv = aConnection->SetSchemaVersion(MakeSchemaVersion(20, 0)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - -#else // MOZ_B2G - nsCOMPtr stmt; nsresult rv = aConnection->CreateStatement(NS_LITERAL_CSTRING( "SELECT count(*) " @@ -3807,8 +3789,6 @@ UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory, return rv; } -#endif // MOZ_B2G - return NS_OK; } @@ -19546,8 +19526,6 @@ NS_IMPL_ISUPPORTS(CompressDataBlobsFunction, mozIStorageFunction) NS_IMPL_ISUPPORTS(EncodeKeysFunction, mozIStorageFunction) NS_IMPL_ISUPPORTS(StripObsoleteOriginAttributesFunction, mozIStorageFunction); -#if !defined(MOZ_B2G) - nsresult UpgradeFileIdsFunction::Init(nsIFile* aFMDirectory, mozIStorageConnection* aConnection) @@ -19639,8 +19617,6 @@ UpgradeFileIdsFunction::OnFunctionCall(mozIStorageValueArray* aArguments, return NS_OK; } -#endif // MOZ_B2G - // static void DatabaseOperationBase::GetBindingClauseForKeyRange( diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index 76d741fbe625..33d8aebbb87c 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -804,8 +804,6 @@ public: // We don't need to upgrade database on B2G. See the comment in ActorsParent.cpp, // UpgradeSchemaFrom18_0To19_0() -#if !defined(MOZ_B2G) - class UpgradeDeserializationHelper { public: @@ -872,8 +870,6 @@ public: } }; -#endif // MOZ_B2G - template JSObject* CommonStructuredCloneReadCallback(JSContext* aCx, @@ -1214,8 +1210,6 @@ IDBObjectStore::DeserializeIndexValue(JSContext* aCx, return true; } -#if !defined(MOZ_B2G) - // static bool IDBObjectStore::DeserializeUpgradeValue(JSContext* aCx, @@ -1252,8 +1246,6 @@ IDBObjectStore::DeserializeUpgradeValue(JSContext* aCx, return true; } -#endif // MOZ_B2G - #ifdef DEBUG void diff --git a/dom/indexedDB/IDBObjectStore.h b/dom/indexedDB/IDBObjectStore.h index 7a255a4afc62..994931afa5e6 100644 --- a/dom/indexedDB/IDBObjectStore.h +++ b/dom/indexedDB/IDBObjectStore.h @@ -101,12 +101,10 @@ public: StructuredCloneReadInfo& aCloneReadInfo, JS::MutableHandle aValue); -#if !defined(MOZ_B2G) static bool DeserializeUpgradeValue(JSContext* aCx, StructuredCloneReadInfo& aCloneReadInfo, JS::MutableHandle aValue); -#endif static const JSClass* DummyPropClass() diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 0e4a068feb33..a121fd7354d8 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -2300,7 +2300,7 @@ ContentChild::ProcessingError(Result aCode, const char* aReason) MOZ_CRASH("not reached"); } -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) +#if defined(MOZ_CRASHREPORTER) nsDependentCString reason(aReason); CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ipc_channel_error"), reason); #endif diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 844c84bbfe1a..710776d58cb6 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -2098,12 +2098,10 @@ ContentParent::ContentParent(ContentParent* aOpener, if (XRE_IsParentProcess()) { audio::AudioNotificationSender::Init(); } -#if !defined(MOZ_B2G) // Request Windows message deferral behavior on our side of the PContent // channel. Generally only applies to the situation where we get caught in // a deadlock with the plugin process when sending CPOWs. GetIPCChannel()->SetChannelFlags(MessageChannel::REQUIRE_DEFERRED_MESSAGE_PROTECTION); -#endif #endif NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -2932,7 +2930,7 @@ ContentParent::KillHard(const char* aReason) mCalledKillHard = true; mForceKillTimer = nullptr; -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) +#if defined(MOZ_CRASHREPORTER) // We're about to kill the child process associated with this content. // Something has gone wrong to get us here, so we generate a minidump // of the parent and child for submission to the crash server. @@ -2972,7 +2970,7 @@ ContentParent::KillHard(const char* aReason) void ContentParent::OnGenerateMinidumpComplete(bool aDumpResult) { -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) +#if defined(MOZ_CRASHREPORTER) if (mCrashReporter && aDumpResult) { // CrashReporterHost::GenerateMinidumpAndPair() is successful. mCreatedPairedMinidumps = mCrashReporter->FinalizeCrashReport(); diff --git a/dom/ipc/TabContext.cpp b/dom/ipc/TabContext.cpp index 293650040def..8a6d462ab6ea 100644 --- a/dom/ipc/TabContext.cpp +++ b/dom/ipc/TabContext.cpp @@ -246,10 +246,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams) // It is meant as a temporary solution until service workers can // provide a TabChild equivalent. Don't allow this on b2g since // it might be used to escalate privileges. -#ifdef MOZ_B2G - mInvalidReason = "ServiceWorkerClients::OpenWindow is not supported."; - return; -#endif if (!Preferences::GetBool("dom.serviceWorkers.enabled", false)) { mInvalidReason = "ServiceWorkers should be enabled."; return; diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index d857176d1c79..d673902d4eac 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -347,17 +347,9 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aChannelMap, uint32_t aRate, params.channels = mOutChannels; params.layout = CubebUtils::ConvertChannelMapToCubebLayout(aChannelMap); #if defined(__ANDROID__) -#if defined(MOZ_B2G) - params.stream_type = CubebUtils::ConvertChannelToCubebType(aAudioChannel); -#else params.stream_type = CUBEB_STREAM_TYPE_MUSIC; #endif - if (params.stream_type == CUBEB_STREAM_TYPE_MAX) { - return NS_ERROR_INVALID_ARG; - } -#endif - params.format = ToCubebFormat::value; mAudioClock.Init(aRate); diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp index 2697e5f4275e..92e7ed1d3af7 100644 --- a/dom/media/CubebUtils.cpp +++ b/dom/media/CubebUtils.cpp @@ -490,33 +490,6 @@ cubeb_channel_layout ConvertChannelMapToCubebLayout(uint32_t aChannelMap) } } -#if defined(__ANDROID__) && defined(MOZ_B2G) -cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel) -{ - switch(aChannel) { - case dom::AudioChannel::Normal: - /* FALLTHROUGH */ - case dom::AudioChannel::Content: - return CUBEB_STREAM_TYPE_MUSIC; - case dom::AudioChannel::Notification: - return CUBEB_STREAM_TYPE_NOTIFICATION; - case dom::AudioChannel::Alarm: - return CUBEB_STREAM_TYPE_ALARM; - case dom::AudioChannel::Telephony: - return CUBEB_STREAM_TYPE_VOICE_CALL; - case dom::AudioChannel::Ringer: - return CUBEB_STREAM_TYPE_RING; - case dom::AudioChannel::System: - return CUBEB_STREAM_TYPE_SYSTEM; - case dom::AudioChannel::Publicnotification: - return CUBEB_STREAM_TYPE_SYSTEM_ENFORCED; - default: - NS_ERROR("The value of AudioChannel is invalid"); - return CUBEB_STREAM_TYPE_MAX; - } -} -#endif - void GetCurrentBackend(nsAString& aBackend) { cubeb* cubebContext = GetCubebContext(); diff --git a/dom/media/CubebUtils.h b/dom/media/CubebUtils.h index cb800d1bee4f..a5c2ff8128f1 100644 --- a/dom/media/CubebUtils.h +++ b/dom/media/CubebUtils.h @@ -50,9 +50,6 @@ uint32_t GetCubebPlaybackLatencyInMilliseconds(); Maybe GetCubebMSGLatencyInFrames(); bool CubebLatencyPrefSet(); cubeb_channel_layout ConvertChannelMapToCubebLayout(uint32_t aChannelMap); -#if defined(__ANDROID__) && defined(MOZ_B2G) -cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel); -#endif void GetCurrentBackend(nsAString& aBackend); void GetPreferredChannelLayout(nsAString& aLayout); void GetDeviceCollection(nsTArray>& aDeviceInfos, diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index a06cb5b9f092..846e090d3180 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -628,15 +628,7 @@ AudioCallbackDriver::Init() mSampleRate = output.rate = CubebUtils::PreferredSampleRate(); #if defined(__ANDROID__) -#if defined(MOZ_B2G) - output.stream_type = CubebUtils::ConvertChannelToCubebType(mAudioChannel); -#else output.stream_type = CUBEB_STREAM_TYPE_MUSIC; -#endif - if (output.stream_type == CUBEB_STREAM_TYPE_MAX) { - NS_WARNING("Bad stream type"); - return false; - } #else (void)mAudioChannel; #endif diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 439fc70dddde..aad59d5181d1 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -69,10 +69,6 @@ #include "browser_logging/WebRtcLog.h" #endif -#ifdef MOZ_B2G -#include "MediaPermissionGonk.h" -#endif - #if defined (XP_WIN) #include "mozilla/WindowsVersion.h" #include @@ -1937,10 +1933,6 @@ MediaManager::Get() { __LINE__, NS_LITERAL_STRING("Media shutdown")); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); -#ifdef MOZ_B2G - // Init MediaPermissionManager before sending out any permission requests. - (void) MediaPermissionManager::GetInstance(); -#endif //MOZ_B2G } return sSingleton; } diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 9c62765736dc..1a66fc5dd89e 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -828,7 +828,7 @@ class RTCPeerConnection { async _getPermission() { if (!this._havePermission) { - let privileged = this._isChrome || AppConstants.MOZ_B2G || + let privileged = this._isChrome || Services.prefs.getBoolPref("media.navigator.permission.disabled"); if (privileged) { diff --git a/dom/media/webrtc/MediaEngine.h b/dom/media/webrtc/MediaEngine.h index a60afc507050..37b48c125cb8 100644 --- a/dom/media/webrtc/MediaEngine.h +++ b/dom/media/webrtc/MediaEngine.h @@ -55,11 +55,8 @@ public: static const int DEFAULT_169_VIDEO_WIDTH = 1280; static const int DEFAULT_169_VIDEO_HEIGHT = 720; -#ifndef MOZ_B2G static const int DEFAULT_SAMPLE_RATE = 32000; -#else - static const int DEFAULT_SAMPLE_RATE = 16000; -#endif + // This allows using whatever rate the graph is using for the // MediaStreamTrack. This is useful for microphone data, we know it's already // at the correct rate for insertion in the MSG. diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index fa77edd0aebb..e1e432724e5e 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -814,7 +814,6 @@ MediaEngineWebRTCMicrophoneSource::AllocChannel() // Check for availability. if (!mAudioInput->SetRecordingDevice(mCapIndex)) { -#ifndef MOZ_B2G // Because of the permission mechanism of B2G, we need to skip the status // check here. bool avail = false; @@ -825,7 +824,6 @@ MediaEngineWebRTCMicrophoneSource::AllocChannel() } return false; } -#endif // MOZ_B2G // Set "codec" to PCM, 32kHz on device's channels ScopedCustomReleasePtr ptrVoECodec(webrtc::VoECodec::GetInterface(mVoiceEngine)); diff --git a/dom/notification/DesktopNotification.h b/dom/notification/DesktopNotification.h index e1cb2efbc7ca..5fd5e4c03673 100644 --- a/dom/notification/DesktopNotification.h +++ b/dom/notification/DesktopNotification.h @@ -159,10 +159,6 @@ class AlertServiceObserver: public nsIObserver // forward to parent if (mNotification) { -#ifdef MOZ_B2G - if (NS_FAILED(mNotification->CheckInnerWindowCorrectness())) - return NS_ERROR_NOT_AVAILABLE; -#endif mNotification->HandleAlertServiceNotification(aTopic); } return NS_OK; diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index 1ba188caf030..7886660a2e79 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -868,15 +868,6 @@ nsCSPContext::SendReports(nsISupports* aBlockedContentSource, { NS_ENSURE_ARG_MAX(aViolatedPolicyIndex, mPolicies.Length() - 1); -#ifdef MOZ_B2G - // load group information (on process-split necko implementations like b2g). - // (fix this in bug 1011086) - if (!mCallingChannelLoadGroup) { - NS_WARNING("Load group required but not present for report sending; cannot send CSP violation reports"); - return NS_ERROR_FAILURE; - } -#endif - dom::CSPReport report; nsresult rv; diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl index ae02f7b1d44f..4cb07bb380a5 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -317,12 +317,6 @@ partial interface Window { attribute EventHandler onuserproximity; attribute EventHandler ondevicelight; -#ifdef MOZ_B2G - attribute EventHandler onmoztimechange; - attribute EventHandler onmoznetworkupload; - attribute EventHandler onmoznetworkdownload; -#endif - void dump(DOMString str); /** diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 948990711af5..5310eb1f5390 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -1131,14 +1131,6 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: 'External.webidl', ] -if CONFIG['MOZ_B2G']: - WEBIDL_FILES += [ - 'MozApplicationEvent.webidl' - ] - GENERATED_EVENTS_WEBIDL_FILES += [ - 'MozApplicationEvent.webidl' - ] - if CONFIG['ACCESSIBILITY']: WEBIDL_FILES += [ 'AccessibleNode.webidl',