зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1386825 - Part 1: Remove MOZ_B2G from dom. r=bkelly
MozReview-Commit-ID: 1zzP2r01B7U
This commit is contained in:
Родитель
bd9fcfbc01
Коммит
01f545fea7
|
@ -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")
|
||||
|
|
|
@ -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. <sigh>
|
||||
#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> 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<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,
|
||||
|
|
|
@ -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<nsIURI> mLastOpenedURI;
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_B2G
|
||||
bool mNetworkUploadObserverEnabled;
|
||||
bool mNetworkDownloadObserverEnabled;
|
||||
#endif // MOZ_B2G
|
||||
|
||||
bool mCleanedUp;
|
||||
|
||||
nsCOMPtr<nsIDOMOfflineResourceList> mApplicationCache;
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
*****************************************************************************/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1025,13 +1025,6 @@ UploadLastDir::FetchDirectoryAndDisplayPicker(nsIDocument* aDoc,
|
|||
nsCOMPtr<nsIContentPrefCallback2> 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<nsIContentPrefService2> 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<nsIURI> 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
|
||||
|
|
|
@ -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<mozIStorageStatement> 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(
|
||||
|
|
|
@ -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 <class Traits>
|
||||
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
|
||||
|
|
|
@ -101,12 +101,10 @@ public:
|
|||
StructuredCloneReadInfo& aCloneReadInfo,
|
||||
JS::MutableHandle<JS::Value> aValue);
|
||||
|
||||
#if !defined(MOZ_B2G)
|
||||
static bool
|
||||
DeserializeUpgradeValue(JSContext* aCx,
|
||||
StructuredCloneReadInfo& aCloneReadInfo,
|
||||
JS::MutableHandle<JS::Value> aValue);
|
||||
#endif
|
||||
|
||||
static const JSClass*
|
||||
DummyPropClass()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<AUDIO_OUTPUT_FORMAT>::value;
|
||||
mAudioClock.Init(aRate);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -50,9 +50,6 @@ uint32_t GetCubebPlaybackLatencyInMilliseconds();
|
|||
Maybe<uint32_t> 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<RefPtr<AudioDeviceInfo>>& aDeviceInfos,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <winsock2.h>
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<webrtc::VoECodec> ptrVoECodec(webrtc::VoECodec::GetInterface(mVoiceEngine));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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',
|
||||
|
|
Загрузка…
Ссылка в новой задаче