Port 1539595 - Rename Priveleged Content Process to PrivlegedAbout Content Process r=mconley,flod (#5079)

This commit is contained in:
Ed Lee 2019-05-29 11:36:04 -07:00 коммит произвёл GitHub
Родитель 301de8aab6
Коммит d46dc3268c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -26,18 +26,18 @@ const BASE_URL = "resource://activity-stream/";
const ACTIVITY_STREAM_PAGES = new Set(["home", "newtab", "welcome"]); const ACTIVITY_STREAM_PAGES = new Set(["home", "newtab", "welcome"]);
const IS_MAIN_PROCESS = Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT; const IS_MAIN_PROCESS = Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT;
const IS_PRIVILEGED_PROCESS = Services.appinfo.remoteType === E10SUtils.PRIVILEGED_REMOTE_TYPE; const IS_PRIVILEGED_PROCESS = Services.appinfo.remoteType === E10SUtils.PRIVILEGEDABOUT_REMOTE_TYPE;
const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA; const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA;
const PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS = "browser.tabs.remote.separatePrivilegedContentProcess"; const PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS = "browser.tabs.remote.separatePrivilegedContentProcess";
const PREF_ACTIVITY_STREAM_PRERENDER_ENABLED = "browser.newtabpage.activity-stream.prerender"; const PREF_ACTIVITY_STREAM_PRERENDER_ENABLED = "browser.newtabpage.activity-stream.prerender";
const PREF_ACTIVITY_STREAM_DEBUG = "browser.newtabpage.activity-stream.debug"; const PREF_ACTIVITY_STREAM_DEBUG = "browser.newtabpage.activity-stream.debug";
function AboutNewTabService() { function AboutNewTabService() {
Services.obs.addObserver(this, TOPIC_APP_QUIT); Services.obs.addObserver(this, TOPIC_APP_QUIT);
Services.obs.addObserver(this, TOPIC_LOCALES_CHANGE); Services.obs.addObserver(this, TOPIC_LOCALES_CHANGE);
Services.prefs.addObserver(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS, this); Services.prefs.addObserver(PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS, this);
Services.prefs.addObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this); Services.prefs.addObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this);
if (!IS_RELEASE_OR_BETA) { if (!IS_RELEASE_OR_BETA) {
Services.prefs.addObserver(PREF_ACTIVITY_STREAM_DEBUG, this); Services.prefs.addObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
@ -93,7 +93,7 @@ AboutNewTabService.prototype = {
_activityStreamPrerender: false, _activityStreamPrerender: false,
_activityStreamPath: "", _activityStreamPath: "",
_activityStreamDebug: false, _activityStreamDebug: false,
_privilegedContentProcess: false, _privilegedAboutContentProcess: false,
_overridden: false, _overridden: false,
willNotifyUser: false, willNotifyUser: false,
@ -106,8 +106,8 @@ AboutNewTabService.prototype = {
observe(subject, topic, data) { observe(subject, topic, data) {
switch (topic) { switch (topic) {
case "nsPref:changed": case "nsPref:changed":
if (data === PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS) { if (data === PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS) {
this._privilegedContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS); this._privilegedAboutContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS);
this.updatePrerenderedPath(); this.updatePrerenderedPath();
this.notifyChange(); this.notifyChange();
} else if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) { } else if (data === PREF_ACTIVITY_STREAM_PRERENDER_ENABLED) {
@ -216,7 +216,7 @@ AboutNewTabService.prototype = {
} else { } else {
this._activityStreamEnabled = false; this._activityStreamEnabled = false;
} }
this._privilegedContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS); this._privilegedAboutContentProcess = Services.prefs.getBoolPref(PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS);
this._activityStreamPrerender = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED); this._activityStreamPrerender = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED);
if (!IS_RELEASE_OR_BETA) { if (!IS_RELEASE_OR_BETA) {
this._activityStreamDebug = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_DEBUG, false); this._activityStreamDebug = Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_DEBUG, false);
@ -233,7 +233,7 @@ AboutNewTabService.prototype = {
// Debug files are specially packaged in a non-localized directory, but with // Debug files are specially packaged in a non-localized directory, but with
// dynamic script loading, localized debug is supported. // dynamic script loading, localized debug is supported.
this._activityStreamPath = `${this._activityStreamDebug && this._activityStreamPath = `${this._activityStreamDebug &&
!this._privilegedContentProcess ? "static" : this.activityStreamLocale}/`; !this._privilegedAboutContentProcess ? "static" : this.activityStreamLocale}/`;
}, },
/* /*
@ -253,8 +253,8 @@ AboutNewTabService.prototype = {
"activity-stream", "activity-stream",
this._activityStreamPrerender ? "-prerendered" : "", this._activityStreamPrerender ? "-prerendered" : "",
// Debug version loads dev scripts but noscripts separately loads scripts // Debug version loads dev scripts but noscripts separately loads scripts
this._activityStreamDebug && !this._privilegedContentProcess ? "-debug" : "", this._activityStreamDebug && !this._privilegedAboutContentProcess ? "-debug" : "",
this._privilegedContentProcess ? "-noscripts" : "", this._privilegedAboutContentProcess ? "-noscripts" : "",
".html", ".html",
].join(""); ].join("");
}, },
@ -351,7 +351,7 @@ AboutNewTabService.prototype = {
} }
Services.obs.removeObserver(this, TOPIC_APP_QUIT); Services.obs.removeObserver(this, TOPIC_APP_QUIT);
Services.obs.removeObserver(this, TOPIC_LOCALES_CHANGE); Services.obs.removeObserver(this, TOPIC_LOCALES_CHANGE);
Services.prefs.removeObserver(PREF_SEPARATE_PRIVILEGED_CONTENT_PROCESS, this); Services.prefs.removeObserver(PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS, this);
Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this); Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_PRERENDER_ENABLED, this);
if (!IS_RELEASE_OR_BETA) { if (!IS_RELEASE_OR_BETA) {
Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this); Services.prefs.removeObserver(PREF_ACTIVITY_STREAM_DEBUG, this);