Bug 1472212 - Expose the pref variable for browser.tabs.remote.separatePrivilegedContentProcess in AboutNewTabService over XPCOM for tests. draft
authorimjching <jlim@mozilla.com>
Thu, 12 Jul 2018 10:55:04 -0400
changeset 821498 bb68a583040d7d23d23ef6bd9b676e12ef77ca5b
parent 821497 3a6632de0fba1bc632c407efc2e3e73d3b0ec039
child 821499 7dd8b26bd37fc767ebfea17af37ebc8a7da9f9cf
push id117115
push userbmo:jlim@mozilla.com
push dateMon, 23 Jul 2018 13:52:58 +0000
bugs1472212
milestone63.0a1
Bug 1472212 - Expose the pref variable for browser.tabs.remote.separatePrivilegedContentProcess in AboutNewTabService over XPCOM for tests. MozReview-Commit-ID: JkyDcX2axga
browser/components/newtab/aboutNewTabService.js
browser/components/newtab/nsIAboutNewTabService.idl
--- a/browser/components/newtab/aboutNewTabService.js
+++ b/browser/components/newtab/aboutNewTabService.js
@@ -107,16 +107,17 @@ AboutNewTabService.prototype = {
     service: true
   }],
 
   observe(subject, topic, data) {
     switch (topic) {
       case "nsPref:changed":
         if (data === PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS) {
           this._privilegedContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS);
+          this.notifyChange();
         } else if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) {
           this._activityStreamPrerender = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED);
           this.notifyChange();
         } else if (!IS_RELEASE_OR_BETA && data === PREF_ACTIVITY_STREAM_DEBUG) {
           this._activityStreamDebug = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_DEBUG, false);
           this.updatePrerenderedPath();
           this.notifyChange();
         }
@@ -295,16 +296,20 @@ AboutNewTabService.prototype = {
   get overridden() {
     return this._overridden;
   },
 
   get activityStreamEnabled() {
     return this._activityStreamEnabled;
   },
 
+  get privilegedContentProcess() {
+    return this._privilegedContentProcess;
+  },
+
   get activityStreamPrerender() {
     return this._activityStreamPrerender;
   },
 
   get activityStreamDebug() {
     return this._activityStreamDebug;
   },
 
--- a/browser/components/newtab/nsIAboutNewTabService.idl
+++ b/browser/components/newtab/nsIAboutNewTabService.idl
@@ -40,22 +40,28 @@ interface nsIAboutNewTabService : nsISup
 
   /**
    * Returns true if the default resource is activity stream and isn't
    * overridden
    */
   readonly attribute bool activityStreamEnabled;
 
   /**
-   * Returns true if the the prerendering pref for activity stream is true
+   * Returns true if the pref to use a separate privileged content process
+   * is true
+   */
+  readonly attribute bool privilegedContentProcess;
+
+  /**
+   * Returns true if the prerendering pref for activity stream is true
    */
   readonly attribute bool activityStreamPrerender;
 
   /**
-   * Returns true if the the debug pref for activity stream is true
+   * Returns true if the debug pref for activity stream is true
    */
   readonly attribute bool activityStreamDebug;
 
   /**
    * Returns the locale of the activity stream interface
    */
   readonly attribute ACString activityStreamLocale;