Remove MOZ_WIDGET_GONK [1/2]

Tag #288
This commit is contained in:
wolfbeast 2018-05-12 16:19:33 +02:00 • committed by Roy Tam
commit b586913598
53 changed files with 60 additions and 750 deletions

View file

@ -391,9 +391,6 @@ DiskInit.h
dlfcn.h dlfcn.h
dlgs.h dlgs.h
dl.h dl.h
#ifdef MOZ_WIDGET_GONK
dns_sd.h
#endif
docobj.h docobj.h
dos/dosextens.h dos/dosextens.h
dos.h dos.h

View file

@ -312,9 +312,6 @@ this.AppsUtils = {
// Instead, we check if the app is installed under /system/b2g // Instead, we check if the app is installed under /system/b2g
let isCoreApp = false; let isCoreApp = false;
#ifdef MOZ_WIDGET_GONK
isCoreApp = app.basePath == this.getCoreAppsBasePath();
#endif
debug(app.basePath + " isCoreApp: " + isCoreApp); debug(app.basePath + " isCoreApp: " + isCoreApp);
return { "path": app.basePath + "/" + app.id, return { "path": app.basePath + "/" + app.id,

View file

@ -27,11 +27,6 @@
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "mozilla/dom/SettingChangeNotificationBinding.h" #include "mozilla/dom/SettingChangeNotificationBinding.h"
#ifdef MOZ_WIDGET_GONK
#include "nsJSUtils.h"
#include "SpeakerManagerService.h"
#endif
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
using namespace mozilla; using namespace mozilla;
@ -237,20 +232,12 @@ AudioChannelService::Shutdown()
if (IsParentProcess()) { if (IsParentProcess()) {
obs->RemoveObserver(gAudioChannelService, "ipc:content-shutdown"); 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->mWindows.Clear();
gAudioChannelService->mPlayingChildren.Clear(); gAudioChannelService->mPlayingChildren.Clear();
gAudioChannelService->mTabParents.Clear(); gAudioChannelService->mTabParents.Clear();
#ifdef MOZ_WIDGET_GONK
gAudioChannelService->mSpeakerManager.Clear();
#endif
gAudioChannelService = nullptr; gAudioChannelService = nullptr;
} }
@ -284,11 +271,6 @@ AudioChannelService::AudioChannelService()
obs->AddObserver(this, "outer-window-destroyed", false); obs->AddObserver(this, "outer-window-destroyed", false);
if (IsParentProcess()) { if (IsParentProcess()) {
obs->AddObserver(this, "ipc:content-shutdown", false); 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); RefPtr<AudioChannelAgent> kungFuDeathGrip(aAgent);
winData->RemoveAgent(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(); MaybeSendStatusUpdate();
} }
@ -573,13 +548,6 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic,
iter.GetNext()->WindowVolumeChanged(); 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")) { } else if (!strcmp(aTopic, "ipc:content-shutdown")) {
nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(aSubject); nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(aSubject);
if (!props) { if (!props) {

View file

@ -25,10 +25,6 @@ struct PRLogModuleInfo;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
#ifdef MOZ_WIDGET_GONK
class SpeakerManagerService;
#endif
class TabParent; class TabParent;
#define NUMBER_OF_AUDIO_CHANNELS (uint32_t)AudioChannel::EndGuard_ #define NUMBER_OF_AUDIO_CHANNELS (uint32_t)AudioChannel::EndGuard_
@ -189,20 +185,6 @@ public:
uint64_t aInnerWindowID, uint64_t aInnerWindowID,
bool aCapture); 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 const nsAttrValue::EnumTable* GetAudioChannelTable();
static AudioChannel GetAudioChannel(const nsAString& aString); static AudioChannel GetAudioChannel(const nsAString& aString);
static AudioChannel GetDefaultAudioChannel(); static AudioChannel GetDefaultAudioChannel();
@ -347,10 +329,6 @@ private:
nsTObserverArray<nsAutoPtr<AudioChannelChildStatus>> mPlayingChildren; nsTObserverArray<nsAutoPtr<AudioChannelChildStatus>> mPlayingChildren;
#ifdef MOZ_WIDGET_GONK
nsTArray<SpeakerManagerService*> mSpeakerManager;
#endif
// Raw pointers because TabParents must unregister themselves. // Raw pointers because TabParents must unregister themselves.
nsTArray<TabParent*> mTabParents; nsTArray<TabParent*> mTabParents;

View file

@ -767,12 +767,6 @@ StaticRefPtr<VibrateWindowListener> gVibrateWindowListener;
static bool static bool
MayVibrate(nsIDocument* doc) { 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. // Hidden documents cannot start or stop a vibration.
return (doc && !doc->Hidden()); return (doc && !doc->Hidden());
} }

View file

@ -309,7 +309,7 @@ ScreenOrientation::LockInternal(ScreenOrientationInternal aOrientation, ErrorRes
return nullptr; 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. // User agent does not support locking the screen orientation.
p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR); p->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return p.forget(); return p.forget();

View file

@ -5,9 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <map> #include <map>
#ifdef MOZ_WIDGET_GONK
#include "GonkPermission.h"
#endif // MOZ_WIDGET_GONK
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIPrincipal.h" #include "nsIPrincipal.h"

View file

@ -25,7 +25,7 @@
#include "mozilla/dom/Timeout.h" #include "mozilla/dom/Timeout.h"
#include "mozilla/dom/TimeoutHandler.h" #include "mozilla/dom/TimeoutHandler.h"
#include "mozilla/IntegerPrintfMacros.h" #include "mozilla/IntegerPrintfMacros.h"
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
#include "mozilla/dom/WindowOrientationObserver.h" #include "mozilla/dom/WindowOrientationObserver.h"
#endif #endif
#include "nsDOMOfflineResourceList.h" #include "nsDOMOfflineResourceList.h"
@ -1948,7 +1948,7 @@ nsGlobalWindow::CleanUp()
mSpeechSynthesis = nullptr; mSpeechSynthesis = nullptr;
#endif #endif
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
mOrientationChangeObserver = nullptr; mOrientationChangeObserver = nullptr;
#endif #endif
@ -2076,7 +2076,7 @@ nsGlobalWindow::FreeInnerObjects()
mScreen = nullptr; mScreen = nullptr;
} }
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
mOrientationChangeObserver = nullptr; mOrientationChangeObserver = nullptr;
#endif #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 void
nsGlobalWindow::EnableOrientationChangeListener() nsGlobalWindow::EnableOrientationChangeListener()
{ {
@ -14902,7 +14902,7 @@ nsGlobalWindow::IsModalContentWindow(JSContext* aCx, JSObject* aGlobal)
return xpc::WindowOrNull(aGlobal)->IsModalContentWindow(); return xpc::WindowOrNull(aGlobal)->IsModalContentWindow();
} }
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
int16_t int16_t
nsGlobalWindow::Orientation(CallerType aCallerType) const nsGlobalWindow::Orientation(CallerType aCallerType) const
{ {

View file

@ -138,7 +138,7 @@ class U2F;
class VRDisplay; class VRDisplay;
class VREventObserver; class VREventObserver;
class WakeLock; class WakeLock;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
class WindowOrientationObserver; class WindowOrientationObserver;
#endif #endif
class Worklet; class Worklet;
@ -631,7 +631,7 @@ public:
virtual void EnableDeviceSensor(uint32_t aType) override; virtual void EnableDeviceSensor(uint32_t aType) override;
virtual void DisableDeviceSensor(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 EnableOrientationChangeListener() override;
virtual void DisableOrientationChangeListener() override; virtual void DisableOrientationChangeListener() override;
#endif #endif
@ -905,7 +905,7 @@ public:
nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError); nsIDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
already_AddRefed<nsIDOMOfflineResourceList> GetApplicationCache() override; 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; int16_t Orientation(mozilla::dom::CallerType aCallerType) const;
#endif #endif
@ -1971,7 +1971,7 @@ protected:
nsTArray<uint32_t> mEnabledSensors; nsTArray<uint32_t> mEnabledSensors;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
nsAutoPtr<mozilla::dom::WindowOrientationObserver> mOrientationChangeObserver; nsAutoPtr<mozilla::dom::WindowOrientationObserver> mOrientationChangeObserver;
#endif #endif

View file

@ -444,7 +444,7 @@ public:
*/ */
virtual void DisableDeviceSensor(uint32_t aType) = 0; 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 EnableOrientationChangeListener() = 0;
virtual void DisableOrientationChangeListener() = 0; virtual void DisableOrientationChangeListener() = 0;
#endif #endif

View file

@ -141,10 +141,6 @@ using mozilla::gl::GLContextProvider;
#include "gfxWindowsPlatform.h" #include "gfxWindowsPlatform.h"
#endif #endif
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
// windows.h (included by chromium code) defines this, in its infinite wisdom // windows.h (included by chromium code) defines this, in its infinite wisdom
#undef DrawText #undef DrawText

View file

@ -51,10 +51,6 @@
#include "VRManagerChild.h" #include "VRManagerChild.h"
#include "mozilla/layers/TextureClientSharedSurface.h" #include "mozilla/layers/TextureClientSharedSurface.h"
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/ShadowLayers.h"
#endif
// Local // Local
#include "CanvasUtils.h" #include "CanvasUtils.h"
#include "WebGL1Context.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. // for now it's just behind a pref for testing/evaluation.
baseCaps.bpp16 = gfxPrefs::WebGLPrefer16bpp(); 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. // Done with baseCaps construction.
if (!gfxPrefs::WebGLForceMSAA()) { if (!gfxPrefs::WebGLForceMSAA()) {

View file

@ -352,7 +352,7 @@ EventListenerManager::AddEventListenerInternal(
EnableDevice(eDeviceLight); EnableDevice(eDeviceLight);
} else if (aTypeAtom == nsGkAtoms::ondevicemotion) { } else if (aTypeAtom == nsGkAtoms::ondevicemotion) {
EnableDevice(eDeviceMotion); EnableDevice(eDeviceMotion);
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
} else if (aTypeAtom == nsGkAtoms::onorientationchange) { } else if (aTypeAtom == nsGkAtoms::onorientationchange) {
EnableDevice(eOrientationChange); EnableDevice(eOrientationChange);
#endif #endif
@ -481,7 +481,7 @@ EventListenerManager::IsDeviceType(EventMessage aEventMessage)
case eDeviceLight: case eDeviceLight:
case eDeviceProximity: case eDeviceProximity:
case eUserProximity: case eUserProximity:
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange: case eOrientationChange:
#endif #endif
return true; return true;
@ -529,7 +529,7 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage)
window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION); window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION);
window->EnableDeviceSensor(SENSOR_GYROSCOPE); window->EnableDeviceSensor(SENSOR_GYROSCOPE);
break; break;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange: case eOrientationChange:
window->EnableOrientationChangeListener(); window->EnableOrientationChangeListener();
break; break;
@ -575,7 +575,7 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage)
case eDeviceLight: case eDeviceLight:
window->DisableDeviceSensor(SENSOR_LIGHT); window->DisableDeviceSensor(SENSOR_LIGHT);
break; break;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
case eOrientationChange: case eOrientationChange:
window->DisableOrientationChangeListener(); window->DisableOrientationChangeListener();
break; break;

View file

@ -563,7 +563,7 @@ WINDOW_EVENT(online,
eOnline, eOnline,
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly, EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
eBasicEventClass) eBasicEventClass)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
WINDOW_EVENT(orientationchange, WINDOW_EVENT(orientationchange,
eOrientationChange, eOrientationChange,
EventNameType_HTMLBodyOrFramesetOnly, EventNameType_HTMLBodyOrFramesetOnly,

View file

@ -33,10 +33,6 @@ class nsIPrincipal;
#include "AndroidLocationProvider.h" #include "AndroidLocationProvider.h"
#endif #endif
#ifdef MOZ_WIDGET_GONK
#include "GonkGPSGeolocationProvider.h"
#endif
#ifdef MOZ_GPSD #ifdef MOZ_GPSD
#include "GpsdLocationProvider.h" #include "GpsdLocationProvider.h"
#endif #endif
@ -688,15 +684,6 @@ nsresult nsGeolocationService::Init()
mProvider = new AndroidLocationProvider(); mProvider = new AndroidLocationProvider();
#endif #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_WIDGET_GTK
#ifdef MOZ_GPSD #ifdef MOZ_GPSD
if (Preferences::GetBool("geo.provider.use_gpsd", false)) { if (Preferences::GetBool("geo.provider.use_gpsd", false)) {

View file

@ -267,8 +267,8 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
aType == NS_FORM_INPUT_TEL || aType == NS_FORM_INPUT_TEL ||
aType == NS_FORM_INPUT_URL || aType == NS_FORM_INPUT_URL ||
// TODO: those are temporary until bug 773205 is fixed. // TODO: those are temporary until bug 773205 is fixed.
#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. // On Android, date/time input appears as a normal text box.
aType == NS_FORM_INPUT_TIME || aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_DATE ||
#endif #endif

View file

@ -121,7 +121,7 @@
LogLevel::Debug, \ LogLevel::Debug, \
_args ) _args )
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
#define IDB_MOBILE #define IDB_MOBILE
#endif #endif

View file

@ -137,12 +137,6 @@
#include "APKOpen.h" #include "APKOpen.h"
#endif #endif
#if defined(MOZ_WIDGET_GONK)
#include "nsVolume.h"
#include "nsVolumeService.h"
#include "SpeakerManagerService.h"
#endif
#ifdef XP_WIN #ifdef XP_WIN
#include <process.h> #include <process.h>
#define getpid _getpid #define getpid _getpid
@ -196,9 +190,6 @@ using namespace mozilla::net;
using namespace mozilla::jsipc; using namespace mozilla::jsipc;
using namespace mozilla::psm; using namespace mozilla::psm;
using namespace mozilla::widget; using namespace mozilla::widget;
#if defined(MOZ_WIDGET_GONK)
using namespace mozilla::system;
#endif
using namespace mozilla::widget; using namespace mozilla::widget;
namespace mozilla { namespace mozilla {
@ -585,15 +576,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
void void
ContentChild::InitProcessAttributes() 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); SetProcessName(NS_LITERAL_STRING("Web Content"), true);
#endif
} }
void void
@ -1257,15 +1240,6 @@ ContentChild::RecvNotifyLayerAllocated(const dom::TabId& aTabId, const uint64_t&
bool bool
ContentChild::RecvSpeakerManagerNotify() 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; return false;
} }
@ -2284,12 +2258,6 @@ ContentChild::RecvLastPrivateDocShellDestroyed()
bool bool
ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes) ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes)
{ {
#ifdef MOZ_WIDGET_GONK
RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
if (vs) {
vs->RecvVolumesFromParent(aVolumes);
}
#endif
return true; return true;
} }
@ -2306,17 +2274,6 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
const bool& aIsRemovable, const bool& aIsRemovable,
const bool& aIsHotSwappable) 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 // Remove warnings about unused arguments
Unused << aFsName; Unused << aFsName;
Unused << aVolumeName; Unused << aVolumeName;
@ -2329,22 +2286,15 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
Unused << aIsUnmounting; Unused << aIsUnmounting;
Unused << aIsRemovable; Unused << aIsRemovable;
Unused << aIsHotSwappable; Unused << aIsHotSwappable;
#endif
return true; return true;
} }
bool bool
ContentChild::RecvVolumeRemoved(const nsString& aFsName) 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 // Remove warnings about unused arguments
Unused << aFsName; Unused << aFsName;
#endif
return true; return true;
} }

