Skip to content

Commit

Permalink
Bug 1382099 - Remove MOZ_WIDGET_GONK from toolkit/. r=glandium.
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 709744b24104b463c8dc4cbe215d2250e7c1a9f5
  • Loading branch information
nnethercote committed Jul 19, 2017
1 parent 537fa49 commit 20df43a
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 107 deletions.
2 changes: 1 addition & 1 deletion toolkit/components/build/nsToolkitCompsModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
};

Expand Down
2 changes: 0 additions & 2 deletions toolkit/components/jsdownloads/src/DownloadIntegration.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/jsdownloads/src/DownloadPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
4 changes: 2 additions & 2 deletions toolkit/components/startup/nsAppStartup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions toolkit/components/windowwatcher/nsWindowWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
9 changes: 2 additions & 7 deletions toolkit/crashreporter/nsExceptionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions toolkit/modules/AppConstants.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ this.AppConstants = Object.freeze({
"macosx",
#elif MOZ_WIDGET_ANDROID
"android",
#elif MOZ_WIDGET_GONK
"gonk",
#elif XP_LINUX
"linux",
#else
Expand Down
25 changes: 0 additions & 25 deletions toolkit/profile/nsProfileLock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#include "mozilla/Printf.h"
#endif

#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_CRASHREPORTER)
#include <sys/syscall.h>
#endif

// **********************************************************************
// class nsProfileLock
//
Expand Down Expand Up @@ -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);
}
Expand Down
33 changes: 0 additions & 33 deletions toolkit/xre/EventTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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()) {
Expand Down
14 changes: 7 additions & 7 deletions toolkit/xre/nsAppRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */

/*
Expand Down Expand Up @@ -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();
Expand All @@ -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 */

{
Expand Down
8 changes: 3 additions & 5 deletions toolkit/xre/nsEmbedFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
{
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions toolkit/xre/nsXREDirProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -1402,7 +1394,6 @@ nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult)
NS_ENSURE_SUCCESS(rv, rv);

#endif // XP_WIN
#endif
updRoot.forget(aResult);
return NS_OK;
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 20df43a

Please sign in to comment.