Bug 1382099 - Remove MOZ_WIDGET_GONK from toolkit/. r=glandium.

--HG--
extra : rebase_source : 709744b24104b463c8dc4cbe215d2250e7c1a9f5
This commit is contained in:
Nicholas Nethercote 2017-07-19 18:38:48 +10:00
parent 537fa49680
commit 20df43a549
13 changed files with 16 additions and 107 deletions

View File

@ -47,7 +47,7 @@
#include "nsWebRequestListener.h"
#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID)
#if !defined(MOZ_WIDGET_ANDROID)
#define MOZ_HAS_TERMINATOR
#endif

View File

@ -145,9 +145,6 @@ static const mozilla::Module::ContractIDEntry kDiskSpaceWatcherContracts[] = {
};
static const mozilla::Module::CategoryEntry kDiskSpaceWatcherCategories[] = {
#ifdef MOZ_WIDGET_GONK
{ "profile-after-change", "Disk Space Watcher Service", DISKSPACEWATCHER_CONTRACTID },
#endif
{ nullptr }
};

View File

@ -373,8 +373,6 @@ this.DownloadIntegration = {
directoryPath = await this.getPreferredDownloadsDirectory();
#elifdef MOZ_WIDGET_ANDROID
directoryPath = await this.getSystemDownloadsDirectory();
#elifdef MOZ_WIDGET_GONK
directoryPath = await this.getSystemDownloadsDirectory();
#else
directoryPath = this._getDirectory("TmpD");
#endif

View File

@ -102,7 +102,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIF
const nsACString& aContentType, bool aIsPrivate)
{
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) \
|| defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GONK)
|| defined(MOZ_WIDGET_GTK)
nsAutoString path;
if (aTarget && NS_SUCCEEDED(aTarget->GetPath(path))) {

View File

@ -241,7 +241,7 @@ NS_IMPL_ISUPPORTS(nsAppStartup,
NS_IMETHODIMP
nsAppStartup::CreateHiddenWindow()
{
#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_UIKIT)
#if defined(MOZ_WIDGET_UIKIT)
return NS_OK;
#else
nsCOMPtr<nsIAppShellService> appShellService
@ -256,7 +256,7 @@ nsAppStartup::CreateHiddenWindow()
NS_IMETHODIMP
nsAppStartup::DestroyHiddenWindow()
{
#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_UIKIT)
#if defined(MOZ_WIDGET_UIKIT)
return NS_OK;
#else
nsCOMPtr<nsIAppShellService> appShellService

View File

@ -490,13 +490,6 @@ nsWindowWatcher::CreateChromeWindow(const nsACString& aFeatures,
return NS_ERROR_UNEXPECTED;
}
// B2G multi-screen support. mozDisplayId is returned from the
// "display-changed" event, it is also platform-dependent.
#ifdef MOZ_WIDGET_GONK
int retval = WinHasOption(aFeatures, "mozDisplayId", 0, nullptr);
windowCreator2->SetScreenId(retval);
#endif
bool cancel = false;
nsCOMPtr<nsIWebBrowserChrome> newWindowChrome;
nsresult rv =

View File

@ -1601,11 +1601,9 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
if (gExceptionHandler)
return NS_ERROR_ALREADY_INITIALIZED;
#if !defined(DEBUG) || defined(MOZ_WIDGET_GONK)
#if !defined(DEBUG)
// In non-debug builds, enable the crash reporter by default, and allow
// disabling it with the MOZ_CRASHREPORTER_DISABLE environment variable.
// Also enable it by default in debug gonk builds as it is difficult to
// set environment on startup.
const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_DISABLE");
if (envvar && *envvar && !force)
return NS_OK;
@ -1617,10 +1615,7 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
return NS_OK;
#endif
#if defined(MOZ_WIDGET_GONK)
doReport = false;
headlessClient = true;
#elif defined(XP_WIN)
#if defined(XP_WIN)
doReport = ShouldReport();
#else
// this environment variable prevents us from launching

View File

@ -156,8 +156,6 @@ this.AppConstants = Object.freeze({
"macosx",
#elif MOZ_WIDGET_ANDROID
"android",
#elif MOZ_WIDGET_GONK
"gonk",
#elif XP_LINUX
"linux",
#else

View File

@ -30,10 +30,6 @@
#include "mozilla/Printf.h"
#endif
#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_CRASHREPORTER)
#include <sys/syscall.h>
#endif
// **********************************************************************
// class nsProfileLock
//
@ -192,27 +188,6 @@ void nsProfileLock::FatalSignalHandler(int signo
}
}
#ifdef MOZ_WIDGET_GONK
switch (signo) {
case SIGQUIT:
case SIGILL:
case SIGABRT:
case SIGSEGV:
#ifndef MOZ_CRASHREPORTER
// Retrigger the signal for those that can generate a core dump
signal(signo, SIG_DFL);
if (info->si_code <= 0) {
if (syscall(__NR_tgkill, getpid(), syscall(__NR_gettid), signo) < 0) {
break;
}
}
#endif
return;
default:
break;
}
#endif
// Backstop exit call, just in case.
_exit(signo);
}

View File

@ -66,10 +66,6 @@
#include <prtime.h>
#include "nsThreadUtils.h"
#ifdef MOZ_WIDGET_GONK
#include "nsIObserverService.h"
#include "mozilla/Services.h"
#endif
using mozilla::TimeDuration;
using mozilla::TimeStamp;
@ -85,31 +81,6 @@ struct TracerStartClosure {
int32_t mThresholdInterval;
};
#ifdef MOZ_WIDGET_GONK
class EventLoopLagDispatcher : public Runnable
{
public:
explicit EventLoopLagDispatcher(int aLag)
: mLag(aLag) {}
NS_IMETHOD Run() override
{
nsCOMPtr<nsIObserverService> obsService =
mozilla::services::GetObserverService();
if (!obsService) {
return NS_ERROR_FAILURE;
}
nsAutoString value;
value.AppendInt(mLag);
return obsService->NotifyObservers(nullptr, "event-loop-lag", value.get());
}
private:
int mLag;
};
#endif
/*
* The tracer thread fires events at the native event loop roughly
* every kMeasureInterval. It will sleep to attempt not to send them
@ -180,10 +151,6 @@ void TracerThread(void *arg)
fprintf(log, "MOZ_EVENT_TRACE sample %llu %lf\n",
now,
duration.ToMilliseconds());
#ifdef MOZ_WIDGET_GONK
NS_DispatchToMainThread(
new EventLoopLagDispatcher(int(duration.ToSecondsSigDigits() * 1000)));
#endif
}
if (next_sleep > duration.ToMilliseconds()) {

View File

@ -4018,7 +4018,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
return 0;
}
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
// Check for and process any available updates
nsCOMPtr<nsIFile> updRoot;
bool persistent;
@ -4211,7 +4211,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
}
#if defined(MOZ_CRASHREPORTER)
#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_CONTENT_SANDBOX)
void AddSandboxAnnotations()
{
// Include the sandbox content level, regardless of platform
@ -4240,7 +4240,7 @@ void AddSandboxAnnotations()
NS_LITERAL_CSTRING("ContentSandboxCapable"),
sandboxCapable ? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0"));
}
#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
#endif /* MOZ_CONTENT_SANDBOX */
#endif /* MOZ_CRASHREPORTER */
/*
@ -4561,7 +4561,7 @@ XREMain::XRE_mainRun()
}
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
#if defined(MOZ_SANDBOX) && defined(XP_LINUX) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_SANDBOX) && defined(XP_LINUX)
// If we're on Linux, we now have information about the OS capabilities
// available to us.
SandboxInfo sandboxInfo = SandboxInfo::Get();
@ -4584,12 +4584,12 @@ XREMain::XRE_mainRun()
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("ContentSandboxCapabilities"), flagsString);
#endif /* MOZ_CRASHREPORTER */
#endif /* MOZ_SANDBOX && XP_LINUX && !MOZ_WIDGET_GONK */
#endif /* MOZ_SANDBOX && XP_LINUX */
#if defined(MOZ_CRASHREPORTER)
#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_CONTENT_SANDBOX)
AddSandboxAnnotations();
#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
#endif /* MOZ_CONTENT_SANDBOX */
#endif /* MOZ_CRASHREPORTER */
{

View File

@ -89,10 +89,8 @@
#if defined(MOZ_CONTENT_SANDBOX)
#include "mozilla/SandboxSettings.h"
#if !defined(MOZ_WIDGET_GONK)
#include "mozilla/Preferences.h"
#endif
#endif
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
#include "mozilla/Sandbox.h"
@ -309,7 +307,7 @@ SetTaskbarGroupId(const nsString& aId)
#endif
#if defined(MOZ_CRASHREPORTER)
#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_CONTENT_SANDBOX)
void
AddContentSandboxLevelAnnotation()
{
@ -321,7 +319,7 @@ AddContentSandboxLevelAnnotation()
NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString);
}
}
#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
#endif /* MOZ_CONTENT_SANDBOX */
#endif /* MOZ_CRASHREPORTER */
namespace {
@ -702,7 +700,7 @@ XRE_InitChildProcess(int aArgc,
OverrideDefaultLocaleIfNeeded();
#if defined(MOZ_CRASHREPORTER)
#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
#if defined(MOZ_CONTENT_SANDBOX)
AddContentSandboxLevelAnnotation();
#endif
#endif

View File

@ -1249,14 +1249,6 @@ nsresult
nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult)
{
nsCOMPtr<nsIFile> updRoot;
#if defined(MOZ_WIDGET_GONK)
nsresult rv = NS_NewNativeLocalFile(nsDependentCString("/data/local"),
true,
getter_AddRefs(updRoot));
NS_ENSURE_SUCCESS(rv, rv);
#else
nsCOMPtr<nsIFile> appFile;
bool per = false;
nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(appFile));
@ -1402,7 +1394,6 @@ nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult)
NS_ENSURE_SUCCESS(rv, rv);
#endif // XP_WIN
#endif
updRoot.forget(aResult);
return NS_OK;
}
@ -1506,9 +1497,6 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal)
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
#elif defined(MOZ_WIDGET_GONK)
rv = NS_NewNativeLocalFile(NS_LITERAL_CSTRING("/data/b2g"), true,
getter_AddRefs(localDir));
#elif defined(XP_UNIX)
const char* homeDir = getenv("HOME");
if (!homeDir || !*homeDir)