View file

@ -16,11 +16,6 @@
# include <sys/resource.h> # include <sys/resource.h>
#endif #endif
#ifdef MOZ_WIDGET_GONK
#include <sys/types.h>
#include <sys/wait.h>
#endif
#include "chrome/common/process_watcher.h" #include "chrome/common/process_watcher.h"
#include "mozilla/a11y/PDocAccessible.h" #include "mozilla/a11y/PDocAccessible.h"
@ -210,14 +205,6 @@
# include "AndroidBridge.h" # include "AndroidBridge.h"
#endif #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 #ifdef MOZ_WIDGET_GTK
#include <gdk/gdk.h> #include <gdk/gdk.h>
#endif #endif
@ -526,11 +513,6 @@ static const char* sObserverTopics[] = {
"child-mmu-request", "child-mmu-request",
"last-pb-context-exited", "last-pb-context-exited",
"file-watcher-update", "file-watcher-update",
#ifdef MOZ_WIDGET_GONK
NS_VOLUME_STATE_CHANGED,
NS_VOLUME_REMOVED,
"phone-state-changed",
#endif
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
"a11y-init-or-shutdown", "a11y-init-or-shutdown",
#endif #endif
@ -1355,14 +1337,6 @@ ContentParent::ForwardKnownInfo()
if (!mMetamorphosed) { if (!mMetamorphosed) {
return; 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 { namespace {
@ -1410,23 +1384,6 @@ bool
ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority) ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority)
{ {
ProcessPriorityManager::SetProcessPriority(this, 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; return true;
} }
@ -2686,50 +2643,6 @@ ContentParent::Observe(nsISupports* aSubject,
else if (!strcmp(aTopic, "last-pb-context-exited")) { else if (!strcmp(aTopic, "last-pb-context-exited")) {
Unused << SendLastPrivateDocShellDestroyed(); 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 #ifdef ACCESSIBILITY
else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) { else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) {
if (*aData == '1') { if (*aData == '1') {
@ -3398,29 +3311,12 @@ ContentParent::RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor)
bool bool
ContentParent::RecvSpeakerManagerGetSpeakerStatus(bool* aValue) 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; return false;
} }
bool bool
ContentParent::RecvSpeakerManagerForceSpeaker(const bool& aEnable) 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; return false;
} }
@ -3976,49 +3872,22 @@ bool
ContentParent::RecvCreateFakeVolume(const nsString& fsName, ContentParent::RecvCreateFakeVolume(const nsString& fsName,
const nsString& mountPoint) const nsString& mountPoint)
{ {
#ifdef MOZ_WIDGET_GONK NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called");
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");
return false; return false;
#endif
} }
bool bool
ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState)
{ {
#ifdef MOZ_WIDGET_GONK NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called");
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");
return false; return false;
#endif
} }
bool bool
ContentParent::RecvRemoveFakeVolume(const nsString& fsName) ContentParent::RecvRemoveFakeVolume(const nsString& fsName)
{ {
#ifdef MOZ_WIDGET_GONK NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called");
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");
return false; return false;
#endif
} }
bool bool

View file

@ -33,11 +33,6 @@
#include "nsStringStream.h" #include "nsStringStream.h"
#include "secerr.h" #include "secerr.h"
#include "sslerr.h" #include "sslerr.h"
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkStatsServiceProxy.h"
#include "nsINetworkManager.h"
#include "nsINetworkInterface.h"
#endif
#define BUFFER_SIZE 65536 #define BUFFER_SIZE 65536
#define NETWORK_STATS_THRESHOLD 65536 #define NETWORK_STATS_THRESHOLD 65536
@ -163,12 +158,6 @@ TCPSocket::TCPSocket(nsIGlobalObject* aGlobal, const nsAString& aHost, uint16_t
, mTrackingNumber(0) , mTrackingNumber(0)
, mWaitingForStartTLS(false) , mWaitingForStartTLS(false)
, mObserversActive(false) , mObserversActive(false)
#ifdef MOZ_WIDGET_GONK
, mTxBytes(0)
, mRxBytes(0)
, mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID)
, mInIsolatedMozBrowser(false)
#endif
{ {
if (aGlobal) { if (aGlobal) {
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal); nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
@ -323,13 +312,6 @@ TCPSocket::InitWithTransport(nsISocketTransport* aTransport)
mTransport->GetPort(&port); mTransport->GetPort(&port);
mPort = 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; return NS_OK;
} }
@ -651,12 +633,6 @@ TCPSocket::Resume(mozilla::ErrorResult& aRv)
nsresult nsresult
TCPSocket::MaybeReportErrorAndCloseIfOpen(nsresult status) { 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 // If we're closed, we've already reported the error or just don't need to
// report the error. // report the error.
if (mReadyState == TCPReadyState::Closed) { if (mReadyState == TCPReadyState::Closed) {
@ -941,12 +917,6 @@ TCPSocket::Send(nsIInputStream* aStream, uint32_t aByteLength)
EnsureCopying(); EnsureCopying();
#ifdef MOZ_WIDGET_GONK
// Collect transmitted amount for network statistics.
mTxBytes += aByteLength;
SaveNetworkStats(false);
#endif
return !bufferFull; return !bufferFull;
} }
@ -1069,12 +1039,6 @@ NS_IMETHODIMP
TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream, TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream,
uint64_t aOffset, uint32_t aCount) uint64_t aOffset, uint32_t aCount)
{ {
#ifdef MOZ_WIDGET_GONK
// Collect received amount for network statistics.
mRxBytes += aCount;
SaveNetworkStats(false);
#endif
if (mUseArrayBuffers) { if (mUseArrayBuffers) {
nsTArray<uint8_t> buffer; nsTArray<uint8_t> buffer;
buffer.SetCapacity(aCount); buffer.SetCapacity(aCount);
@ -1160,10 +1124,7 @@ TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent)
void void
TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser) TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedMozBrowser)
{ {
#ifdef MOZ_WIDGET_GONK /*** STUB ***/
mAppId = aAppId;
mInIsolatedMozBrowser = aInIsolatedMozBrowser;
#endif
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -1190,37 +1151,6 @@ TCPSocket::UpdateBufferedAmount(uint32_t aBufferedAmount, uint32_t aTrackingNumb
return NS_OK; 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 NS_IMETHODIMP
TCPSocket::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) TCPSocket::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{ {

View file

@ -179,10 +179,6 @@ private:
void ActivateTLS(); void ActivateTLS();
// Dispatch an error event if necessary, then dispatch a "close" event. // Dispatch an error event if necessary, then dispatch a "close" event.
nsresult MaybeReportErrorAndCloseIfOpen(nsresult status); 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. // Helper for FireDataStringEvent/FireDataArrayEvent.
nsresult FireDataEvent(JSContext* aCx, const nsAString& aType, nsresult FireDataEvent(JSContext* aCx, const nsAString& aType,
@ -246,19 +242,6 @@ private:
nsTArray<nsCOMPtr<nsIInputStream>> mPendingDataWhileCopierActive; nsTArray<nsCOMPtr<nsIInputStream>> mPendingDataWhileCopierActive;
bool mObserversActive; 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 } // namespace dom

View file

@ -57,12 +57,6 @@ PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
mNPP_GetSitesWithData = pFuncs->getsiteswithdata; mNPP_GetSitesWithData = pFuncs->getsiteswithdata;
return NS_OK; 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) #elif defined(XP_UNIX) && !defined(XP_MACOSX)
nsresult nsresult
PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs, PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,

View file

@ -81,7 +81,7 @@ public:
return true; 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, virtual nsresult NP_Initialize(NPNetscapeFuncs* aNetscapeFuncs,
NPPluginFuncs* aFuncs, NPError* aError) override; NPPluginFuncs* aFuncs, NPError* aError) override;
#else #else

View file

@ -320,7 +320,6 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult)
if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) { if (rv != NS_OK || pluginCallError != NPERR_NO_ERROR) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
#elif defined(MOZ_WIDGET_GONK)
#else #else
NPError pluginCallError; NPError pluginCallError;
nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &plugin->mPluginFuncs, &pluginCallError); nsresult rv = pluginLib->NP_Initialize(&sBrowserFuncs, &plugin->mPluginFuncs, &pluginCallError);

View file

@ -57,7 +57,7 @@ public:
virtual bool HasRequiredFunctions() = 0; 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; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0;
#else #else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0;

View file

@ -529,7 +529,7 @@ PluginModuleChromeParent::OnProcessLaunched(const bool aSucceeded)
if (NS_SUCCEEDED(mAsyncInitRv)) if (NS_SUCCEEDED(mAsyncInitRv))
#endif #endif
{ {
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) #if defined(XP_UNIX) && !defined(XP_MACOSX)
mAsyncInitRv = NP_Initialize(mNPNIface, mAsyncInitRv = NP_Initialize(mNPNIface,
mNPPIface, mNPPIface,
&mAsyncInitError); &mAsyncInitError);
@ -1745,7 +1745,7 @@ PluginModuleChromeParent::CachedSettingChanged(const char* aPref, void* aModule)
module->CachedSettingChanged(); module->CachedSettingChanged();
} }
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) #if defined(XP_UNIX) && !defined(XP_MACOSX)
nsresult nsresult
PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error)
{ {

View file

@ -267,7 +267,7 @@ protected:
const mozilla::NativeEventData& aNativeKeyData, const mozilla::NativeEventData& aNativeKeyData,
bool aIsConsumed) override; 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; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override;
#else #else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override;
@ -517,7 +517,7 @@ private:
PluginProcessParent* Process() const { return mSubprocess; } PluginProcessParent* Process() const { return mSubprocess; }
base::ProcessHandle ChildProcessHandle() { return mSubprocess->GetChildProcessHandle(); } 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; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) override;
#else #else
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override; virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) override;

View file

@ -31,11 +31,6 @@
#include "nsIPresentationNetworkHelper.h" #include "nsIPresentationNetworkHelper.h"
#endif // MOZ_WIDGET_ANDROID #endif // MOZ_WIDGET_ANDROID
#ifdef MOZ_WIDGET_GONK
#include "nsINetworkInterface.h"
#include "nsINetworkManager.h"
#endif
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
using namespace mozilla::services; using namespace mozilla::services;
@ -647,49 +642,7 @@ PresentationControllingInfo::Shutdown(nsresult aReason)
nsresult nsresult
PresentationControllingInfo::GetAddress() PresentationControllingInfo::GetAddress()
{ {
#if defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
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)
RefPtr<PresentationNetworkHelper> networkHelper = RefPtr<PresentationNetworkHelper> networkHelper =
new PresentationNetworkHelper(this, new PresentationNetworkHelper(this,
&PresentationControllingInfo::OnGetAddress); &PresentationControllingInfo::OnGetAddress);

View file

@ -68,12 +68,9 @@ static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContrac
}; };
static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = { 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 }, { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID },
#endif #endif
#if defined(MOZ_WIDGET_GONK)
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "DisplayDeviceProvider", DISPLAY_DEVICE_PROVIDER_CONTRACT_ID },
#endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID }, { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID },
#endif //MOZ_WIDGET_ANDROID #endif //MOZ_WIDGET_ANDROID

