Bug 1335008 - Part 1 - Move PrivacyLevel.jsm to toolkit. r=mikedeboer
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 31 Jan 2017 23:05:31 +0100
changeset 379055 87450805b650f9a39a7be2d62cbf1582f00ec3a6
parent 379054 501dcb605fee1ad794f8a3545119d98fe4602ff4
child 379056 d5bf5497ac1626fe0c2c71c6fef041f230152a0c
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1335008
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1335008 - Part 1 - Move PrivacyLevel.jsm to toolkit. r=mikedeboer ... so we can use it on Android, too. Also fix ESLint errors that are appearing at the new file location. MozReview-Commit-ID: 3A3aoHm00RJ
browser/components/sessionstore/PrivacyFilter.jsm
browser/components/sessionstore/PrivacyLevel.jsm
browser/components/sessionstore/SessionCookies.jsm
browser/components/sessionstore/moz.build
toolkit/modules/moz.build
toolkit/modules/sessionstore/PrivacyLevel.jsm
--- a/browser/components/sessionstore/PrivacyFilter.jsm
+++ b/browser/components/sessionstore/PrivacyFilter.jsm
@@ -6,17 +6,17 @@
 
 this.EXPORTED_SYMBOLS = ["PrivacyFilter"];
 
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivacyLevel",
-  "resource:///modules/sessionstore/PrivacyLevel.jsm");
+  "resource://gre/modules/sessionstore/PrivacyLevel.jsm");
 
 /**
  * A module that provides methods to filter various kinds of data collected
  * from a tab by the current privacy level as set by the user.
  */
 this.PrivacyFilter = Object.freeze({
   /**
    * Filters the given (serialized) session storage |data| according to the
--- a/browser/components/sessionstore/SessionCookies.jsm
+++ b/browser/components/sessionstore/SessionCookies.jsm
@@ -10,17 +10,17 @@ const Cu = Components.utils;
 const Ci = Components.interfaces;
 
 Cu.import("resource://gre/modules/Services.jsm", this);
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 XPCOMUtils.defineLazyModuleGetter(this, "Utils",
   "resource://gre/modules/sessionstore/Utils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivacyLevel",
-  "resource:///modules/sessionstore/PrivacyLevel.jsm");
+  "resource://gre/modules/sessionstore/PrivacyLevel.jsm");
 
 // MAX_EXPIRY should be 2^63-1, but JavaScript can't handle that precision.
 const MAX_EXPIRY = Math.pow(2, 62);
 
 /**
  * The external API implemented by the SessionCookies module.
  */
 this.SessionCookies = Object.freeze({
--- a/browser/components/sessionstore/moz.build
+++ b/browser/components/sessionstore/moz.build
@@ -24,17 +24,16 @@ EXTRA_COMPONENTS += [
 
 EXTRA_JS_MODULES.sessionstore = [
     'ContentRestore.jsm',
     'DocShellCapabilities.jsm',
     'FrameTree.jsm',
     'GlobalState.jsm',
     'PageStyle.jsm',
     'PrivacyFilter.jsm',
-    'PrivacyLevel.jsm',
     'RecentlyClosedTabsAndWindowsMenuUtils.jsm',
     'RunState.jsm',
     'SessionCookies.jsm',
     'SessionFile.jsm',
     'SessionHistory.jsm',
     'SessionMigration.jsm',
     'SessionSaver.jsm',
     'SessionStorage.jsm',
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -96,17 +96,20 @@ EXTRA_JS_MODULES += [
     'Timer.jsm',
     'Troubleshoot.jsm',
     'UpdateUtils.jsm',
     'WebChannel.jsm',
     'WindowDraggingUtils.jsm',
     'ZipUtils.jsm',
 ]
 EXTRA_JS_MODULES.third_party.jsesc += ['third_party/jsesc/jsesc.js']
-EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
+EXTRA_JS_MODULES.sessionstore += [
+    'sessionstore/PrivacyLevel.jsm',
+    'sessionstore/Utils.jsm',
+]
 
 DEFINES['INSTALL_COMPACT_THEMES'] = 1
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
     DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
     DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
 
rename from browser/components/sessionstore/PrivacyLevel.jsm
rename to toolkit/modules/sessionstore/PrivacyLevel.jsm
--- a/browser/components/sessionstore/PrivacyLevel.jsm
+++ b/toolkit/modules/sessionstore/PrivacyLevel.jsm
@@ -29,29 +29,29 @@ const PRIVACY_FULL = 2;
 var PrivacyLevel = Object.freeze({
   /**
    * Returns whether the current privacy level allows saving data for the given
    * |url|.
    *
    * @param url The URL we want to save data for.
    * @return bool
    */
-  check: function (url) {
+  check(url) {
     return PrivacyLevel.canSave({ isHttps: url.startsWith("https:") });
   },
 
   /**
    * Checks whether we're allowed to save data for a specific site.
    *
    * @param {isHttps: boolean}
    *        An object that must have one property: 'isHttps'.
    *        'isHttps' tells whether the site us secure communication (HTTPS).
    * @return {bool} Whether we can save data for the specified site.
    */
-  canSave: function ({isHttps}) {
+  canSave({isHttps}) {
     let level = Services.prefs.getIntPref(PREF);
 
     // Never save any data when full privacy is requested.
     if (level == PRIVACY_FULL) {
       return false;
     }
 
     // Don't save data for encrypted sites when requested.