Backed out changeset 28b3bd8e5018 (bug 1482809) for using the wrong author.
authorGurzau Raul <rgurzau@mozilla.com>
Tue, 30 Apr 2019 18:54:43 +0300
changeset 530795 944e6bb582152425581c9764c6ebe70fdb554968
parent 530794 05e9997b6809900677149992d3a5634ae43b3a11
child 530796 40dcf4f4a5159f4372107d32219e7351a5ebe908
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1482809
milestone68.0a1
backs out28b3bd8e50189975e21d81890ecd98e15cbf2f58
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
Backed out changeset 28b3bd8e5018 (bug 1482809) for using the wrong author.
browser/components/enterprisepolicies/EnterprisePolicies.js
browser/components/enterprisepolicies/EnterprisePolicies.manifest
browser/components/enterprisepolicies/EnterprisePoliciesContent.js
browser/components/enterprisepolicies/WindowsGPOParser.jsm
browser/components/enterprisepolicies/macOSPoliciesParser.jsm
browser/components/enterprisepolicies/moz.build
browser/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm
browser/components/enterprisepolicies/tests/browser/browser.ini
browser/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js
browser/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js
browser/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js
browser/components/enterprisepolicies/tests/browser/browser_policies_macosparser_unflatten.js
browser/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js
browser/components/enterprisepolicies/tests/browser/config_broken_json.json
browser/components/enterprisepolicies/tests/moz.build
browser/installer/package-manifest.in
netwerk/protocol/about/nsAboutProtocolHandler.cpp
toolkit/components/enterprisepolicies/EnterprisePolicies.js
toolkit/components/enterprisepolicies/EnterprisePolicies.manifest
toolkit/components/enterprisepolicies/EnterprisePoliciesContent.js
toolkit/components/enterprisepolicies/WindowsGPOParser.jsm
toolkit/components/enterprisepolicies/macOSPoliciesParser.jsm
toolkit/components/enterprisepolicies/moz.build
toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm
toolkit/components/enterprisepolicies/tests/browser/browser.ini
toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js
toolkit/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js
toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js
toolkit/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js
toolkit/components/enterprisepolicies/tests/browser/config_broken_json.json
toolkit/components/enterprisepolicies/tests/browser/head.js
toolkit/components/enterprisepolicies/tests/moz.build
toolkit/modules/Services.jsm
toolkit/modules/tests/xpcshell/test_Services.js
toolkit/xre/nsXREDirProvider.cpp
rename from toolkit/components/enterprisepolicies/EnterprisePolicies.js
rename to browser/components/enterprisepolicies/EnterprisePolicies.js
--- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js
+++ b/browser/components/enterprisepolicies/EnterprisePolicies.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-  WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.jsm",
-  macOSPoliciesParser: "resource://gre/modules/policies/macOSPoliciesParser.jsm",
+  WindowsGPOParser: "resource:///modules/policies/WindowsGPOParser.jsm",
+  macOSPoliciesParser: "resource:///modules/policies/macOSPoliciesParser.jsm",
   Policies: "resource:///modules/policies/Policies.jsm",
   JsonSchemaValidator: "resource://gre/modules/components-utils/JsonSchemaValidator.jsm",
 });
 
 // This is the file that will be searched for in the
 // ${InstallDir}/distribution folder.
 const POLICIES_FILENAME = "policies.json";
 