View file

@ -924,16 +924,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
return false; 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); nsCOMPtr<nsIXULRuntime> runtime = do_GetService(XULRUNTIME_SERVICE_CONTRACTID);
if (runtime) { if (runtime) {
nsAutoCString os; nsAutoCString os;
@ -950,7 +940,6 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
return false; return false;
} }
} }
#endif // defined(MOZ_WIDGET_GONK)
#if defined(DEBUG) #if defined(DEBUG)
JS::Rooted<JS::Value> valDebug(cx, JS::TrueValue()); JS::Rooted<JS::Value> valDebug(cx, JS::TrueValue());

View file

@ -379,7 +379,7 @@ Window implements TouchEventHandlers;
Window implements OnErrorEventHandlerForWindow; Window implements OnErrorEventHandlerForWindow;
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK) #if defined(MOZ_WIDGET_ANDROID)
// https://compat.spec.whatwg.org/#windoworientation-interface // https://compat.spec.whatwg.org/#windoworientation-interface
partial interface Window { partial interface Window {
[NeedsCallerType] [NeedsCallerType]

View file

@ -89,8 +89,6 @@ AssertMainProcess()
MOZ_ASSERT(GeckoProcessType_Default == XRE_GetProcessType()); MOZ_ASSERT(GeckoProcessType_Default == XRE_GetProcessType());
} }
#if !defined(MOZ_WIDGET_GONK)
bool bool
WindowIsActive(nsPIDOMWindowInner* aWindow) WindowIsActive(nsPIDOMWindowInner* aWindow)
{ {
@ -100,8 +98,6 @@ WindowIsActive(nsPIDOMWindowInner* aWindow)
return !document->Hidden(); return !document->Hidden();
} }
#endif // !defined(MOZ_WIDGET_GONK)
StaticAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate; StaticAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate;
void InitLastIDToVibrate() void InitLastIDToVibrate()
@ -123,7 +119,6 @@ Vibrate(const nsTArray<uint32_t>& pattern, const WindowIdentifier &id)
{ {
AssertMainThread(); AssertMainThread();
#if !defined(MOZ_WIDGET_GONK)
// Only active windows may start vibrations. If |id| hasn't gone // Only active windows may start vibrations. If |id| hasn't gone
// through the IPC layer -- that is, if our caller is the outside // through the IPC layer -- that is, if our caller is the outside
// world, not hal_proxy -- check whether the window is active. If // 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."); HAL_LOG("Vibrate: Window is inactive, dropping vibrate.");
return; return;
} }
#endif // !defined(MOZ_WIDGET_GONK)
if (!InSandbox()) { if (!InSandbox()) {
if (!gLastIDToVibrate) { if (!gLastIDToVibrate) {

View file

@ -12,28 +12,9 @@
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "MainThreadUtils.h" #include "MainThreadUtils.h"
#if defined(MOZ_WIDGET_GONK)
#include "cutils/android_reboot.h"
#include "cutils/properties.h"
#endif
namespace mozilla { namespace mozilla {
namespace hal_impl { 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 void
Reboot() Reboot()
{ {
@ -44,14 +25,8 @@ Reboot()
} }
} }
#if !defined(MOZ_WIDGET_GONK)
sync(); sync();
reboot(RB_AUTOBOOT); reboot(RB_AUTOBOOT);
#elif (ANDROID_VERSION < 19)
android_reboot(ANDROID_RB_RESTART, 0, nullptr);
#else
PowerCtl("reboot", ANDROID_RB_RESTART);
#endif
} }
void void
@ -64,14 +39,8 @@ PowerOff()
} }
} }
#if !defined(MOZ_WIDGET_GONK)
sync(); sync();
reboot(RB_POWER_OFF); 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. // Structure to specify how watchdog pthread is going to work.

