Remove MOZ_WIDGET_GONK [1/2]

Tag #288
This commit is contained in:
wolfbeast
2018-05-12 16:19:33 +02:00
parent 2f359ed80c
commit 6571d2ceb4
53 changed files with 60 additions and 750 deletions
-3
View File
@@ -391,9 +391,6 @@ DiskInit.h
dlfcn.h
dlgs.h
dl.h
#ifdef MOZ_WIDGET_GONK
dns_sd.h
#endif
docobj.h
dos/dosextens.h
dos.h
-3
View File
@@ -312,9 +312,6 @@ this.AppsUtils = {
// Instead, we check if the app is installed under /system/b2g
let isCoreApp = false;
#ifdef MOZ_WIDGET_GONK
isCoreApp = app.basePath == this.getCoreAppsBasePath();
#endif
debug(app.basePath + " isCoreApp: " + isCoreApp);
return { "path": app.basePath + "/" + app.id,
-32
View File
@@ -27,11 +27,6 @@
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/SettingChangeNotificationBinding.h"
#ifdef MOZ_WIDGET_GONK
#include "nsJSUtils.h"
#include "SpeakerManagerService.h"
#endif
#include "mozilla/Preferences.h"
using namespace mozilla;
@@ -237,20 +232,12 @@ AudioChannelService::Shutdown()
if (IsParentProcess()) {
obs->RemoveObserver(gAudioChannelService, "ipc:content-shutdown");
#ifdef MOZ_WIDGET_GONK
// To monitor the volume settings based on audio channel.
obs->RemoveObserver(gAudioChannelService, "mozsettings-changed");
#endif
}
}
gAudioChannelService->mWindows.Clear();
gAudioChannelService->mPlayingChildren.Clear();
gAudioChannelService->mTabParents.Clear();
#ifdef MOZ_WIDGET_GONK
gAudioChannelService->mSpeakerManager.Clear();
#endif
gAudioChannelService = nullptr;
}
@@ -284,11 +271,6 @@ AudioChannelService::AudioChannelService()
obs->AddObserver(this, "outer-window-destroyed", false);
if (IsParentProcess()) {
obs->AddObserver(this, "ipc:content-shutdown", false);
#ifdef MOZ_WIDGET_GONK
// To monitor the volume settings based on audio channel.
obs->AddObserver(this, "mozsettings-changed", false);
#endif
}
}
@@ -342,13 +324,6 @@ AudioChannelService::UnregisterAudioChannelAgent(AudioChannelAgent* aAgent)
RefPtr<AudioChannelAgent> kungFuDeathGrip(aAgent);
winData->RemoveAgent(aAgent);
#ifdef MOZ_WIDGET_GONK
bool active = AnyAudioChannelIsActive();
for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) {
mSpeakerManager[i]->SetAudioChannelActive(active);
}
#endif
MaybeSendStatusUpdate();
}
@@ -573,13 +548,6 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic,
iter.GetNext()->WindowVolumeChanged();
}
}
#ifdef MOZ_WIDGET_GONK
bool active = AnyAudioChannelIsActive();
for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) {
mSpeakerManager[i]->SetAudioChannelActive(active);
}
#endif
} else if (!strcmp(aTopic, "ipc:content-shutdown")) {
nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(aSubject);
if (!props) {
-22
View File
@@ -25,10 +25,6 @@ struct PRLogModuleInfo;
namespace mozilla {
namespace dom {
#ifdef MOZ_WIDGET_GONK
class SpeakerManagerService;
#endif
class TabParent;
#define NUMBER_OF_AUDIO_CHANNELS (uint32_t)AudioChannel::EndGuard_
@@ -189,20 +185,6 @@ public:
uint64_t aInnerWindowID,
bool aCapture);
#ifdef MOZ_WIDGET_GONK
void RegisterSpeakerManager(SpeakerManagerService* aSpeakerManager)
{
if (!mSpeakerManager.Contains(aSpeakerManager)) {
mSpeakerManager.AppendElement(aSpeakerManager);
}
}
void UnregisterSpeakerManager(SpeakerManagerService* aSpeakerManager)
{
mSpeakerManager.RemoveElement(aSpeakerManager);
}
#endif
static const nsAttrValue::EnumTable* GetAudioChannelTable();
static AudioChannel GetAudioChannel(const nsAString& aString);
static AudioChannel GetDefaultAudioChannel();
@@ -347,10 +329,6 @@ private:
nsTObserverArray<nsAutoPtr<AudioChannelChildStatus>> mPlayingChildren;
#ifdef MOZ_WIDGET_GONK
nsTArray<SpeakerManagerService*> mSpeakerManager;
#endif
// Raw pointers because TabParents must unregister themselves.
nsTArray<TabParent*> mTabParents;
-6
View File
@@ -767,12 +767,6 @@ StaticRefPtr<VibrateWindowListener> gVibrateWindowListener;
static bool
MayVibrate(nsIDocument* doc) {
#if MOZ_WIDGET_GONK
if (XRE_IsParentProcess()) {
return true; // The system app can always vibrate
}
#endif // MOZ_WIDGET_GONK
// Hidden documents cannot start or stop a vibration.
return (doc && !doc->Hidden());
}
+1 -1
View File
@@ -309,7 +309,7 @@ ScreenOrientation::LockInternal(ScreenOrientationInternal aOrientation, ErrorRes
return nullptr;
}
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK)
#if !defined(MOZ_WIDGET_ANDROID)
// User agent does not support locking the screen orientation.
p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return p.forget();
-3
View File
@@ -5,9 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <map>
#ifdef MOZ_WIDGET_GONK
#include "GonkPermission.h"
#endif // MOZ_WIDGET_GONK
#include "nsCOMPtr.h"
#include "nsIDOMElement.h"
#include "nsIPrincipal.h"
+5 -5
View File
@@ -25,7 +25,7 @@
#include "mozilla/dom/Timeout.h"
#include "mozilla/dom/TimeoutHandler.h"
#include "mozilla/IntegerPrintfMacros.h"
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
#include "mozilla/dom/WindowOrientationObserver.h"
#endif
#include "nsDOMOfflineResourceList.h"
@@ -1948,7 +1948,7 @@ nsGlobalWindow::CleanUp()
mSpeechSynthesis = nullptr;
#endif
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
mOrientationChangeObserver = nullptr;
#endif
@@ -2076,7 +2076,7 @@ nsGlobalWindow::FreeInnerObjects()
mScreen = nullptr;
}
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
mOrientationChangeObserver = nullptr;
#endif
@@ -14009,7 +14009,7 @@ nsGlobalWindow::DisableDeviceSensor(uint32_t aType)
}
}
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
void
nsGlobalWindow::EnableOrientationChangeListener()
{
@@ -14902,7 +14902,7 @@ nsGlobalWindow::IsModalContentWindow(JSContext* aCx, JSObject* aGlobal)
return xpc::WindowOrNull(aGlobal)->IsModalContentWindow();
}
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
int16_t
nsGlobalWindow::Orientation(CallerType aCallerType) const
{
+4 -4
View File
@@ -138,7 +138,7 @@ class U2F;
class VRDisplay;
class VREventObserver;
class WakeLock;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
class WindowOrientationObserver;
#endif
class Worklet;
@@ -631,7 +631,7 @@ public:
virtual void EnableDeviceSensor(uint32_t aType) override;
virtual void DisableDeviceSensor(uint32_t aType) override;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
virtual void EnableOrientationChangeListener() override;
virtual void DisableOrientationChangeListener() override;
#endif
@@ -905,7 +905,7 @@ public:
nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
already_AddRefed<nsIDOMOfflineResourceList> GetApplicationCache() override;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
int16_t Orientation(mozilla::dom::CallerType aCallerType) const;
#endif
@@ -1971,7 +1971,7 @@ protected:
nsTArray<uint32_t> mEnabledSensors;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
nsAutoPtr<mozilla::dom::WindowOrientationObserver> mOrientationChangeObserver;
#endif
+1 -1
View File
@@ -444,7 +444,7 @@ public:
*/
virtual void DisableDeviceSensor(uint32_t aType) = 0;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
virtual void EnableOrientationChangeListener() = 0;
virtual void DisableOrientationChangeListener() = 0;
#endif
-4
View File
@@ -141,10 +141,6 @@ using mozilla::gl::GLContextProvider;
#include "gfxWindowsPlatform.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
// windows.h (included by chromium code) defines this, in its infinite wisdom
#undef DrawText
-28
View File
@@ -51,10 +51,6 @@
#include "VRManagerChild.h"
#include "mozilla/layers/TextureClientSharedSurface.h"
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
// Local
#include "CanvasUtils.h"
#include "WebGL1Context.h"
@@ -545,30 +541,6 @@ BaseCaps(const WebGLContextOptions& options, WebGLContext* webgl)
// for now it's just behind a pref for testing/evaluation.
baseCaps.bpp16 = gfxPrefs::WebGLPrefer16bpp();
#ifdef MOZ_WIDGET_GONK
do {
auto canvasElement = webgl->GetCanvas();
if (!canvasElement)
break;
auto ownerDoc = canvasElement->OwnerDoc();
nsIWidget* docWidget = nsContentUtils::WidgetForDocument(ownerDoc);
if (!docWidget)
break;
layers::LayerManager* layerManager = docWidget->GetLayerManager();
if (!layerManager)
break;
// XXX we really want "AsSurfaceAllocator" here for generality
layers::ShadowLayerForwarder* forwarder = layerManager->AsShadowForwarder();
if (!forwarder)
break;
baseCaps.surfaceAllocator = forwarder->GetTextureForwarder();
} while (false);
#endif
// Done with baseCaps construction.
if (!gfxPrefs::WebGLForceMSAA()) {
+4 -4
View File
@@ -352,7 +352,7 @@ EventListenerManager::AddEventListenerInternal(
EnableDevice(eDeviceLight);
} else if (aTypeAtom == nsGkAtoms::ondevicemotion) {
EnableDevice(eDeviceMotion);
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
} else if (aTypeAtom == nsGkAtoms::onorientationchange) {
EnableDevice(eOrientationChange);
#endif
@@ -481,7 +481,7 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage)
case eDeviceLight:
case eDeviceProximity:
case eUserProximity:
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange:
#endif
return true;
@@ -529,7 +529,7 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage)
window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION);
window->EnableDeviceSensor(SENSOR_GYROSCOPE);
break;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange:
window->EnableOrientationChangeListener();
break;
@@ -575,7 +575,7 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage)
case eDeviceLight:
window->DisableDeviceSensor(SENSOR_LIGHT);
break;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange:
window->DisableOrientationChangeListener();
break;
+1 -1
View File
@@ -563,7 +563,7 @@ WINDOW_EVENT(online,
eOnline,
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
eBasicEventClass)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
WINDOW_EVENT(orientationchange,
eOrientationChange,
EventNameType_HTMLBodyOrFramesetOnly,
-13
View File
@@ -33,10 +33,6 @@ class nsIPrincipal;
#include "AndroidLocationProvider.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "GonkGPSGeolocationProvider.h"
#endif
#ifdef MOZ_GPSD
#include "GpsdLocationProvider.h"
#endif
@@ -688,15 +684,6 @@ nsresult nsGeolocationService::Init()
mProvider = new AndroidLocationProvider();
#endif
#ifdef MOZ_WIDGET_GONK
// GonkGPSGeolocationProvider can be started at boot up time for initialization reasons.
// do_getService gets hold of the already initialized component and starts
// processing location requests immediately.
// do_Createinstance will create multiple instances of the provider which is not right.
// bug 993041
mProvider = do_GetService(GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID);
#endif
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_GPSD
if (Preferences::GetBool("geo.provider.use_gpsd", false)) {
+2 -2
View File
@@ -267,8 +267,8 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
aType == NS_FORM_INPUT_TEL ||
aType == NS_FORM_INPUT_URL ||
// TODO: those are temporary until bug 773205 is fixed.
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
// On Android/B2G, date/time input appears as a normal text box.
#if defined(MOZ_WIDGET_ANDROID)
// On Android, date/time input appears as a normal text box.
aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_DATE ||
#endif
+1 -1
View File
@@ -121,7 +121,7 @@
LogLevel::Debug, \
_args )
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
#define IDB_MOBILE
#endif
+1 -51
View File
@@ -137,12 +137,6 @@
#include "APKOpen.h"
#endif
#if defined(MOZ_WIDGET_GONK)
#include "nsVolume.h"
#include "nsVolumeService.h"
#include "SpeakerManagerService.h"
#endif
#ifdef XP_WIN
#include <process.h>
#define getpid _getpid
@@ -196,9 +190,6 @@ using namespace mozilla::net;
using namespace mozilla::jsipc;
using namespace mozilla::psm;
using namespace mozilla::widget;
#if defined(MOZ_WIDGET_GONK)
using namespace mozilla::system;
#endif
using namespace mozilla::widget;
namespace mozilla {
@@ -585,15 +576,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
void
ContentChild::InitProcessAttributes()
{
#ifdef MOZ_WIDGET_GONK
if (mIsForApp && !mIsForBrowser) {
SetProcessName(NS_LITERAL_STRING("(Preallocated app)"), false);
} else {
SetProcessName(NS_LITERAL_STRING("Browser"), false);
}
#else
SetProcessName(NS_LITERAL_STRING("Web Content"), true);
#endif
}
void
@@ -1257,15 +1240,6 @@ ContentChild::RecvNotifyLayerAllocated(const dom::TabId& aTabId, const uint64_t&
bool
ContentChild::RecvSpeakerManagerNotify()
{
#ifdef MOZ_WIDGET_GONK
// Only notify the process which has the SpeakerManager instance.
RefPtr<SpeakerManagerService> service =
SpeakerManagerService::GetSpeakerManagerService();
if (service) {
service->Notify();
}
return true;
#endif
return false;
}
@@ -2284,12 +2258,6 @@ ContentChild::RecvLastPrivateDocShellDestroyed()
bool
ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes)
{
#ifdef MOZ_WIDGET_GONK
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
if (vs) {
vs->RecvVolumesFromParent(aVolumes);
}
#endif
return true;
}
@@ -2306,17 +2274,6 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
const bool& aIsRemovable,
const bool& aIsHotSwappable)
{
#ifdef MOZ_WIDGET_GONK
RefPtr<nsVolume> volume = new nsVolume(aFsName, aVolumeName, aState,
aMountGeneration, aIsMediaPresent,
aIsSharing, aIsFormatting, aIsFake,
aIsUnmounting, aIsRemovable, aIsHotSwappable);
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
if (vs) {
vs->UpdateVolume(volume);
}
#else
// Remove warnings about unused arguments
Unused << aFsName;
Unused << aVolumeName;
@@ -2329,22 +2286,15 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
Unused << aIsUnmounting;
Unused << aIsRemovable;
Unused << aIsHotSwappable;
#endif
return true;
}
bool
ContentChild::RecvVolumeRemoved(const nsString& aFsName)
{
#ifdef MOZ_WIDGET_GONK
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
if (vs) {
vs->RemoveVolumeByName(aFsName);
}
#else
// Remove warnings about unused arguments
Unused << aFsName;
#endif
return true;
}
+3 -134
View File
@@ -16,11 +16,6 @@
# include <sys/resource.h>
#endif
#ifdef MOZ_WIDGET_GONK
#include <sys/types.h>
#include <sys/wait.h>
#endif
#include "chrome/common/process_watcher.h"
#include "mozilla/a11y/PDocAccessible.h"
@@ -210,14 +205,6 @@
# include "AndroidBridge.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "nsIVolume.h"
#include "nsVolumeService.h"
#include "nsIVolumeService.h"
#include "SpeakerManagerService.h"
using namespace mozilla::system;
#endif
#ifdef MOZ_WIDGET_GTK
#include <gdk/gdk.h>
#endif
@@ -526,11 +513,6 @@ static const char* sObserverTopics[] = {
"child-mmu-request",
"last-pb-context-exited",
"file-watcher-update",
#ifdef MOZ_WIDGET_GONK
NS_VOLUME_STATE_CHANGED,
NS_VOLUME_REMOVED,
"phone-state-changed",
#endif
#ifdef ACCESSIBILITY
"a11y-init-or-shutdown",
#endif
@@ -1355,14 +1337,6 @@ ContentParent::ForwardKnownInfo()
if (!mMetamorphosed) {
return;
}
#ifdef MOZ_WIDGET_GONK
InfallibleTArray<VolumeInfo> volumeInfo;
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
if (vs) {
vs->GetVolumesForIPC(&volumeInfo);
Unused << SendVolumes(volumeInfo);
}
#endif /* MOZ_WIDGET_GONK */
}
namespace {
@@ -1410,23 +1384,6 @@ bool
ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority)
{
ProcessPriorityManager::SetProcessPriority(this, aPriority);
// Now that we've set this process's priority, check whether the process is
// still alive. Hopefully we've set the priority to FOREGROUND*, so the
// process won't unexpectedly crash after this point!
//
// Bug 943174: use waitid() with WNOWAIT so that, if the process
// did exit, we won't consume its zombie and confuse the
// GeckoChildProcessHost dtor.
#ifdef MOZ_WIDGET_GONK
siginfo_t info;
info.si_pid = 0;
if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
&& info.si_pid != 0) {
return false;
}
#endif
return true;
}
@@ -2686,50 +2643,6 @@ ContentParent::Observe(nsISupports* aSubject,
else if (!strcmp(aTopic, "last-pb-context-exited")) {
Unused << SendLastPrivateDocShellDestroyed();
}
#ifdef MOZ_WIDGET_GONK
else if(!strcmp(aTopic, NS_VOLUME_STATE_CHANGED)) {
nsCOMPtr<nsIVolume> vol = do_QueryInterface(aSubject);
if (!vol) {
return NS_ERROR_NOT_AVAILABLE;
}
nsString volName;
nsString mountPoint;
int32_t state;
int32_t mountGeneration;
bool isMediaPresent;
bool isSharing;
bool isFormatting;
bool isFake;
bool isUnmounting;
bool isRemovable;
bool isHotSwappable;
vol->GetName(volName);
vol->GetMountPoint(mountPoint);
vol->GetState(&state);
vol->GetMountGeneration(&mountGeneration);
vol->GetIsMediaPresent(&isMediaPresent);
vol->GetIsSharing(&isSharing);
vol->GetIsFormatting(&isFormatting);
vol->GetIsFake(&isFake);
vol->GetIsUnmounting(&isUnmounting);
vol->GetIsRemovable(&isRemovable);
vol->GetIsHotSwappable(&isHotSwappable);
Unused << SendFileSystemUpdate(volName, mountPoint, state,
mountGeneration, isMediaPresent,
isSharing, isFormatting, isFake,
isUnmounting, isRemovable, isHotSwappable);
} else if (!strcmp(aTopic, "phone-state-changed")) {
nsString state(aData);
Unused << SendNotifyPhoneStateChange(state);
}
else if(!strcmp(aTopic, NS_VOLUME_REMOVED)) {
nsString volName(aData);
Unused << SendVolumeRemoved(volName);
}
#endif
#ifdef ACCESSIBILITY
else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) {
if (*aData == '1') {
@@ -3398,29 +3311,12 @@ ContentParent::RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor)
bool
ContentParent::RecvSpeakerManagerGetSpeakerStatus(bool* aValue)
{
#ifdef MOZ_WIDGET_GONK
*aValue = false;
RefPtr<SpeakerManagerService> service =
SpeakerManagerService::GetOrCreateSpeakerManagerService();
MOZ_ASSERT(service);
*aValue = service->GetSpeakerStatus();
return true;
#endif
return false;
}
bool
ContentParent::RecvSpeakerManagerForceSpeaker(const bool& aEnable)
{
#ifdef MOZ_WIDGET_GONK
RefPtr<SpeakerManagerService> service =
SpeakerManagerService::GetOrCreateSpeakerManagerService();
MOZ_ASSERT(service);
service->ForceSpeaker(aEnable, mChildID);
return true;
#endif
return false;
}
@@ -3976,49 +3872,22 @@ bool
ContentParent::RecvCreateFakeVolume(const nsString& fsName,
const nsString& mountPoint)
{
#ifdef MOZ_WIDGET_GONK
nsresult rv;
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
if (vs) {
vs->CreateFakeVolume(fsName, mountPoint);
}
return true;
#else
NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined");
NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called");
return false;
#endif
}
bool
ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState)
{
#ifdef MOZ_WIDGET_GONK
nsresult rv;
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
if (vs) {
vs->SetFakeVolumeState(fsName, fsState);
}
return true;
#else
NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called when MOZ_WIDGET_GONK is not defined");
NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called");
return false;
#endif
}
bool
ContentParent::RecvRemoveFakeVolume(const nsString& fsName)
{
#ifdef MOZ_WIDGET_GONK
nsresult rv;
nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
if (vs) {
vs->RemoveFakeVolume(fsName);
}
return true;
#else
NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined");
NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called");
return false;
#endif
}
bool
+1 -71
View File
@@ -33,11 +33,6 @@
#include "nsStringStream.h"
#include "secerr.h"
#include "sslerr.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkStatsServiceProxy.h"
#include "nsINetworkManager.h"
#include "nsINetworkInterface.h"
#endif
#define BUFFER_SIZE 65536
#define NETWORK_STATS_THRESHOLD 65536
@@ -163,12 +158,6 @@ TCPSocket::TCPSocket(nsIGlobalObject* aGlobal, const nsAString& aHost, uint16_t
, mTrackingNumber(0)
, mWaitingForStartTLS(false)
, mObserversActive(false)
#ifdef MOZ_WIDGET_GONK
, mTxBytes(0)
, mRxBytes(0)
, mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID)
, mInIsolatedMozBrowser(false)
#endif
{
if (aGlobal) {
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
@@ -323,13 +312,6 @@ TCPSocket::InitWithTransport(nsISocketTransport* aTransport)
mTransport->GetPort(&port);
mPort = port;
#ifdef MOZ_WIDGET_GONK
nsCOMPtr<nsINetworkManager> networkManager = do_GetService("@mozilla.org/network/manager;1");
if (networkManager) {
networkManager->GetActiveNetworkInfo(getter_AddRefs(mActiveNetworkInfo));
}
#endif
return NS_OK;
}
@@ -651,12 +633,6 @@ TCPSocket::Resume(mozilla::ErrorResult& aRv)
nsresult
TCPSocket::MaybeReportErrorAndCloseIfOpen(nsresult status) {
#ifdef MOZ_WIDGET_GONK
// Save network statistics once the connection is closed.
// For now this function is Gonk-specific.
SaveNetworkStats(true);
#endif
// If we're closed, we've already reported the error or just don't need to
// report the error.
if (mReadyState == TCPReadyState::Closed) {
@@ -941,12 +917,6 @@ TCPSocket::Send(nsIInputStream* aStream, uint32_t aByteLength)
EnsureCopying();
#ifdef MOZ_WIDGET_GONK
// Collect transmitted amount for network statistics.
mTxBytes += aByteLength;
SaveNetworkStats(false);
#endif
return !bufferFull;
}
@@ -1069,12 +1039,6 @@ NS_IMETHODIMP
TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream,
uint64_t aOffset, uint32_t aCount)
{
#ifdef MOZ_WIDGET_GONK
// Collect received amount for network statistics.
mRxBytes += aCount;
SaveNetworkStats(false);
#endif
if (mUseArrayBuffers) {
nsTArray<uint8_t> buffer;
buffer.SetCapacity(aCount);
@@ -1160,10 +1124,7 @@ TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent)
void
TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser)
{
#ifdef MOZ_WIDGET_GONK
mAppId = aAppId;
mInIsolatedMozBrowser = aInIsolatedMozBrowser;
#endif
/*** STUB ***/
}
NS_IMETHODIMP
@@ -1190,37 +1151,6 @@ TCPSocket::UpdateBufferedAmount(uint32_t aBufferedAmount, uint32_t aTrackingNumb
return NS_OK;
}
#ifdef MOZ_WIDGET_GONK
void
TCPSocket::SaveNetworkStats(bool aEnforce)
{
if (!mTxBytes && !mRxBytes) {
// There is no traffic at all. No need to save statistics.
return;
}
// If "enforce" is false, the traffic amount is saved to NetworkStatsServiceProxy
// only when the total amount exceeds the predefined threshold value.
// The purpose is to avoid too much overhead for collecting statistics.
uint32_t totalBytes = mTxBytes + mRxBytes;
if (!aEnforce && totalBytes < NETWORK_STATS_THRESHOLD) {
return;
}
nsCOMPtr<nsINetworkStatsServiceProxy> nssProxy =
do_GetService("@mozilla.org/networkstatsServiceProxy;1");
if (!nssProxy) {
return;
}
nssProxy->SaveAppStats(mAppId, mInIsolatedMozBrowser, mActiveNetworkInfo,
PR_Now(), mRxBytes, mTxBytes, false, nullptr);
// Reset the counters once the statistics is saved to NetworkStatsServiceProxy.
mTxBytes = mRxBytes = 0;
}
#endif
NS_IMETHODIMP
TCPSocket::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
-17
View File
@@ -179,10 +179,6 @@ private:
void ActivateTLS();
// Dispatch an error event if necessary, then dispatch a "close" event.
nsresult MaybeReportErrorAndCloseIfOpen(nsresult status);
#ifdef MOZ_WIDGET_GONK
// Store and reset any saved network stats for this socket.
void SaveNetworkStats(bool aEnforce);
#endif
// Helper for FireDataStringEvent/FireDataArrayEvent.
nsresult FireDataEvent(JSContext* aCx, const nsAString& aType,
@@ -246,19 +242,6 @@ private:
nsTArray<nsCOMPtr<nsIInputStream>> mPendingDataWhileCopierActive;
bool mObserversActive;
#ifdef MOZ_WIDGET_GONK
// Number of bytes sent.
uint32_t mTxBytes;
// Number of bytes received.
uint32_t mRxBytes;
// The app that owns this socket.
uint32_t mAppId;
// Was this socket created inside of an isolated browser frame?
bool mInIsolatedMozBrowser;
// The name of the active network used by this socket.
nsCOMPtr<nsINetworkInfo> mActiveNetworkInfo;
#endif
};
} // namespace dom
-6
View File
@@ -57,12 +57,6 @@ PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
mNPP_GetSitesWithData = pFuncs->getsiteswithdata;
return NS_OK;
}
#elif defined(MOZ_WIDGET_GONK)
nsresult
PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
{
return NS_OK;
}
#elif defined(XP_UNIX) && !defined(XP_MACOSX)
nsresult
PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
+1 -1
View File
@@ -81,7 +81,7 @@ public:
return true;
}
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
virtual nsresult NP_Initialize(NPNetscapeFuncs* aNetscapeFuncs,
NPPluginFuncs* aFuncs, NPError* aError) override;
#else
-1
View File
@@ -320,7 +320,6 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult)
if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) {
return NS_ERROR_FAILURE;
}
#elif defined(MOZ_WIDGET_GONK)
#else
NPError pluginCallError;
nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &plugin->mPluginFuncs, &pluginCallError);
+1 -1
View File
@@ -57,7 +57,7 @@ public:
virtual bool HasRequiredFunctions() = 0;
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0;
#else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0;
+2 -2
View File
@@ -529,7 +529,7 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
if (NS_SUCCEEDED(mAsyncInitRv))
#endif
{
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
mAsyncInitRv = NP_Initialize(mNPNIface,
mNPPIface,
&mAsyncInitError);
@@ -1745,7 +1745,7 @@ PluginModuleChromeParent::CachedSettingChanged(const char* aPref, void* aModule)
module->CachedSettingChanged();
}
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
nsresult
PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error)
{
+2 -2
View File
@@ -267,7 +267,7 @@ protected:
const mozilla::NativeEventData& aNativeKeyData,
bool aIsConsumed) override;
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override;
#else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override;
@@ -517,7 +517,7 @@ private:
PluginProcessParent* Process() const { return mSubprocess; }
base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); }
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
#if defined(XP_UNIX) && !defined(XP_MACOSX)
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override;
#else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override;
+1 -48
View File
@@ -31,11 +31,6 @@
#include "nsIPresentationNetworkHelper.h"
#endif // MOZ_WIDGET_ANDROID
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkInterface.h"
#include "nsINetworkManager.h"
#endif
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::services;
@@ -647,49 +642,7 @@ PresentationControllingInfo::Shutdown(nsresult aReason)
nsresult
PresentationControllingInfo::GetAddress()
{
#if defined(MOZ_WIDGET_GONK)
nsCOMPtr<nsINetworkManager> networkManager =
do_GetService("@mozilla.org/network/manager;1");
if (NS_WARN_IF(!networkManager)) {
return NS_ERROR_NOT_AVAILABLE;
}
nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
networkManager->GetActiveNetworkInfo(getter_AddRefs(activeNetworkInfo));
if (NS_WARN_IF(!activeNetworkInfo)) {
return NS_ERROR_FAILURE;
}
char16_t** ips = nullptr;
uint32_t* prefixes = nullptr;
uint32_t count = 0;
activeNetworkInfo->GetAddresses(&ips, &prefixes, &count);
if (NS_WARN_IF(!count)) {
NS_Free(prefixes);
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips);
return NS_ERROR_FAILURE;
}
// TODO bug 1228504 Take all IP addresses in PresentationChannelDescription
// into account. And at the first stage Presentation API is only exposed on
// Firefox OS where the first IP appears enough for most scenarios.
nsAutoString ip;
ip.Assign(ips[0]);
// On Android platform, the IP address is retrieved from a callback function.
// To make consistent code sequence, following function call is dispatched
// into main thread instead of calling it directly.
NS_DispatchToMainThread(
NewRunnableMethod<nsCString>(
this,
&PresentationControllingInfo::OnGetAddress,
NS_ConvertUTF16toUTF8(ip)));
NS_Free(prefixes);
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(count, ips);
#elif defined(MOZ_WIDGET_ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
RefPtr<PresentationNetworkHelper> networkHelper =
new PresentationNetworkHelper(this,
&PresentationControllingInfo::OnGetAddress);
@@ -68,12 +68,9 @@ static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContrac
};
static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = {
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16)
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID)
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID },
#endif
#if defined(MOZ_WIDGET_GONK)
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "DisplayDeviceProvider", DISPLAY_DEVICE_PROVIDER_CONTRACT_ID },
#endif
#ifdef MOZ_WIDGET_ANDROID
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID },
#endif //MOZ_WIDGET_ANDROID
-11
View File
@@ -924,16 +924,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
return false;
}
#if defined(MOZ_WIDGET_GONK)
JSString* strVersion = JS_NewStringCopyZ(cx, "Gonk");
if (!strVersion){
return false;
}
JS::Rooted<JS::Value> valVersion(cx, JS::StringValue(strVersion));
if (!JS_SetProperty(cx, objSys, "Name", valVersion)) {
return false;
}
#else
nsCOMPtr<nsIXULRuntime> runtime = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
if (runtime) {
nsAutoCString os;
@@ -950,7 +940,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
return false;
}
}
#endif // defined(MOZ_WIDGET_GONK)
#if defined(DEBUG)
JS::Rooted<JS::Value> valDebug(cx, JS::TrueValue());
+1 -1
View File
@@ -379,7 +379,7 @@ Window implements TouchEventHandlers;
Window implements OnErrorEventHandlerForWindow;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
// https://compat.spec.whatwg.org/#windoworientation-interface
partial interface Window {
[NeedsCallerType]
-6
View File
@@ -89,8 +89,6 @@ AssertMainProcess()
MOZ_ASSERT(GeckoProcessType_Default == XRE_GetProcessType());
}
#if !defined(MOZ_WIDGET_GONK)
bool
WindowIsActive(nsPIDOMWindowInner* aWindow)
{
@@ -100,8 +98,6 @@ WindowIsActive(nsPIDOMWindowInner* aWindow)
return !document->Hidden();
}
#endif // !defined(MOZ_WIDGET_GONK)
StaticAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate;
void InitLastIDToVibrate()
@@ -123,7 +119,6 @@ Vibrate(const nsTArray<uint32_t>& pattern, const WindowIdentifier &id)
{
AssertMainThread();
#if !defined(MOZ_WIDGET_GONK)
// Only active windows may start vibrations. If |id| hasn't gone
// through the IPC layer -- that is, if our caller is the outside
// world, not hal_proxy -- check whether the window is active. If
@@ -134,7 +129,6 @@ Vibrate(const nsTArray<uint32_t>& pattern, const WindowIdentifier &id)
HAL_LOG("Vibrate: Window is inactive, dropping vibrate.");
return;
}
#endif // !defined(MOZ_WIDGET_GONK)
if (!InSandbox()) {
if (!gLastIDToVibrate) {
-31
View File
@@ -12,28 +12,9 @@
#include "mozilla/Services.h"
#include "MainThreadUtils.h"
#if defined(MOZ_WIDGET_GONK)
#include "cutils/android_reboot.h"
#include "cutils/properties.h"
#endif
namespace mozilla {
namespace hal_impl {
#if (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 19)
static void
PowerCtl(const char* aValue, int aCmd)
{
// this invokes init's powerctl builtin via /init.rc
property_set("sys.powerctl", aValue);
// device should reboot in few moments, but if it doesn't - call
// android_reboot() to make sure that init isn't stuck somewhere
sleep(10);
HAL_LOG("Powerctl call takes too long, forcing %s.", aValue);
android_reboot(aCmd, 0, nullptr);
}
#endif
void
Reboot()
{
@@ -44,14 +25,8 @@ Reboot()
}
}
#if !defined(MOZ_WIDGET_GONK)
sync();
reboot(RB_AUTOBOOT);
#elif (ANDROID_VERSION < 19)
android_reboot(ANDROID_RB_RESTART, 0, nullptr);
#else
PowerCtl("reboot", ANDROID_RB_RESTART);
#endif
}
void
@@ -64,14 +39,8 @@ PowerOff()
}
}
#if !defined(MOZ_WIDGET_GONK)
sync();
reboot(RB_POWER_OFF);
#elif (ANDROID_VERSION < 19)
android_reboot(ANDROID_RB_POWEROFF, 0, nullptr);
#else
PowerCtl("shutdown", ANDROID_RB_POWEROFF);
#endif
}
// Structure to specify how watchdog pthread is going to work.
+1 -1
View File
@@ -3658,7 +3658,7 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
nsCSSAnonBoxes::buttonContent) },
// TODO: this is temporary until a frame is written: bug 635240.
SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame),
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(MOZ_WIDGET_ANDROID)
// On Android/B2G, date/time input appears as a normal text box.
SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewTextControlFrame),
SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame),
-85
View File
@@ -100,20 +100,6 @@
#include "mozilla/dom/nsSynthVoiceRegistry.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include "SystemWorkerManager.h"
using mozilla::dom::gonk::SystemWorkerManager;
#define SYSTEMWORKERMANAGER_CID \
{0xd53b6524, 0x6ac3, 0x42b0, {0xae, 0xca, 0x62, 0xb3, 0xc4, 0xe5, 0x2b, 0x04}}
#endif
#ifdef MOZ_WIDGET_GONK
#include "AudioManager.h"
using mozilla::dom::gonk::AudioManager;
#include "nsVolumeService.h"
using mozilla::system::nsVolumeService;
#endif
#include "mozilla/dom/PushNotifier.h"
using mozilla::dom::PushNotifier;
#define PUSHNOTIFIER_CID \
@@ -135,11 +121,9 @@ using mozilla::dom::AudioChannelAgent;
#include "nsSystemPrincipal.h"
#include "nsNullPrincipal.h"
#include "nsNetCID.h"
#ifndef MOZ_WIDGET_GONK
#if defined(MOZ_WIDGET_ANDROID)
#include "nsHapticFeedback.h"
#endif
#endif
#include "nsParserUtils.h"
#include "nsHTMLCanvasFrame.h"
@@ -201,9 +185,6 @@ static void Shutdown();
#include "nsIPresentationService.h"
#ifdef MOZ_WIDGET_GONK
#include "GonkGPSGeolocationProvider.h"
#endif
#include "MediaManager.h"
#include "GMPService.h"
@@ -284,30 +265,18 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WorkerDebuggerManager,
WorkerDebuggerManager::GetInstance)
#ifdef MOZ_WIDGET_GONK
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager,
SystemWorkerManager::FactoryCreate)
#endif
#ifdef MOZ_WEBSPEECH
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry,
nsSynthVoiceRegistry::GetInstanceForService)
#endif
#ifdef MOZ_WIDGET_GONK
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioManager,
AudioManager::GetInstance)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
#endif
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
PowerManagerService::GetInstance)
@@ -316,16 +285,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITimeService,
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService,
StreamingProtocolControllerService::GetInstance)
#ifdef MOZ_WIDGET_GONK
#ifndef DISABLE_MOZ_RIL_GEOLOC
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIGeolocationProvider,
GonkGPSGeolocationProvider::GetSingleton)
#endif
// Since the nsVolumeService constructor calls into nsIPowerManagerService,
// we need it to be constructed sometime after nsIPowerManagerService.
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService,
nsVolumeService::GetSingleton)
#endif
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
MediaManager::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager)
@@ -702,13 +661,6 @@ NS_DEFINE_NAMED_CID(NOTIFICATIONTELEMETRYSERVICE_CID);
NS_DEFINE_NAMED_CID(PUSHNOTIFIER_CID);
NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID);
#ifdef MOZ_WIDGET_GONK
NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID);
#endif
#ifdef MOZ_WIDGET_GONK
NS_DEFINE_NAMED_CID(NS_AUDIOMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_VOLUMESERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_AUDIOCHANNELAGENT_CID);
@@ -740,16 +692,9 @@ NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID);
NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID);
NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID)
NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
#endif
#endif
#ifndef DISABLE_MOZ_RIL_GEOLOC
#ifdef MOZ_WIDGET_GONK
NS_DEFINE_NAMED_CID(GONK_GPS_GEOLOCATION_PROVIDER_CID);
#endif
#endif
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID);
NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID);
@@ -983,13 +928,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },
{ &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor },
{ &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor },
#ifdef MOZ_WIDGET_GONK
{ &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor },
#endif
#ifdef MOZ_WIDGET_GONK
{ &kNS_AUDIOMANAGER_CID, true, nullptr, AudioManagerConstructor },
{ &kNS_VOLUMESERVICE_CID, true, nullptr, nsVolumeServiceConstructor },
#endif
{ &kNS_AUDIOCHANNELAGENT_CID, true, nullptr, AudioChannelAgentConstructor },
{ &kNS_HTMLEDITOR_CID, false, nullptr, HTMLEditorConstructor },
{ &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor },
@@ -1025,10 +963,8 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor },
{ &kNS_NULLPRINCIPAL_CID, false, nullptr, nsNullPrincipalConstructor },
{ &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor },
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID)
{ &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor },
#endif
#endif
{ &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor },
{ &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor },
@@ -1038,9 +974,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor },
{ &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor },
{ &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor },
#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC)
{ &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor },
#endif
{ &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
#ifdef ACCESSIBILITY
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
@@ -1127,13 +1060,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID },
{ PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID },
{ WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID },
#ifdef MOZ_WIDGET_GONK
{ SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID },
#endif
#ifdef MOZ_WIDGET_GONK
{ NS_AUDIOMANAGER_CONTRACTID, &kNS_AUDIOMANAGER_CID },
{ NS_VOLUMESERVICE_CONTRACTID, &kNS_VOLUMESERVICE_CID },
#endif
{ NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID },
{ "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID },
{ "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID },
@@ -1168,10 +1094,8 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID },
{ NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID },
{ NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID },
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID)
{ "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID },
#endif
#endif
{ THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
{ NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
@@ -1180,9 +1104,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID },
{ TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID },
{ MEDIASTREAMCONTROLLERSERVICE_CONTRACTID, &kNS_MEDIASTREAMCONTROLLERSERVICE_CID },
#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC)
{ GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID },
#endif
{ MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
#ifdef ACCESSIBILITY
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
@@ -1208,13 +1129,7 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
{ "app-startup", "Push Notifier", "service," PUSHNOTIFIER_CONTRACTID },
{ "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID },
{ OBSERVER_TOPIC_IDLE_DAILY, "QuotaManagerService", QUOTAMANAGER_SERVICE_CONTRACTID },
#ifdef MOZ_WIDGET_GONK
{ "app-startup", "Volume Service", "service," NS_VOLUMESERVICE_CONTRACTID },
#endif
CONTENTDLF_CATEGORIES
#ifdef MOZ_WIDGET_GONK
{ "profile-after-change", "Gonk System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID },
#endif
{ "profile-after-change", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID },
{ "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID },
{ "profile-after-change", "Notification Telemetry Service", NOTIFICATIONTELEMETRYSERVICE_CONTRACTID },
-9
View File
@@ -100,11 +100,6 @@
#include "Latency.h"
#include "WebAudioUtils.h"
#ifdef MOZ_WIDGET_GONK
#include "nsVolumeService.h"
using namespace mozilla::system;
#endif
#include "nsError.h"
#include "nsJSEnvironment.h"
@@ -395,10 +390,6 @@ nsLayoutStatics::Shutdown()
AsyncLatencyLogger::ShutdownLogger();
WebAudioUtils::Shutdown();
#ifdef MOZ_WIDGET_GONK
nsVolumeService::Shutdown();
#endif
#ifdef MOZ_WEBSPEECH
nsSynthVoiceRegistry::Shutdown();
#endif
@@ -19,12 +19,6 @@ nsresult
nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window, const char* url,
nsISupports* params, bool modal)
{
#ifdef MOZ_WIDGET_GONK
// On b2g devices, we need to proxy the dialog creation & management
// to Gaia.
return NS_ERROR_NOT_IMPLEMENTED;
#endif
nsresult rv;
nsCOMPtr<nsIWindowWatcher> windowWatcher =
do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
+4 -4
View File
@@ -44,7 +44,7 @@
#include "mozilla/ProfileGatherer.h"
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
#include "FennecJNIWrappers.h"
#endif
@@ -213,7 +213,7 @@ GeckoSampler::GeckoSampler(double aInterval, int aEntrySize,
}
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
mProfileJava = mozilla::jni::IsFennec() &&
hasFeature(aFeatures, aFeatureCount, "java");
#else
@@ -462,7 +462,7 @@ void SubProcessCallback(const char* aProfile, void* aClosure)
}
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
static
void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter)
{
@@ -567,7 +567,7 @@ void GeckoSampler::StreamJSON(SpliceableJSONWriter& aWriter, double aSinceTime)
}
}
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
if (ProfileJava()) {
java::GeckoJavaSampler::Pause();
+6 -15
View File
@@ -36,11 +36,11 @@
#include "GeckoTaskTracer.h"
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
#include "FennecJNIWrappers.h"
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
#include "FennecJNINatives.h"
#endif
@@ -52,7 +52,7 @@
#endif
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler>
{
private:
@@ -502,7 +502,7 @@ void mozilla_sampler_init(void* stackTop)
set_stderr_callback(mozilla_sampler_log);
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
if (mozilla::jni::IsFennec()) {
GeckoJavaSampler::Init();
}
@@ -524,7 +524,7 @@ void mozilla_sampler_init(void* stackTop)
|| defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux)
, "stackwalk"
#endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
, "java"
#endif
};
@@ -819,7 +819,7 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
}
}
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
if (t->ProfileJava()) {
int javaInterval = aInterval;
// Java sampling doesn't accuratly keep up with 1ms sampling
@@ -1021,15 +1021,6 @@ bool mozilla_sampler_register_thread(const char* aName, void* aGuessStackTop)
return false;
}
#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_PROFILING)
// The only way to profile secondary threads on b2g
// is to build with profiling OR have the profiler
// running on startup.
if (!profiler_is_active()) {
return false;
}
#endif
MOZ_ASSERT(tlsPseudoStack.get() == nullptr);
PseudoStack* stack = PseudoStack::create();
tlsPseudoStack.set(stack);
+1 -4
View File
@@ -393,10 +393,7 @@ class Sampler {
static mozilla::UniquePtr<Mutex> sRegisteredThreadsMutex;
static bool CanNotifyObservers() {
#ifdef MOZ_WIDGET_GONK
// We use profile.sh on b2g to manually select threads and options per process.
return false;
#elif defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
// Android ANR reporter uses the profiler off the main thread
return NS_IsMainThread();
#else
+2 -16
View File
@@ -37,7 +37,6 @@ static std::string getId(const char *bin_name)
return "";
}
#if !defined(MOZ_WIDGET_GONK)
// TODO fix me with proper include
#include "nsDebug.h"
#ifdef ANDROID
@@ -86,13 +85,10 @@ dl_iterate_callback(struct dl_phdr_info *dl_info, size_t size, void *data)
return 0;
}
#endif // !MOZ_WIDGET_GONK
SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
{
SharedLibraryInfo info;
#if !defined(MOZ_WIDGET_GONK)
#ifdef ANDROID
if (!dl_iterate_phdr) {
// On ARM Android, dl_iterate_phdr is provided by the custom linker.
@@ -104,9 +100,8 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
#endif // ANDROID
dl_iterate_phdr(dl_iterate_callback, &info);
#endif // !MOZ_WIDGET_GONK
#if defined(ANDROID) || defined(MOZ_WIDGET_GONK)
#if defined(ANDROID)
pid_t pid = getpid();
char path[PATH_MAX];
snprintf(path, PATH_MAX, "/proc/%d/maps", pid);
@@ -132,19 +127,10 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
LOG("Get maps line failed");
continue;
}
#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
// Use proc/pid/maps to get the dalvik-jit section since it has
// no associated phdrs
if (strcmp(name, "/dev/ashmem/dalvik-jit-code-cache") != 0)
continue;
#else
if (strcmp(perm, "r-xp") != 0) {
// Ignore entries that are writable and/or shared.
// At least one graphics driver uses short-lived "rwxs" mappings
// (see bug 926734 comment 5), so just checking for 'x' isn't enough.
continue;
}
#endif
SharedLibrary shlib(start, end, offset, getId(name), name);
info.AddSharedLibrary(shlib);
if (count > 10000) {
@@ -153,7 +139,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
}
count++;
}
#endif // ANDROID || MOZ_WIDGET_GONK
#endif // ANDROID
return info;
}
+1 -1
View File
@@ -9,7 +9,7 @@
nsresult
SaveProfileTask::Run() {
// Get file path
#if defined(SPS_PLAT_arm_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_PLAT_arm_android)
nsCString tmpPath;
tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid());
#else
+3 -3
View File
@@ -16,7 +16,7 @@
#include "PlatformMacros.h"
#include "AutoObjectMapper.h"
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
# include <dlfcn.h>
# include "mozilla/Types.h"
// FIXME move these out of mozglue/linker/ElfLoader.h into their
@@ -108,7 +108,7 @@ bool AutoObjectMapperPOSIX::Map(/*OUT*/void** start, /*OUT*/size_t* length,
}
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
// A helper function for AutoObjectMapperFaultyLib::Map. Finds out
// where the installation's lib directory is, since we'll have to look
// in there to get hold of libmozglue.so. Returned C string is heap
@@ -204,4 +204,4 @@ bool AutoObjectMapperFaultyLib::Map(/*OUT*/void** start, /*OUT*/size_t* length,
}
}
#endif // defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#endif // defined(SPS_OS_android)
+2 -2
View File
@@ -62,7 +62,7 @@ private:
};
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#if defined(SPS_OS_android)
// This is a variant of AutoObjectMapperPOSIX suitable for use in
// conjunction with faulty.lib on Android. How it behaves depends on
// the name of the file to be mapped. There are three possible cases:
@@ -110,6 +110,6 @@ private:
void operator delete[](void*);
};
#endif // defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
#endif // defined(SPS_OS_android)
#endif // AutoObjectMapper_h
+1 -1
View File
@@ -32,7 +32,7 @@ read_procmaps(lul::LUL* aLUL)
for (size_t i = 0; i < info.GetSize(); i++) {
const SharedLibrary& lib = info.GetEntry(i);
# if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
# if defined(SPS_OS_android)
// We're using faulty.lib. Use a special-case object mapper.
AutoObjectMapperFaultyLib mapper(aLUL->mLog);
# else
@@ -346,13 +346,6 @@ static inline void profiler_tracing(const char* aCategory, const char* aInfo,
#define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, category, ...) MOZ_ASSERT(NS_IsMainThread(), "This can only be called on the main thread"); mozilla::SamplerStackFramePrintfRAII SAMPLER_APPEND_LINE_NUMBER(sampler_raii)(name_space "::" info, category, __LINE__, __VA_ARGS__)
/* FIXME/bug 789667: memory constraints wouldn't much of a problem for
* this small a sample buffer size, except that serializing the
* profile data is extremely, unnecessarily memory intensive. */
#ifdef MOZ_WIDGET_GONK
# define PLATFORM_LIKELY_MEMORY_CONSTRAINED
#endif
#if !defined(PLATFORM_LIKELY_MEMORY_CONSTRAINED) && !defined(ARCH_ARMV6)
# define PROFILE_DEFAULT_ENTRY 1000000
#else
-4
View File
@@ -1596,10 +1596,6 @@ nsMemoryReporterManager::~nsMemoryReporterManager()
NS_ASSERTION(!mSavedWeakReporters, "failed to restore weak reporters");
}
#ifdef MOZ_WIDGET_GONK
#define DEBUG_CHILD_PROCESS_MEMORY_REPORTING 1
#endif
#ifdef DEBUG_CHILD_PROCESS_MEMORY_REPORTING
#define MEMORY_REPORTING_LOG(format, ...) \
printf_stderr("++++ MEMORY REPORTING: " format, ##__VA_ARGS__);
-44
View File
@@ -50,12 +50,6 @@
#include "mozilla/dom/ContentChild.h"
#endif
#ifdef MOZ_WIDGET_GONK
#include <sys/system_properties.h>
#include "mozilla/Preferences.h"
#include "nsPrintfCString.h"
#endif
#ifdef ANDROID
extern "C" {
NS_EXPORT int android_sdk_version;
@@ -747,44 +741,6 @@ nsSystemInfo::Init()
}
#endif
#ifdef MOZ_WIDGET_GONK
char sdk[PROP_VALUE_MAX];
if (__system_property_get("ro.build.version.sdk", sdk)) {
android_sdk_version = atoi(sdk);
SetPropertyAsInt32(NS_LITERAL_STRING("sdk_version"), android_sdk_version);
SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"),
nsPrintfCString("SDK %u", android_sdk_version));
}
char characteristics[PROP_VALUE_MAX];
if (__system_property_get("ro.build.characteristics", characteristics)) {
if (!strcmp(characteristics, "tablet")) {
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), true);
} else if (!strcmp(characteristics, "tv")) {
SetPropertyAsBool(NS_LITERAL_STRING("tv"), true);
}
}
nsAutoString str;
rv = GetPropertyAsAString(NS_LITERAL_STRING("version"), str);
if (NS_SUCCEEDED(rv)) {
SetPropertyAsAString(NS_LITERAL_STRING("kernel_version"), str);
}
const nsAdoptingString& b2g_os_name =
mozilla::Preferences::GetString("b2g.osName");
if (b2g_os_name) {
SetPropertyAsAString(NS_LITERAL_STRING("name"), b2g_os_name);
}
const nsAdoptingString& b2g_version =
mozilla::Preferences::GetString("b2g.version");
if (b2g_version) {
SetPropertyAsAString(NS_LITERAL_STRING("version"), b2g_version);
}
#endif
return NS_OK;
}
-5
View File
@@ -90,11 +90,6 @@ private:
// On Android, we use the GRE_HOME variable that is set by the Java
// bootstrap code.
const char* greHome = getenv("GRE_HOME");
#if defined(MOZ_WIDGET_GONK)
if (!greHome) {
greHome = "/system/b2g";
}
#endif
if (!greHome) {
return NS_ERROR_FAILURE;
-11
View File
@@ -1104,17 +1104,6 @@ ShutdownXPCOM(nsIServiceManager* aServMgr)
NS_LogTerm();
#if defined(MOZ_WIDGET_GONK)
// This _exit(0) call is intended to be temporary, to get shutdown leak
// checking working on non-B2G platforms.
// On debug B2G, the child process crashes very late. Instead, just
// give up so at least we exit cleanly. See bug 1071866.
if (XRE_IsContentProcess()) {
NS_WARNING("Exiting child process early!");
_exit(0);
}
#endif
return NS_OK;
}
+1 -1
View File
@@ -20,7 +20,7 @@ class GMPLoader;
*/
struct XREChildData
{
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK)
#if !defined(MOZ_WIDGET_ANDROID)
/**
* Used to load the GMP binary.
*/
+5 -6
View File
@@ -161,7 +161,7 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0,
const size_t aCount = SIZE_MAX);
#if defined(MOZ_WIDGET_GONK) || defined(XP_UNIX)
#if defined(XP_UNIX)
#define MOZ_TEMP_FAILURE_RETRY(exp) (__extension__({ \
typeof (exp) _rc; \
do { \
@@ -171,10 +171,9 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0,
}))
#endif
/* Define ReadSysFile() and WriteSysFile() only on GONK to avoid unnecessary
* libxul bloat. Also define it in debug builds, so that unit tests for it can
* be written and run in non-GONK builds. */
#if (defined(MOZ_WIDGET_GONK) || defined(DEBUG)) && defined(XP_UNIX)
/* Define ReadSysFile() and WriteSysFile() only in debug builds, so that
* unit tests for it can be written and run. */
#if defined(DEBUG) && defined(XP_UNIX)
#ifndef ReadSysFile_PRESENT
#define ReadSysFile_PRESENT
@@ -213,7 +212,7 @@ bool ReadSysFile(const char* aFilename, bool* aVal);
bool WriteSysFile(const char* aFilename, const char* aBuf);
#endif /* (MOZ_WIDGET_GONK || DEBUG) && XP_UNIX */
#endif /* DEBUG && XP_UNIX */
} // namespace mozilla
-5
View File
@@ -359,11 +359,6 @@ ThreadStackHelper::PrepareStackBuffer(Stack& aStack)
profiler_register_thread). However, on B2G, profiling secondary threads
may be disabled despite profiler being enabled. This is by-design and
is not an error. */
#ifdef MOZ_WIDGET_GONK
if (!mPseudoStack) {
return false;
}
#endif
MOZ_ASSERT(mPseudoStack);
if (!aStack.reserve(mMaxStackSize) ||
!aStack.reserve(aStack.capacity()) || // reserve up to the capacity