@@ -463,17 +463,17 @@ class WindowsGPOPoliciesProvider {
   }
 
   get failed() {
     return this._failed;
   }
 
   _readData(wrk, root) {
     wrk.open(root, "SOFTWARE\\Policies", wrk.ACCESS_READ);
-    if (wrk.hasChild("Mozilla\\" + Services.appinfo.name)) {
+    if (wrk.hasChild("Mozilla\\Firefox")) {
       this._policies = WindowsGPOParser.readPolicies(wrk, this._policies);
     }
     wrk.close();
   }
 }
 
 class macOSPoliciesProvider {
   constructor() {
rename from toolkit/components/enterprisepolicies/EnterprisePolicies.manifest
rename to browser/components/enterprisepolicies/EnterprisePolicies.manifest
--- a/toolkit/components/enterprisepolicies/EnterprisePolicies.manifest
+++ b/browser/components/enterprisepolicies/EnterprisePolicies.manifest
@@ -1,5 +1,5 @@
 component {ea4e1414-779b-458b-9d1f-d18e8efbc145} EnterprisePolicies.js process=main
-contract @mozilla.org/enterprisepolicies;1 {ea4e1414-779b-458b-9d1f-d18e8efbc145} process=main
+contract @mozilla.org/browser/enterprisepolicies;1 {ea4e1414-779b-458b-9d1f-d18e8efbc145} process=main
 
 component {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} EnterprisePoliciesContent.js process=content
-contract @mozilla.org/enterprisepolicies;1 {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} process=content
+contract @mozilla.org/browser/enterprisepolicies;1 {dc6358f8-d167-4566-bf5b-4350b5e6a7a2} process=content
rename from toolkit/components/enterprisepolicies/EnterprisePoliciesContent.js
rename to browser/components/enterprisepolicies/EnterprisePoliciesContent.js
rename from toolkit/components/enterprisepolicies/WindowsGPOParser.jsm
rename to browser/components/enterprisepolicies/WindowsGPOParser.jsm
--- a/toolkit/components/enterprisepolicies/WindowsGPOParser.jsm
+++ b/browser/components/enterprisepolicies/WindowsGPOParser.jsm
@@ -1,15 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const PREF_LOGLEVEL = "browser.policies.loglevel";
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
   return new ConsoleAPI({
     prefix: "GPOParser.jsm",
@@ -19,17 +18,17 @@ XPCOMUtils.defineLazyGetter(this, "log",
     maxLogLevelPref: PREF_LOGLEVEL,
   });
 });
 
 var EXPORTED_SYMBOLS = ["WindowsGPOParser"];
 
 var WindowsGPOParser = {
   readPolicies(wrk, policies) {
-    let childWrk = wrk.openChild("Mozilla\\" + Services.appinfo.name, wrk.ACCESS_READ);
+    let childWrk = wrk.openChild("Mozilla\\Firefox", wrk.ACCESS_READ);
     if (!policies) {
       policies = {};
     }
     try {
       policies = registryToObject(childWrk, policies);
     } catch (e) {
       log.error(e);
     } finally {
rename from toolkit/components/enterprisepolicies/macOSPoliciesParser.jsm
rename to browser/components/enterprisepolicies/macOSPoliciesParser.jsm
--- a/browser/components/enterprisepolicies/moz.build
+++ b/browser/components/enterprisepolicies/moz.build
@@ -11,15 +11,31 @@ DIRS += [
     'helpers',
     'schemas',
 ]
 
 TEST_DIRS += [
 	'tests'
 ]
 
+EXTRA_COMPONENTS += [
+    'EnterprisePolicies.js',
+    'EnterprisePolicies.manifest',
+    'EnterprisePoliciesContent.js',
+]
+
 EXTRA_JS_MODULES.policies += [
     'Policies.jsm',
 ]
 
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+    EXTRA_JS_MODULES.policies += [
+        'WindowsGPOParser.jsm',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    EXTRA_JS_MODULES.policies += [
+        'macOSPoliciesParser.jsm',
+]
+
 FINAL_LIBRARY = 'browsercomps'
 
 JAR_MANIFESTS += ['jar.mn']
rename from toolkit/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm
rename to browser/components/enterprisepolicies/tests/EnterprisePolicyTesting.jsm
--- a/browser/components/enterprisepolicies/tests/browser/browser.ini
+++ b/browser/components/enterprisepolicies/tests/browser/browser.ini
@@ -1,24 +1,29 @@
 [DEFAULT]
 support-files =
   head.js
   config_popups_cookies_addons_flash.json
+  config_broken_json.json
   opensearch.html
   opensearchEngine.xml
   policytest_v0.1.xpi
   policytest_v0.2.xpi
   policy_websitefilter_block.html
   policy_websitefilter_exception.html
   ../../../../../toolkit/components/antitracking/test/browser/page.html
   ../../../../../toolkit/components/antitracking/test/browser/subResources.sjs
 
+[browser_policies_basic_tests.js]
+[browser_policies_broken_json.js]
+[browser_policies_enterprise_only.js]
 [browser_policies_getActivePolicies.js]
 [browser_policies_macosparser_unflatten.js]
 skip-if = os != 'mac'
+[browser_policies_mistyped_json.js]
 [browser_policies_notice_in_aboutpreferences.js]
 [browser_policies_popups_cookies_addons_flash.js]
 [browser_policies_runOnce_helper.js]
 [browser_policies_setAndLockPref_API.js]
 [browser_policies_simple_pref_policies.js]
 [browser_policies_sorted_alphabetically.js]
 [browser_policy_3rdparty.js]
 [browser_policy_app_update.js]
rename from toolkit/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js
rename to browser/components/enterprisepolicies/tests/browser/browser_policies_basic_tests.js
rename from toolkit/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js
rename to browser/components/enterprisepolicies/tests/browser/browser_policies_broken_json.js
rename from toolkit/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js
rename to browser/components/enterprisepolicies/tests/browser/browser_policies_enterprise_only.js
--- a/browser/components/enterprisepolicies/tests/browser/browser_policies_macosparser_unflatten.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policies_macosparser_unflatten.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-let { macOSPoliciesParser } = ChromeUtils.import("resource://gre/modules/policies/macOSPoliciesParser.jsm");
+let { macOSPoliciesParser } = ChromeUtils.import("resource:///modules/policies/macOSPoliciesParser.jsm");
 
 add_task(async function test_object_unflatten() {
   // Note: these policies are just examples and they won't actually
   // run through the policy engine on this test. We're just testing
   // that the unflattening algorithm produces the correct output.
   let input = {
     "DisplayBookmarksToolbar": true,
 
rename from toolkit/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js
rename to browser/components/enterprisepolicies/tests/browser/browser_policies_mistyped_json.js
rename from toolkit/components/enterprisepolicies/tests/browser/config_broken_json.json
rename to browser/components/enterprisepolicies/tests/browser/config_broken_json.json
--- a/browser/components/enterprisepolicies/tests/moz.build
+++ b/browser/components/enterprisepolicies/tests/moz.build
@@ -8,8 +8,12 @@ BROWSER_CHROME_MANIFESTS += [
     'browser/browser.ini',
     'browser/disable_app_update/browser.ini',
     'browser/disable_default_bookmarks/browser.ini',
     'browser/disable_developer_tools/browser.ini',
     'browser/disable_forget_button/browser.ini',
     'browser/disable_fxscreenshots/browser.ini',
     'browser/hardware_acceleration/browser.ini',
 ]
+
+TESTING_JS_MODULES += [
+    'EnterprisePolicyTesting.jsm',
+]
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -160,19 +160,19 @@
 @BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 #endif
 
 ; JavaScript components
 @RESPATH@/browser/components/BrowserComponents.manifest
-@RESPATH@/components/EnterprisePolicies.js
-@RESPATH@/components/EnterprisePoliciesContent.js
-@RESPATH@/components/EnterprisePolicies.manifest
+@RESPATH@/browser/components/EnterprisePolicies.js
+@RESPATH@/browser/components/EnterprisePoliciesContent.js
+@RESPATH@/browser/components/EnterprisePolicies.manifest
 @RESPATH@/components/toolkitsearch.manifest
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
--- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp
@@ -178,17 +178,17 @@ nsAboutProtocolHandler::NewChannel(nsIUR
       // that it doesn't exist.
       rv = NS_ERROR_FACTORY_NOT_REGISTERED;
     } else if (!path.EqualsLiteral("blank") &&
                !path.EqualsLiteral("neterror") && !path.EqualsLiteral("home") &&
                !path.EqualsLiteral("welcome") &&
                !path.EqualsLiteral("newtab") &&
                !path.EqualsLiteral("certerror")) {
       nsCOMPtr<nsIEnterprisePolicies> policyManager =
-          do_GetService("@mozilla.org/enterprisepolicies;1", &rv2);
+          do_GetService("@mozilla.org/browser/enterprisepolicies;1", &rv2);
       if (NS_SUCCEEDED(rv2)) {
         nsAutoCString normalizedURL;
         normalizedURL.AssignLiteral("about:");
         normalizedURL.Append(path);
         rv2 = policyManager->IsAllowed(normalizedURL, &aboutPageAllowed);
         if (NS_FAILED(rv2)) {
           aboutPageAllowed = false;
         }
--- a/toolkit/components/enterprisepolicies/moz.build
+++ b/toolkit/components/enterprisepolicies/moz.build
@@ -7,29 +7,8 @@
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "Enterprise Policies")
 
 XPIDL_SOURCES += [
     'nsIEnterprisePolicies.idl',
 ]
 
 XPIDL_MODULE = 'enterprisepolicies'
-
-TEST_DIRS += [
-    'tests'
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != "android":
-    EXTRA_COMPONENTS += [
-        'EnterprisePolicies.js',
-        'EnterprisePolicies.manifest',
-        'EnterprisePoliciesContent.js',
-    ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-    EXTRA_JS_MODULES.policies += [
-        'WindowsGPOParser.jsm',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    EXTRA_JS_MODULES.policies += [
-        'macOSPoliciesParser.jsm',
-]
deleted file mode 100644
--- a/toolkit/components/enterprisepolicies/tests/browser/browser.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-head = head.js
-support-files =
-  config_broken_json.json
-
-[browser_policies_basic_tests.js]
-[browser_policies_broken_json.js]
-[browser_policies_enterprise_only.js]
-[browser_policies_mistyped_json.js]
deleted file mode 100644
--- a/toolkit/components/enterprisepolicies/tests/browser/head.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {
-  EnterprisePolicyTesting,
-  PoliciesPrefTracker,
-} = ChromeUtils.import("resource://testing-common/EnterprisePolicyTesting.jsm", null);
-const {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm", null);
-
-PoliciesPrefTracker.start();
-
-async function setupPolicyEngineWithJson(json, customSchema) {
-  PoliciesPrefTracker.restoreDefaultValues();
-  if (typeof(json) != "object") {
-    let filePath = getTestFilePath(json ? json : "non-existing-file.json");
-    return EnterprisePolicyTesting.setupPolicyEngineWithJson(filePath, customSchema);
-  }
-  return EnterprisePolicyTesting.setupPolicyEngineWithJson(json, customSchema);
-}
deleted file mode 100644
--- a/toolkit/components/enterprisepolicies/tests/moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-BROWSER_CHROME_MANIFESTS += [
-    'browser/browser.ini',
-]
-
-TESTING_JS_MODULES += [
-    'EnterprisePolicyTesting.jsm',
-]
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -108,15 +108,15 @@ var initTable = {
 };
 
 if (AppConstants.platform == "android") {
   initTable.androidBridge = ["@mozilla.org/android/bridge;1", "nsIAndroidBridge"];
 }
 if (AppConstants.MOZ_GECKO_PROFILER) {
   initTable.profiler = ["@mozilla.org/tools/profiler;1", "nsIProfiler"];
 }
-if ("@mozilla.org/enterprisepolicies;1" in Cc) {
-  initTable.policies = ["@mozilla.org/enterprisepolicies;1", "nsIEnterprisePolicies"];
+if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
+  initTable.policies = ["@mozilla.org/browser/enterprisepolicies;1", "nsIEnterprisePolicies"];
 }
 
 XPCOMUtils.defineLazyServiceGetters(Services, initTable);
 
 initTable = undefined;
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ b/toolkit/modules/tests/xpcshell/test_Services.js
@@ -54,17 +54,17 @@ function run_test() {
   checkService("wm", Ci.nsIWindowMediator);
   checkService("ww", Ci.nsIWindowWatcher);
   if ("nsISearchService" in Ci) {
     checkService("search", Ci.nsISearchService);
   }
   if ("nsIAndroidBridge" in Ci) {
     checkService("androidBridge", Ci.nsIAndroidBridge);
   }
-  if ("@mozilla.org/enterprisepolicies;1" in Cc) {
+  if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
     checkService("policies", Ci.nsIEnterprisePolicies);
   }
 
 
   // In xpcshell tests, the "@mozilla.org/xre/app-info;1" component implements
   // only the nsIXULRuntime interface, but not nsIXULAppInfo.  To test the
   // service getter for the latter interface, load mock app-info.
   let tmp = {};
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -981,17 +981,17 @@ nsXREDirProvider::DoStartup() {
     static const char16_t kStartup[] = {'s', 't', 'a', 'r',
                                         't', 'u', 'p', '\0'};
     obsSvc->NotifyObservers(nullptr, "profile-do-change", kStartup);
 
     // Initialize the Enterprise Policies service in the parent process
     // In the content process it's loaded on demand when needed
     if (XRE_IsParentProcess()) {
       nsCOMPtr<nsIObserver> policies(
-          do_GetService("@mozilla.org/enterprisepolicies;1"));
+          do_GetService("@mozilla.org/browser/enterprisepolicies;1"));
       if (policies) {
         policies->Observe(nullptr, "policies-startup", nullptr);
       }
     }
 
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
     // Call SandboxBroker to initialize things that depend on Gecko machinery
     // like the directory provider. We insert this initialization code here