View file

@ -3658,7 +3658,7 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
nsCSSAnonBoxes::buttonContent) }, nsCSSAnonBoxes::buttonContent) },
// TODO: this is temporary until a frame is written: bug 635240. // TODO: this is temporary until a frame is written: bug 635240.
SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame), 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. // 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_TIME, NS_NewTextControlFrame),
SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame),

View file

@ -100,20 +100,6 @@
#include "mozilla/dom/nsSynthVoiceRegistry.h" #include "mozilla/dom/nsSynthVoiceRegistry.h"
#endif #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" #include "mozilla/dom/PushNotifier.h"
using mozilla::dom::PushNotifier; using mozilla::dom::PushNotifier;
#define PUSHNOTIFIER_CID \ #define PUSHNOTIFIER_CID \
@ -135,11 +121,9 @@ using mozilla::dom::AudioChannelAgent;
#include "nsSystemPrincipal.h" #include "nsSystemPrincipal.h"
#include "nsNullPrincipal.h" #include "nsNullPrincipal.h"
#include "nsNetCID.h" #include "nsNetCID.h"
#ifndef MOZ_WIDGET_GONK
#if defined(MOZ_WIDGET_ANDROID) #if defined(MOZ_WIDGET_ANDROID)
#include "nsHapticFeedback.h" #include "nsHapticFeedback.h"
#endif #endif
#endif
#include "nsParserUtils.h" #include "nsParserUtils.h"
#include "nsHTMLCanvasFrame.h" #include "nsHTMLCanvasFrame.h"
@ -201,9 +185,6 @@ static void Shutdown();
#include "nsIPresentationService.h" #include "nsIPresentationService.h"
#ifdef MOZ_WIDGET_GONK
#include "GonkGPSGeolocationProvider.h"
#endif
#include "MediaManager.h" #include "MediaManager.h"
#include "GMPService.h" #include "GMPService.h"
@ -284,30 +265,18 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WorkerDebuggerManager, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WorkerDebuggerManager,
WorkerDebuggerManager::GetInstance) WorkerDebuggerManager::GetInstance)
#ifdef MOZ_WIDGET_GONK
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager,
SystemWorkerManager::FactoryCreate)
#endif
#ifdef MOZ_WEBSPEECH #ifdef MOZ_WEBSPEECH
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry,
nsSynthVoiceRegistry::GetInstanceForService) nsSynthVoiceRegistry::GetInstanceForService)
#endif #endif
#ifdef MOZ_WIDGET_GONK
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioManager,
AudioManager::GetInstance)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent) NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID) #if defined(ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
#endif #endif
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
PowerManagerService::GetInstance) PowerManagerService::GetInstance)
@ -316,16 +285,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITimeService,
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService,
StreamingProtocolControllerService::GetInstance) 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, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
MediaManager::GetInstance) MediaManager::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager) 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(PUSHNOTIFIER_CID);
NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_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); 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_STRUCTUREDCLONECONTAINER_CID);
NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID); NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID) #if defined(ANDROID)
NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID); NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
#endif #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(NS_POWERMANAGERSERVICE_CID);
NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID); NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID);
NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID); NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID);
@ -983,13 +928,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor }, { &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },
{ &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor }, { &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor },
{ &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor }, { &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_AUDIOCHANNELAGENT_CID, true, nullptr, AudioChannelAgentConstructor },
{ &kNS_HTMLEDITOR_CID, false, nullptr, HTMLEditorConstructor }, { &kNS_HTMLEDITOR_CID, false, nullptr, HTMLEditorConstructor },
{ &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor }, { &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor },
@ -1025,10 +963,8 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor }, { &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor },
{ &kNS_NULLPRINCIPAL_CID, false, nullptr, nsNullPrincipalConstructor }, { &kNS_NULLPRINCIPAL_CID, false, nullptr, nsNullPrincipalConstructor },
{ &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor }, { &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor },
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID) #if defined(ANDROID)
{ &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor }, { &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor },
#endif
#endif #endif
{ &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor }, { &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor },
{ &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor }, { &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor },
@ -1038,9 +974,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor }, { &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor },
{ &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor }, { &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor },
{ &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor }, { &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 }, { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService }, { &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
@ -1127,13 +1060,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID }, { NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID },
{ PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID }, { PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID },
{ WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_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 }, { NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID },
{ "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID }, { "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID },
{ "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_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_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID },
{ NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID }, { NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID },
{ NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID }, { NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID },
#ifndef MOZ_WIDGET_GONK
#if defined(ANDROID) #if defined(ANDROID)
{ "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID }, { "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID },
#endif
#endif #endif
{ THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID }, { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
{ NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_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 }, { "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID },
{ TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID }, { TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID },
{ MEDIASTREAMCONTROLLERSERVICE_CONTRACTID, &kNS_MEDIASTREAMCONTROLLERSERVICE_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 }, { MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID }, { "@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 }, { "app-startup", "Push Notifier", "service," PUSHNOTIFIER_CONTRACTID },
{ "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID }, { "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID },
{ OBSERVER_TOPIC_IDLE_DAILY, "QuotaManagerService", 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 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", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID },
{ "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID }, { "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID },
{ "profile-after-change", "Notification Telemetry Service", NOTIFICATIONTELEMETRYSERVICE_CONTRACTID }, { "profile-after-change", "Notification Telemetry Service", NOTIFICATIONTELEMETRYSERVICE_CONTRACTID },

View file

@ -100,11 +100,6 @@
#include "Latency.h" #include "Latency.h"
#include "WebAudioUtils.h" #include "WebAudioUtils.h"
#ifdef MOZ_WIDGET_GONK
#include "nsVolumeService.h"
using namespace mozilla::system;
#endif
#include "nsError.h" #include "nsError.h"
#include "nsJSEnvironment.h" #include "nsJSEnvironment.h"
@ -395,10 +390,6 @@ nsLayoutStatics::Shutdown()
AsyncLatencyLogger::ShutdownLogger(); AsyncLatencyLogger::ShutdownLogger();
WebAudioUtils::Shutdown(); WebAudioUtils::Shutdown();
#ifdef MOZ_WIDGET_GONK
nsVolumeService::Shutdown();
#endif
#ifdef MOZ_WEBSPEECH #ifdef MOZ_WEBSPEECH
nsSynthVoiceRegistry::Shutdown(); nsSynthVoiceRegistry::Shutdown();
#endif #endif

View file

@ -19,12 +19,6 @@ nsresult
nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window, const char* url, nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window, const char* url,
nsISupports* params, bool modal) 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; nsresult rv;
nsCOMPtr<nsIWindowWatcher> windowWatcher = nsCOMPtr<nsIWindowWatcher> windowWatcher =
do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);

View file

@ -44,7 +44,7 @@
#include "mozilla/ProfileGatherer.h" #include "mozilla/ProfileGatherer.h"
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
#include "FennecJNIWrappers.h" #include "FennecJNIWrappers.h"
#endif #endif
@ -213,7 +213,7 @@ GeckoSampler::GeckoSampler(double aInterval, int aEntrySize,
} }
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
mProfileJava = mozilla::jni::IsFennec() && mProfileJava = mozilla::jni::IsFennec() &&
hasFeature(aFeatures, aFeatureCount, "java"); hasFeature(aFeatures, aFeatureCount, "java");
#else #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 static
void BuildJavaThreadJSObject(SpliceableJSONWriter& aWriter) 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()) { if (ProfileJava()) {
java::GeckoJavaSampler::Pause(); java::GeckoJavaSampler::Pause();

View file

@ -36,11 +36,11 @@
#include "GeckoTaskTracer.h" #include "GeckoTaskTracer.h"
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
#include "FennecJNIWrappers.h" #include "FennecJNIWrappers.h"
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
#include "FennecJNINatives.h" #include "FennecJNINatives.h"
#endif #endif
@ -52,7 +52,7 @@
#endif #endif
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler> class GeckoJavaSampler : public java::GeckoJavaSampler::Natives<GeckoJavaSampler>
{ {
private: private:
@ -502,7 +502,7 @@ void mozilla_sampler_init(void* stackTop)
set_stderr_callback(mozilla_sampler_log); set_stderr_callback(mozilla_sampler_log);
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
if (mozilla::jni::IsFennec()) { if (mozilla::jni::IsFennec()) {
GeckoJavaSampler::Init(); GeckoJavaSampler::Init();
} }
@ -524,7 +524,7 @@ void mozilla_sampler_init(void* stackTop)
|| defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux) || defined(SPS_PLAT_amd64_linux) || defined(SPS_PLAT_x86_linux)
, "stackwalk" , "stackwalk"
#endif #endif
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
, "java" , "java"
#endif #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()) { if (t->ProfileJava()) {
int javaInterval = aInterval; int javaInterval = aInterval;
// Java sampling doesn't accuratly keep up with 1ms sampling // 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; 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); MOZ_ASSERT(tlsPseudoStack.get() == nullptr);
PseudoStack* stack = PseudoStack::create(); PseudoStack* stack = PseudoStack::create();
tlsPseudoStack.set(stack); tlsPseudoStack.set(stack);

View file

@ -393,10 +393,7 @@ class Sampler {
static mozilla::UniquePtr<Mutex> sRegisteredThreadsMutex; static mozilla::UniquePtr<Mutex> sRegisteredThreadsMutex;
static bool CanNotifyObservers() { static bool CanNotifyObservers() {
#ifdef MOZ_WIDGET_GONK #if defined(SPS_OS_android)
// 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)
// Android ANR reporter uses the profiler off the main thread // Android ANR reporter uses the profiler off the main thread
return NS_IsMainThread(); return NS_IsMainThread();
#else #else

View file

@ -37,7 +37,6 @@ static std::string getId(const char *bin_name)
return ""; return "";
} }
#if !defined(MOZ_WIDGET_GONK)
// TODO fix me with proper include // TODO fix me with proper include
#include "nsDebug.h" #include "nsDebug.h"
#ifdef ANDROID #ifdef ANDROID
@ -86,13 +85,10 @@ dl_iterate_callback(struct dl_phdr_info *dl_info, size_t size, void *data)
return 0; return 0;
} }
#endif // !MOZ_WIDGET_GONK
SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
{ {
SharedLibraryInfo info; SharedLibraryInfo info;
#if !defined(MOZ_WIDGET_GONK)
#ifdef ANDROID #ifdef ANDROID
if (!dl_iterate_phdr) { if (!dl_iterate_phdr) {
// On ARM Android, dl_iterate_phdr is provided by the custom linker. // On ARM Android, dl_iterate_phdr is provided by the custom linker.
@ -104,9 +100,8 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
#endif // ANDROID #endif // ANDROID
dl_iterate_phdr(dl_iterate_callback, &info); 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(); pid_t pid = getpid();
char path[PATH_MAX]; char path[PATH_MAX];
snprintf(path, PATH_MAX, "/proc/%d/maps", pid); snprintf(path, PATH_MAX, "/proc/%d/maps", pid);
@ -132,19 +127,10 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
LOG("Get maps line failed"); LOG("Get maps line failed");
continue; continue;
} }
#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
// Use proc/pid/maps to get the dalvik-jit section since it has // Use proc/pid/maps to get the dalvik-jit section since it has
// no associated phdrs // no associated phdrs
if (strcmp(name, "/dev/ashmem/dalvik-jit-code-cache") != 0) if (strcmp(name, "/dev/ashmem/dalvik-jit-code-cache") != 0)
continue; 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); SharedLibrary shlib(start, end, offset, getId(name), name);
info.AddSharedLibrary(shlib); info.AddSharedLibrary(shlib);
if (count > 10000) { if (count > 10000) {
@ -153,7 +139,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf()
} }
count++; count++;
} }
#endif // ANDROID || MOZ_WIDGET_GONK #endif // ANDROID
return info; return info;
} }

