diff options
Diffstat (limited to 'toolkit/components')
29 files changed, 80 insertions, 113 deletions
diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js index ce60ab0fa..12068b548 100644 --- a/toolkit/components/alerts/resources/content/alert.js +++ b/toolkit/components/alerts/resources/content/alert.js @@ -313,6 +313,7 @@ function onAlertClick() { let alertBox = document.getElementById("alertBox"); if (alertBox.getAttribute("animate") == "true") { // Closed when the animation ends. + alertBox.style.animationDuration = ".6s"; alertBox.setAttribute("clicked", "true"); } else { window.close(); @@ -355,6 +356,7 @@ function onAlertClose() { let alertBox = document.getElementById("alertBox"); if (alertBox.getAttribute("animate") == "true") { // Closed when the animation ends. + alertBox.style.animationDuration = ".6s"; alertBox.setAttribute("closing", "true"); } else { window.close(); diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp index 22bb434a0..2c7287d8c 100644 --- a/toolkit/components/build/nsToolkitCompsModule.cpp +++ b/toolkit/components/build/nsToolkitCompsModule.cpp @@ -46,7 +46,7 @@ #include "NativeFileWatcherNotSupported.h" #endif // (XP_WIN) -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) #define MOZ_HAS_TERMINATOR #endif diff --git a/toolkit/components/captivedetect/captivedetect.js b/toolkit/components/captivedetect/captivedetect.js index 5493ecec6..0e8c75981 100644 --- a/toolkit/components/captivedetect/captivedetect.js +++ b/toolkit/components/captivedetect/captivedetect.js @@ -90,7 +90,7 @@ function LoginObserver(captivePortalDetector) { .getService(Ci.nsIHttpActivityDistributor); let urlFetcher = null; - let waitForNetworkActivity = Services.appinfo.widgetToolkit == "gonk"; + let waitForNetworkActivity = false; let pageCheckingDone = function pageCheckingDone() { if (state === LOGIN_OBSERVER_STATE_VERIFYING) { diff --git a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp b/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp index 950d3b487..7f3b8cd08 100644 --- a/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp +++ b/toolkit/components/diskspacewatcher/DiskSpaceWatcher.cpp @@ -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 } }; diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 7439d9d11..bee5bf269 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -300,12 +300,7 @@ this.DownloadIntegration = { aDownload.hasBlockedData) { return true; } -#ifdef MOZ_B2G - // On B2G we keep a few days of history. - let maxTime = Date.now() - - Services.prefs.getIntPref("dom.downloads.max_retention_days") * 24 * 60 * 60 * 1000; - return aDownload.startTime > maxTime; -#elif defined(MOZ_WIDGET_ANDROID) +#if defined(MOZ_WIDGET_ANDROID) // On Android we store all history. return true; #else @@ -415,8 +410,6 @@ this.DownloadIntegration = { directoryPath = yield this.getPreferredDownloadsDirectory(); #elifdef MOZ_WIDGET_ANDROID directoryPath = yield this.getSystemDownloadsDirectory(); -#elifdef MOZ_WIDGET_GONK - directoryPath = yield this.getSystemDownloadsDirectory(); #else directoryPath = this._getDirectory("TmpD"); #endif diff --git a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp index 1506b7c30..d91124ee6 100644 --- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp +++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp @@ -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))) { diff --git a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm index f5102b4a8..5bd351ee9 100644 --- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm +++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm @@ -106,12 +106,7 @@ XPCOMUtils.defineLazyGetter(DownloadUIHelper, "strings", function () { */ this.DownloadPrompter = function (aParent) { - if (AppConstants.MOZ_B2G) { - // On B2G there is no prompter implementation. - this._prompter = null; - } else { - this._prompter = Services.ww.getNewPrompter(aParent); - } + this._prompter = Services.ww.getNewPrompter(aParent); } this.DownloadPrompter.prototype = { diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build index 5dba09a32..e0b412428 100644 --- a/toolkit/components/moz.build +++ b/toolkit/components/moz.build @@ -70,8 +70,7 @@ DIRS += [ if CONFIG['MOZ_WEBEXTENSIONS']: DIRS += ['webextensions'] -if CONFIG['ENABLE_INTL_API']: - DIRS += ['mozintl'] +DIRS += ['mozintl'] if not CONFIG['MOZ_FENNEC']: DIRS += ['narrate', 'viewsource']; diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 181471cd8..964e53084 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -753,13 +753,13 @@ File.prototype = { }; -if (SharedAll.Constants.Sys.Name != "Android" && SharedAll.Constants.Sys.Name != "Gonk") { +if (SharedAll.Constants.Sys.Name != "Android") { /** * Set the last access and modification date of the file. * The time stamp resolution is 1 second at best, but might be worse * depending on the platform. * - * WARNING: This method is not implemented on Android/B2G. On Android/B2G, + * WARNING: This method is not implemented on Android. On Android, * you should use File.setDates instead. * * @return {promise} diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm index 19a27ae1a..bd60d4d84 100644 --- a/toolkit/components/osfile/modules/osfile_unix_front.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm @@ -838,7 +838,7 @@ * implementation. */ File.DirectoryIterator.Entry.toMsg = function toMsg(value) { - if (!value instanceof File.DirectoryIterator.Entry) { + if (!(value instanceof File.DirectoryIterator.Entry)) { throw new TypeError("parameter of " + "File.DirectoryIterator.Entry.toMsg must be a " + "File.DirectoryIterator.Entry"); @@ -905,7 +905,7 @@ * is asymmetric and returns an object with a different implementation. */ File.Info.toMsg = function toMsg(stat) { - if (!stat instanceof File.Info) { + if (!(stat instanceof File.Info)) { throw new TypeError("parameter of File.Info.toMsg must be a File.Info"); } let serialized = {}; diff --git a/toolkit/components/osfile/modules/osfile_win_front.jsm b/toolkit/components/osfile/modules/osfile_win_front.jsm index 387dd08b5..1123b251c 100644 --- a/toolkit/components/osfile/modules/osfile_win_front.jsm +++ b/toolkit/components/osfile/modules/osfile_win_front.jsm @@ -909,7 +909,7 @@ * implementation. */ File.DirectoryIterator.Entry.toMsg = function toMsg(value) { - if (!value instanceof File.DirectoryIterator.Entry) { + if (!(value instanceof File.DirectoryIterator.Entry)) { throw new TypeError("parameter of " + "File.DirectoryIterator.Entry.toMsg must be a " + "File.DirectoryIterator.Entry"); @@ -958,7 +958,7 @@ * is asymmetric and returns an object with a different implementation. */ File.Info.toMsg = function toMsg(stat) { - if (!stat instanceof File.Info) { + if (!(stat instanceof File.Info)) { throw new TypeError("parameter of File.Info.toMsg must be a File.Info"); } let serialized = {}; diff --git a/toolkit/components/osfile/tests/xpcshell/test_constants.js b/toolkit/components/osfile/tests/xpcshell/test_constants.js index e92f33ab8..5b91484bd 100644 --- a/toolkit/components/osfile/tests/xpcshell/test_constants.js +++ b/toolkit/components/osfile/tests/xpcshell/test_constants.js @@ -15,12 +15,7 @@ add_task(function* check_definition() { do_check_true(OS.Constants.Path!=null); do_check_true(OS.Constants.Sys!=null); //check system name - if (OS.Constants.Sys.Name == "Gonk") { - // Services.appinfo.OS doesn't know the difference between Gonk and Android - do_check_eq(Services.appinfo.OS, "Android"); - } else { - do_check_eq(Services.appinfo.OS, OS.Constants.Sys.Name); - } + do_check_eq(Services.appinfo.OS, OS.Constants.Sys.Name); //check if using DEBUG build if (Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).isDebugBuild == true) { diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js index 17d3afa7c..6a5ecd5e3 100644 --- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js +++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js @@ -96,8 +96,8 @@ add_task(function* test_nonproto() { // Prototypical tests, operating on |File| handles. add_task(function* test_proto() { - if (OS.Constants.Sys.Name == "Android" || OS.Constants.Sys.Name == "Gonk") { - do_print("File.prototype.setDates is not implemented for Android/B2G"); + if (OS.Constants.Sys.Name == "Android") { + do_print("File.prototype.setDates is not implemented for Android"); do_check_eq(OS.File.prototype.setDates, undefined); return; } @@ -107,7 +107,7 @@ add_task(function* test_proto() { "test_osfile_async_setDates_proto.tmp"); yield OS.File.writeAtomic(path, new Uint8Array(1)); - try { + try { let fd = yield OS.File.open(path, {write: true}); try { diff --git a/toolkit/components/osfile/tests/xpcshell/test_path_constants.js b/toolkit/components/osfile/tests/xpcshell/test_path_constants.js index c0057c750..9b9868bb2 100644 --- a/toolkit/components/osfile/tests/xpcshell/test_path_constants.js +++ b/toolkit/components/osfile/tests/xpcshell/test_path_constants.js @@ -58,7 +58,7 @@ add_task(function* test_simple_paths() { // Test presence of paths that only exist on Desktop platforms add_task(function* test_desktop_paths() { - if (OS.Constants.Sys.Name == "Android" || OS.Constants.Sys.Name == "Gonk") { + if (OS.Constants.Sys.Name == "Android") { return; } do_check_true(!!OS.Constants.Path.desktopDir); diff --git a/toolkit/components/printing/tests/browser.ini b/toolkit/components/printing/tests/browser.ini index 88d6bb454..5f2867189 100644 --- a/toolkit/components/printing/tests/browser.ini +++ b/toolkit/components/printing/tests/browser.ini @@ -1,2 +1,5 @@ [browser_page_change_print_original.js] +support-files = + file_page_change_print_original_1.html + file_page_change_print_original_2.html skip-if = os == "mac" diff --git a/toolkit/components/printing/tests/browser_page_change_print_original.js b/toolkit/components/printing/tests/browser_page_change_print_original.js index 5990a486b..864150451 100644 --- a/toolkit/components/printing/tests/browser_page_change_print_original.js +++ b/toolkit/components/printing/tests/browser_page_change_print_original.js @@ -3,8 +3,11 @@ * and we re-initialize print preview (e.g. by changing page orientation), * we still show (and will therefore print) the original contents. */ +const TEST_PATH = getRootDirectory(gTestPath) + .replace("chrome://mochitests/content", "http://example.com"); + add_task(function* pp_after_orientation_change() { - const DATA_URI = `data:text/html,<script>window.onafterprint = function() { setTimeout("window.location = 'data:text/plain,REPLACED PAGE!'", 0); }</script><pre>INITIAL PAGE</pre>`; + const URI = TEST_PATH + "file_page_change_print_original_1.html"; // Can only do something if we have a print preview UI: if (AppConstants.platform != "win" && AppConstants.platform != "linux") { ok(true, "Can't test if there's no print preview."); @@ -12,7 +15,7 @@ add_task(function* pp_after_orientation_change() { } // Ensure we get a browserStopped for this browser - let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, DATA_URI, false, true); + let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, URI, false, true); let browserToPrint = tab.linkedBrowser; let ppBrowser = PrintPreviewListener.getPrintPreviewBrowser(); @@ -26,7 +29,7 @@ add_task(function* pp_after_orientation_change() { // Assert that we are showing the original page yield ContentTask.spawn(ppBrowser, null, function* () { - is(content.document.body.textContent, "INITIAL PAGE", "Should have initial page print previewed."); + is(content.document.body.textContent.trim(), "INITIAL PAGE", "Should have initial page print previewed."); }); yield originalTabNavigated; @@ -43,12 +46,12 @@ add_task(function* pp_after_orientation_change() { // Check that we're still showing the original page. yield ContentTask.spawn(ppBrowser, null, function* () { - is(content.document.body.textContent, "INITIAL PAGE", "Should still have initial page print previewed."); + is(content.document.body.textContent.trim(), "INITIAL PAGE", "Should still have initial page print previewed."); }); // Check that the other tab is definitely showing the new page: yield ContentTask.spawn(browserToPrint, null, function* () { - is(content.document.body.textContent, "REPLACED PAGE!", "Original page should have changed."); + is(content.document.body.textContent.trim(), "REPLACED PAGE!", "Original page should have changed."); }); PrintUtils.exitPrintPreview(); diff --git a/toolkit/components/printing/tests/file_page_change_print_original_1.html b/toolkit/components/printing/tests/file_page_change_print_original_1.html new file mode 100644 index 000000000..76e3be137 --- /dev/null +++ b/toolkit/components/printing/tests/file_page_change_print_original_1.html @@ -0,0 +1,8 @@ +<script> +window.onafterprint = function() { + setTimeout(function() { + window.location = "file_page_change_print_original_2.html" + }, 0); +} +</script> +<pre>INITIAL PAGE</pre> diff --git a/toolkit/components/printing/tests/file_page_change_print_original_2.html b/toolkit/components/printing/tests/file_page_change_print_original_2.html new file mode 100644 index 000000000..44f33281c --- /dev/null +++ b/toolkit/components/printing/tests/file_page_change_print_original_2.html @@ -0,0 +1 @@ +REPLACED PAGE! diff --git a/toolkit/components/reader/.eslintrc.js b/toolkit/components/reader/.eslintrc.js index 1c09e0bf7..617c1f9cf 100644 --- a/toolkit/components/reader/.eslintrc.js +++ b/toolkit/components/reader/.eslintrc.js @@ -109,9 +109,6 @@ module.exports = { // No reassigning native JS objects "no-native-reassign": "error", - // No (!foo in bar) - "no-negated-in-lhs": "error", - // Nested ternary statements are confusing "no-nested-ternary": "error", diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index fb3f69f4c..9f9003516 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", - "resource://gre/modules/Deprecated.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData", "resource://gre/modules/SearchStaticData.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", @@ -2695,13 +2693,6 @@ SearchService.prototype = { return; } - let warning = - "Search service falling back to synchronous initialization. " + - "This is generally the consequence of an add-on using a deprecated " + - "search service API."; - Deprecated.warning(warning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"); - LOG(warning); - this._syncInit(); if (!Components.isSuccessCode(this._initRV)) { throw this._initRV; diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 85d5afdf9..fde00d1db 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -237,7 +237,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 @@ -252,7 +252,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 diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index ad2263c9b..6dbd59bcf 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -1127,7 +1127,7 @@ TelemetryImpl::SnapshotSubsessionHistograms(bool clearSubsession, JSContext *cx, JS::MutableHandle<JS::Value> ret) { -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) return TelemetryHistogram::CreateHistogramSnapshots(cx, ret, true, clearSubsession); #else diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 910d804ae..295679ca4 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -28,11 +28,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "AttributionCode", "resource:///modules/AttributionCode.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ctypes", "resource://gre/modules/ctypes.jsm"); -if (AppConstants.platform !== "gonk") { - Cu.import("resource://gre/modules/AddonManager.jsm"); - XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager", - "resource://gre/modules/LightweightThemeManager.jsm"); -} +Cu.import("resource://gre/modules/AddonManager.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager", + "resource://gre/modules/LightweightThemeManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge", "resource://gre/modules/ProfileAge.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", @@ -528,11 +526,9 @@ EnvironmentAddonBuilder.prototype = { _updateAddons: Task.async(function* () { this._environment._log.trace("_updateAddons"); let personaId = null; - if (AppConstants.platform !== "gonk") { - let theme = LightweightThemeManager.currentTheme; - if (theme) { - personaId = theme.id; - } + let theme = LightweightThemeManager.currentTheme; + if (theme) { + personaId = theme.id; } let addons = { @@ -745,14 +741,8 @@ function EnvironmentCache() { // until the initial environment has been built. let p = []; - if (AppConstants.platform === "gonk") { - this._addonBuilder = { - watchForChanges: function() {} - }; - } else { - this._addonBuilder = new EnvironmentAddonBuilder(this); - p = [ this._addonBuilder.init() ]; - } + this._addonBuilder = new EnvironmentAddonBuilder(this); + p = [ this._addonBuilder.init() ]; this._currentEnvironment.profile = {}; p.push(this._updateProfile()); @@ -1079,10 +1069,6 @@ EnvironmentCache.prototype = { * @returns null on error, true if we are the default browser, or false otherwise. */ _isDefaultBrowser: function () { - if (AppConstants.platform === "gonk") { - return true; - } - if (!("@mozilla.org/browser/shell-service;1" in Cc)) { this._log.info("_isDefaultBrowser - Could not obtain browser shell service"); return null; @@ -1139,10 +1125,8 @@ EnvironmentCache.prototype = { userPrefs: this._getPrefData(), }; - if (AppConstants.platform !== "gonk") { - this._currentEnvironment.settings.addonCompatibilityCheckEnabled = - AddonManager.checkCompatibility; - } + this._currentEnvironment.settings.addonCompatibilityCheckEnabled = + AddonManager.checkCompatibility; if (AppConstants.platform !== "android") { this._currentEnvironment.settings.isDefaultBrowser = @@ -1246,7 +1230,7 @@ EnvironmentCache.prototype = { * not a portable device. */ _getDeviceData: function () { - if (!["gonk", "android"].includes(AppConstants.platform)) { + if (!["android"].includes(AppConstants.platform)) { return null; } @@ -1269,7 +1253,7 @@ EnvironmentCache.prototype = { locale: forceToStringOrNull(getSystemLocale()), }; - if (["gonk", "android"].includes(AppConstants.platform)) { + if (["android"].includes(AppConstants.platform)) { data.kernelVersion = forceToStringOrNull(getSysinfoProperty("kernel_version", null)); } else if (AppConstants.platform === "win") { // The path to the "UBR" key, queried to get additional version details on Windows. @@ -1333,7 +1317,7 @@ EnvironmentCache.prototype = { features: {}, }; - if (!["gonk", "android", "linux"].includes(AppConstants.platform)) { + if (!["android", "linux"].includes(AppConstants.platform)) { let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo); try { gfxData.monitors = gfxInfo.getMonitors(); @@ -1398,7 +1382,7 @@ EnvironmentCache.prototype = { if (AppConstants.platform === "win") { data.isWow64 = getSysinfoProperty("isWow64", null); - } else if (["gonk", "android"].includes(AppConstants.platform)) { + } else if (["android"].includes(AppConstants.platform)) { data.device = this._getDeviceData(); } diff --git a/toolkit/components/telemetry/TelemetryHistogram.cpp b/toolkit/components/telemetry/TelemetryHistogram.cpp index abae9c613..ba0288979 100644 --- a/toolkit/components/telemetry/TelemetryHistogram.cpp +++ b/toolkit/components/telemetry/TelemetryHistogram.cpp @@ -583,7 +583,7 @@ internal_GetHistogramByName(const nsACString &name, Histogram **ret) } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) /** * This clones a histogram |existing| with the id |existingId| to a @@ -684,7 +684,7 @@ internal_HistogramAdd(Histogram& histogram, int32_t value, uint32_t dataset) return NS_OK; } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (Histogram* subsession = internal_GetSubsessionHistogram(histogram)) { subsession->Add(value); } @@ -729,7 +729,7 @@ internal_HistogramClear(Histogram& aHistogram, bool onlySubsession) aHistogram.Clear(); } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (Histogram* subsession = internal_GetSubsessionHistogram(aHistogram)) { subsession->Clear(); } @@ -926,7 +926,7 @@ private: typedef nsBaseHashtableET<nsCStringHashKey, Histogram*> KeyedHistogramEntry; typedef AutoHashtable<KeyedHistogramEntry> KeyedHistogramMapType; KeyedHistogramMapType mHistogramMap; -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) KeyedHistogramMapType mSubsessionMap; #endif @@ -950,7 +950,7 @@ KeyedHistogram::KeyedHistogram(const nsACString &name, uint32_t min, uint32_t max, uint32_t bucketCount, uint32_t dataset) : mHistogramMap() -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) , mSubsessionMap() #endif , mName(name) @@ -968,7 +968,7 @@ nsresult KeyedHistogram::GetHistogram(const nsCString& key, Histogram** histogram, bool subsession) { -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap; #else KeyedHistogramMapType& map = mHistogramMap; @@ -980,7 +980,7 @@ KeyedHistogram::GetHistogram(const nsCString& key, Histogram** histogram, } nsCString histogramName; -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (subsession) { histogramName.AppendLiteral(SUBSESSION_HISTOGRAM_PREFIX); } @@ -1042,7 +1042,7 @@ KeyedHistogram::Add(const nsCString& key, uint32_t sample) if (!histogram) { return NS_ERROR_FAILURE; } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) Histogram* subsession = GetHistogram(key, true); MOZ_ASSERT(subsession); if (!subsession) { @@ -1055,7 +1055,7 @@ KeyedHistogram::Add(const nsCString& key, uint32_t sample) } histogram->Add(sample); -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) subsession->Add(sample); #endif return NS_OK; @@ -1068,7 +1068,7 @@ KeyedHistogram::Clear(bool onlySubsession) if (!XRE_IsParentProcess()) { return; } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) for (auto iter = mSubsessionMap.Iter(); !iter.Done(); iter.Next()) { iter.Get()->mData->Clear(); } @@ -1137,7 +1137,7 @@ nsresult KeyedHistogram::GetJSSnapshot(JSContext* cx, JS::Handle<JSObject*> obj, bool subsession, bool clearSubsession) { -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) KeyedHistogramMapType& map = subsession ? mSubsessionMap : mHistogramMap; #else KeyedHistogramMapType& map = mHistogramMap; @@ -1146,7 +1146,7 @@ KeyedHistogram::GetJSSnapshot(JSContext* cx, JS::Handle<JSObject*> obj, return NS_ERROR_FAILURE; } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (subsession && clearSubsession) { Clear(true); } @@ -1637,7 +1637,7 @@ internal_JSHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp) } bool onlySubsession = false; -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (args.length() >= 1) { @@ -1874,7 +1874,7 @@ internal_JSKeyedHistogram_Snapshot(JSContext *cx, unsigned argc, JS::Value *vp) return internal_KeyedHistogram_SnapshotImpl(cx, argc, vp, false, false); } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) bool internal_JSKeyedHistogram_SubsessionSnapshot(JSContext *cx, unsigned argc, JS::Value *vp) @@ -1883,7 +1883,7 @@ internal_JSKeyedHistogram_SubsessionSnapshot(JSContext *cx, } #endif -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) bool internal_JSKeyedHistogram_SnapshotSubsessionAndClear(JSContext *cx, unsigned argc, @@ -1911,7 +1911,7 @@ internal_JSKeyedHistogram_Clear(JSContext *cx, unsigned argc, JS::Value *vp) return false; } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) bool onlySubsession = false; JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -1974,7 +1974,7 @@ internal_WrapAndReturnKeyedHistogram(KeyedHistogram *h, JSContext *cx, if (!(JS_DefineFunction(cx, obj, "add", internal_JSKeyedHistogram_Add, 2, 0) && JS_DefineFunction(cx, obj, "snapshot", internal_JSKeyedHistogram_Snapshot, 1, 0) -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) && JS_DefineFunction(cx, obj, "subsessionSnapshot", internal_JSKeyedHistogram_SubsessionSnapshot, 1, 0) && JS_DefineFunction(cx, obj, "snapshotSubsessionAndClear", @@ -2425,7 +2425,7 @@ TelemetryHistogram::CreateHistogramSnapshots(JSContext *cx, } Histogram* original = h; -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (subsession) { h = internal_GetSubsessionHistogram(*h); if (!h) { @@ -2453,7 +2453,7 @@ TelemetryHistogram::CreateHistogramSnapshots(JSContext *cx, } } -#if !defined(MOZ_WIDGET_GONK) && !defined(MOZ_WIDGET_ANDROID) +#if !defined(MOZ_WIDGET_ANDROID) if (subsession && clearSubsession) { h->Clear(); } diff --git a/toolkit/components/telemetry/TelemetrySession.jsm b/toolkit/components/telemetry/TelemetrySession.jsm index 3d97dc155..179e6436a 100644 --- a/toolkit/components/telemetry/TelemetrySession.jsm +++ b/toolkit/components/telemetry/TelemetrySession.jsm @@ -1372,7 +1372,7 @@ var Impl = { let payload; try { - const isMobile = ["gonk", "android"].includes(AppConstants.platform); + const isMobile = ["android"].includes(AppConstants.platform); const isSubsession = isMobile ? false : !this._isClassicReason(reason); if (isMobile) { diff --git a/toolkit/components/telemetry/TelemetryStorage.jsm b/toolkit/components/telemetry/TelemetryStorage.jsm index 91cfc993d..c844aacf0 100644 --- a/toolkit/components/telemetry/TelemetryStorage.jsm +++ b/toolkit/components/telemetry/TelemetryStorage.jsm @@ -106,7 +106,7 @@ PingParseError.prototype.constructor = PingParseError; var Policy = { now: () => new Date(), getArchiveQuota: () => ARCHIVE_QUOTA_BYTES, - getPendingPingsQuota: () => (AppConstants.platform in ["android", "gonk"]) + getPendingPingsQuota: () => (AppConstants.platform in ["android"]) ? PENDING_PINGS_QUOTA_BYTES_MOBILE : PENDING_PINGS_QUOTA_BYTES_DESKTOP, }; diff --git a/toolkit/components/telemetry/tests/unit/head.js b/toolkit/components/telemetry/tests/unit/head.js index 51be25766..87afd3617 100644 --- a/toolkit/components/telemetry/tests/unit/head.js +++ b/toolkit/components/telemetry/tests/unit/head.js @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", const gIsWindows = AppConstants.platform == "win"; const gIsMac = AppConstants.platform == "macosx"; const gIsAndroid = AppConstants.platform == "android"; -const gIsGonk = AppConstants.platform == "gonk"; +const gIsGonk = false; const gIsLinux = AppConstants.platform == "linux"; const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry); diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js index fa1dd19f1..70d23eaa4 100644 --- a/toolkit/components/viewsource/content/viewSource-content.js +++ b/toolkit/components/viewsource/content/viewSource-content.js @@ -330,6 +330,8 @@ var ViewSourceContent = { .createInstance(Ci.nsISHEntry); shEntry.setURI(BrowserUtils.makeURI(viewSrcURL, null, null)); shEntry.setTitle(viewSrcURL); + let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal(); + shEntry.triggeringPrincipal = systemPrincipal; shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory; shEntry.cacheKey = shEntrySource.cacheKey; docShell.QueryInterface(Ci.nsIWebNavigation) diff --git a/toolkit/components/webextensions/.eslintrc.js b/toolkit/components/webextensions/.eslintrc.js index 70196fc6a..70f91ab6d 100644 --- a/toolkit/components/webextensions/.eslintrc.js +++ b/toolkit/components/webextensions/.eslintrc.js @@ -173,9 +173,6 @@ module.exports = { // eslint-disable-line no-undef // No reassigning native JS objects "no-native-reassign": "error", - // No (!foo in bar) - "no-negated-in-lhs": "error", - // Nested ternary statements are confusing "no-nested-ternary": "error", |