View file

@ -9,7 +9,7 @@
nsresult nsresult
SaveProfileTask::Run() { SaveProfileTask::Run() {
// Get file path // Get file path
#if defined(SPS_PLAT_arm_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_PLAT_arm_android)
nsCString tmpPath; nsCString tmpPath;
tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid()); tmpPath.AppendPrintf("/sdcard/profile_%i_%i.txt", XRE_GetProcessType(), getpid());
#else #else

View file

@ -16,7 +16,7 @@
#include "PlatformMacros.h" #include "PlatformMacros.h"
#include "AutoObjectMapper.h" #include "AutoObjectMapper.h"
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #if defined(SPS_OS_android)
# include <dlfcn.h> # include <dlfcn.h>
# include "mozilla/Types.h" # include "mozilla/Types.h"
// FIXME move these out of mozglue/linker/ElfLoader.h into their // 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 // A helper function for AutoObjectMapperFaultyLib::Map. Finds out
// where the installation's lib directory is, since we'll have to look // 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 // 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)

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 // This is a variant of AutoObjectMapperPOSIX suitable for use in
// conjunction with faulty.lib on Android. How it behaves depends on // conjunction with faulty.lib on Android. How it behaves depends on
// the name of the file to be mapped. There are three possible cases: // the name of the file to be mapped. There are three possible cases:
@ -110,6 +110,6 @@ private:
void operator delete[](void*); void operator delete[](void*);
}; };
#endif // defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK) #endif // defined(SPS_OS_android)
#endif // AutoObjectMapper_h #endif // AutoObjectMapper_h

View file

@ -32,7 +32,7 @@ read_procmaps(lul::LUL* aLUL)
for (size_t i = 0; i < info.GetSize(); i++) { for (size_t i = 0; i < info.GetSize(); i++) {
const SharedLibrary& lib = info.GetEntry(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. // We're using faulty.lib. Use a special-case object mapper.
AutoObjectMapperFaultyLib mapper(aLUL->mLog); AutoObjectMapperFaultyLib mapper(aLUL->mLog);
# else # else

View file

@ -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__) #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) #if !defined(PLATFORM_LIKELY_MEMORY_CONSTRAINED) && !defined(ARCH_ARMV6)
# define PROFILE_DEFAULT_ENTRY 1000000 # define PROFILE_DEFAULT_ENTRY 1000000
#else #else

View file

@ -1596,10 +1596,6 @@ nsMemoryReporterManager::~nsMemoryReporterManager()
NS_ASSERTION(!mSavedWeakReporters, "failed to restore weak reporters"); 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 #ifdef DEBUG_CHILD_PROCESS_MEMORY_REPORTING
#define MEMORY_REPORTING_LOG(format, ...) \ #define MEMORY_REPORTING_LOG(format, ...) \
printf_stderr("++++ MEMORY REPORTING: " format, ##__VA_ARGS__); printf_stderr("++++ MEMORY REPORTING: " format, ##__VA_ARGS__);

View file

@ -50,12 +50,6 @@
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
#endif #endif
#ifdef MOZ_WIDGET_GONK
#include <sys/system_properties.h>
#include "mozilla/Preferences.h"
#include "nsPrintfCString.h"
#endif
#ifdef ANDROID #ifdef ANDROID
extern "C" { extern "C" {
NS_EXPORT int android_sdk_version; NS_EXPORT int android_sdk_version;
@ -747,44 +741,6 @@ nsSystemInfo::Init()
} }
#endif #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; return NS_OK;
} }

View file

@ -90,11 +90,6 @@ private:
// On Android, we use the GRE_HOME variable that is set by the Java // On Android, we use the GRE_HOME variable that is set by the Java
// bootstrap code. // bootstrap code.
const char* greHome = getenv("GRE_HOME"); const char* greHome = getenv("GRE_HOME");
#if defined(MOZ_WIDGET_GONK)
if (!greHome) {
greHome = "/system/b2g";
}
#endif
if (!greHome) { if (!greHome) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

View file

@ -1107,17 +1107,6 @@ ShutdownXPCOM(nsIServiceManager* aServMgr)
NS_LogTerm(); 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; return NS_OK;
} }

View file

@ -20,7 +20,7 @@ class GMPLoader;
*/ */
struct XREChildData struct XREChildData
{ {
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK) #if !defined(MOZ_WIDGET_ANDROID)
/** /**
* Used to load the GMP binary. * Used to load the GMP binary.
*/ */

View file

@ -161,7 +161,7 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0,
const size_t aCount = SIZE_MAX); 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__({ \ #define MOZ_TEMP_FAILURE_RETRY(exp) (__extension__({ \
typeof (exp) _rc; \ typeof (exp) _rc; \
do { \ do { \
@ -171,10 +171,9 @@ void ReadAhead(filedesc_t aFd, const size_t aOffset = 0,
})) }))
#endif #endif
/* Define ReadSysFile() and WriteSysFile() only on GONK to avoid unnecessary /* Define ReadSysFile() and WriteSysFile() only in debug builds, so that
* libxul bloat. Also define it in debug builds, so that unit tests for it can * unit tests for it can be written and run. */
* be written and run in non-GONK builds. */ #if defined(DEBUG) && defined(XP_UNIX)
#if (defined(MOZ_WIDGET_GONK) || defined(DEBUG)) && defined(XP_UNIX)
#ifndef ReadSysFile_PRESENT #ifndef ReadSysFile_PRESENT
#define ReadSysFile_PRESENT #define ReadSysFile_PRESENT
@ -213,7 +212,7 @@ bool ReadSysFile(const char* aFilename, bool* aVal);
bool WriteSysFile(const char* aFilename, const char* aBuf); bool WriteSysFile(const char* aFilename, const char* aBuf);
#endif /* (MOZ_WIDGET_GONK || DEBUG) && XP_UNIX */ #endif /* DEBUG && XP_UNIX */
} // namespace mozilla } // namespace mozilla

View file

@ -359,11 +359,6 @@ ThreadStackHelper::PrepareStackBuffer(Stack& aStack)
profiler_register_thread). However, on B2G, profiling secondary threads profiler_register_thread). However, on B2G, profiling secondary threads
may be disabled despite profiler being enabled. This is by-design and may be disabled despite profiler being enabled. This is by-design and
is not an error. */ is not an error. */
#ifdef MOZ_WIDGET_GONK
if (!mPseudoStack) {
return false;
}
#endif
MOZ_ASSERT(mPseudoStack); MOZ_ASSERT(mPseudoStack);
if (!aStack.reserve(mMaxStackSize) || if (!aStack.reserve(mMaxStackSize) ||
!aStack.reserve(aStack.capacity()) || // reserve up to the capacity !aStack.reserve(aStack.capacity()) || // reserve up to the capacity