Back out 5 changesets (bug 1209184) on suspicion of causing OS X opt build startup cache precompilation failures
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 28 Nov 2015 20:29:48 -0800
changeset 274665 cbf641f8da0af001a10b574b07a07035b50c30cf
parent 274664 959df62d450d8d8d51252ba9c292b668835ac3e7
child 274666 c952179edbfc58e2e8db3df6782c943782229112
push id68637
push usercbook@mozilla.com
push dateMon, 30 Nov 2015 12:45:36 +0000
treeherdermozilla-inbound@5a8a532f97cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1209184
milestone45.0a1
backs outd0404928473e105d4eeaabb381681d8c73902d8d
24282235336dd3dd3c725bcd6e8025dcf9fe0fb4
399404ff25e40003c620cd1d6193790127a5c121
a517959befe9b9e426380771c8712e568bb62832
a4f1765a6cdf7bca6ed2d22788be9e03e6ed8c24
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
Back out 5 changesets (bug 1209184) on suspicion of causing OS X opt build startup cache precompilation failures CLOSED TREE Backed out changeset d0404928473e (bug 1209184) Backed out changeset 24282235336d (bug 1209184) Backed out changeset 399404ff25e4 (bug 1209184) Backed out changeset a517959befe9 (bug 1209184) Backed out changeset a4f1765a6cdf (bug 1209184)
netwerk/protocol/res/ExtensionProtocolHandler.cpp
netwerk/protocol/res/ExtensionProtocolHandler.h
netwerk/protocol/res/SubstitutingProtocolHandler.cpp
netwerk/protocol/res/SubstitutingProtocolHandler.h
toolkit/components/extensions/ExtensionManagement.jsm
toolkit/components/extensions/moz.build
toolkit/components/extensions/test/mochitest/mochitest.ini
toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
toolkit/components/extensions/test/xpcshell/head.js
toolkit/components/extensions/test/xpcshell/test_locale_converter.js
toolkit/components/extensions/test/xpcshell/xpcshell.ini
toolkit/components/utils/simpleServices.js
toolkit/components/utils/utils.manifest
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -3,26 +3,16 @@
 /* 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/. */
 
 #include "ExtensionProtocolHandler.h"
 
 #include "nsIAddonPolicyService.h"
 #include "nsServiceManagerUtils.h"
-#include "nsIURL.h"
-#include "nsIChannel.h"
-#include "nsIStreamListener.h"
-#include "nsIRequestObserver.h"
-#include "nsIInputStreamChannel.h"
-#include "nsIInputStream.h"
-#include "nsIOutputStream.h"
-#include "nsIStreamConverterService.h"
-#include "nsIPipe.h"
-#include "nsNetUtil.h"
 
 namespace mozilla {
 
 NS_IMPL_QUERY_INTERFACE(ExtensionProtocolHandler, nsISubstitutingProtocolHandler,
                         nsIProtocolHandler, nsIProtocolHandlerWithDynamicFlags,
                         nsISupportsWeakReference)
 NS_IMPL_ADDREF_INHERITED(ExtensionProtocolHandler, SubstitutingProtocolHandler)
 NS_IMPL_RELEASE_INHERITED(ExtensionProtocolHandler, SubstitutingProtocolHandler)
@@ -38,112 +28,9 @@ ExtensionProtocolHandler::GetFlagsForURI
     nsresult rv = aps->ExtensionURILoadableByAnyone(aURI, &loadableByAnyone);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   *aFlags = URI_STD | URI_IS_LOCAL_RESOURCE | (loadableByAnyone ? (URI_LOADABLE_BY_ANYONE | URI_FETCHABLE_BY_ANYONE) : URI_DANGEROUS_TO_LOAD);
   return NS_OK;
 }
 
-class PipeCloser : public nsIRequestObserver
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  explicit PipeCloser(nsIOutputStream* aOutputStream) :
-    mOutputStream(aOutputStream)
-  {
-  }
-
-  NS_IMETHOD OnStartRequest(nsIRequest*, nsISupports*) override
-  {
-    return NS_OK;
-  }
-
-  NS_IMETHOD OnStopRequest(nsIRequest*, nsISupports*, nsresult aStatusCode) override
-  {
-    NS_ENSURE_TRUE(mOutputStream, NS_ERROR_UNEXPECTED);
-
-    nsresult rv = mOutputStream->Close();
-    mOutputStream = nullptr;
-    return rv;
-  }
-
-protected:
-  virtual ~PipeCloser() {}
-
-private:
-  nsCOMPtr<nsIOutputStream> mOutputStream;
-};
-
-NS_IMPL_ISUPPORTS(PipeCloser, nsIRequestObserver)
-
-nsresult
-ExtensionProtocolHandler::SubstituteChannel(nsIURI* aURI,
-                                            nsILoadInfo* aLoadInfo,
-                                            nsIChannel** result)
-{
-  nsresult rv;
-  nsCOMPtr<nsIURL> url = do_QueryInterface(aURI, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoCString ext;
-  rv = url->GetFileExtension(ext);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!ext.LowerCaseEqualsLiteral("css")) {
-    return NS_OK;
-  }
-
-  // Filter CSS files to replace locale message tokens with localized strings.
-
-  nsCOMPtr<nsIStreamConverterService> convService =
-    do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  const char* kFromType = "application/vnd.mozilla.webext.unlocalized";
-  const char* kToType = "text/css";
-
-  nsCOMPtr<nsIInputStream> inputStream;
-  if (aLoadInfo && aLoadInfo->GetSecurityMode()) {
-    // Certain security checks require an async channel.
-
-    nsCOMPtr<nsIOutputStream> outputStream;
-    rv = NS_NewPipe(getter_AddRefs(inputStream), getter_AddRefs(outputStream),
-                    0, UINT32_MAX, true, false);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIStreamListener> listener;
-    nsCOMPtr<nsIRequestObserver> observer = new PipeCloser(outputStream);
-    rv = NS_NewSimpleStreamListener(getter_AddRefs(listener), outputStream, observer);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    nsCOMPtr<nsIStreamListener> converter;
-    rv = convService->AsyncConvertData(kFromType, kToType, listener,
-                                       aURI, getter_AddRefs(converter));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = (*result)->AsyncOpen2(converter);
-  } else {
-    // Stylesheet loads for extension content scripts require a sync channel,
-    // but fortunately do not invoke security checks.
-
-    nsCOMPtr<nsIInputStream> sourceStream;
-    rv = (*result)->Open(getter_AddRefs(sourceStream));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    rv = convService->Convert(sourceStream, kFromType, kToType,
-                              aURI, getter_AddRefs(inputStream));
-  }
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIChannel> channel;
-  rv = NS_NewInputStreamChannelInternal(getter_AddRefs(channel), aURI, inputStream,
-                                        NS_LITERAL_CSTRING("text/css"),
-                                        NS_LITERAL_CSTRING("utf-8"),
-                                        aLoadInfo);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  channel.swap(*result);
-  return NS_OK;
-}
-
 } // namespace mozilla
--- a/netwerk/protocol/res/ExtensionProtocolHandler.h
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.h
@@ -34,15 +34,13 @@ protected:
     // substitutions can only match on host.
     if (SubstitutingProtocolHandler::HasSubstitution(aHost) && aPath.EqualsLiteral("/_blank.html")) {
       aResult.AssignLiteral("about:blank");
       return true;
     }
 
     return false;
   }
-
-  virtual nsresult SubstituteChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, nsIChannel** result) override;
 };
 
 } // namespace mozilla
 
 #endif /* ExtensionProtocolHandler_h___ */
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
@@ -248,20 +248,17 @@ SubstitutingProtocolHandler::NewChannel2
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = NS_NewChannelInternal(result, newURI, aLoadInfo);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsLoadFlags loadFlags = 0;
   (*result)->GetLoadFlags(&loadFlags);
   (*result)->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE);
-  rv = (*result)->SetOriginalURI(uri);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return SubstituteChannel(uri, aLoadInfo, result);
+  return (*result)->SetOriginalURI(uri);
 }
 
 nsresult
 SubstitutingProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
 {
   return NewChannel2(uri, nullptr, result);
 }
 
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.h
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.h
@@ -54,23 +54,16 @@ protected:
 
   // Override this in the subclass to check for special case when resolving URIs
   // _before_ checking substitutions.
   virtual bool ResolveSpecialCases(const nsACString& aHost, const nsACString& aPath, nsACString& aResult)
   {
     return false;
   }
 
-  // Override this in the subclass to check for special case when opening
-  // channels.
-  virtual nsresult SubstituteChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, nsIChannel** result)
-  {
-    return NS_OK;
-  }
-
   nsIIOService* IOService() { return mIOService; }
 
 private:
   nsCString mScheme;
   Maybe<uint32_t> mFlags;
   nsInterfaceHashtable<nsCStringHashKey,nsIURI> mSubstitutions;
   nsCOMPtr<nsIIOService> mIOService;
 
--- a/toolkit/components/extensions/ExtensionManagement.jsm
+++ b/toolkit/components/extensions/ExtensionManagement.jsm
@@ -130,25 +130,23 @@ var Service = {
 
     // Create the moz-extension://uuid mapping.
     let handler = Services.io.getProtocolHandler("moz-extension");
     handler.QueryInterface(Ci.nsISubstitutingProtocolHandler);
     handler.setSubstitution(uuid, uri);
 
     this.uuidMap.set(uuid, extension);
     this.aps.setAddonLoadURICallback(extension.id, this.checkAddonMayLoad.bind(this, extension));
-    this.aps.setAddonLocalizeCallback(extension.id, extension.localize.bind(extension));
   },
 
   // Called when an extension is unloaded.
   shutdownExtension(uuid) {
     let extension = this.uuidMap.get(uuid);
     this.uuidMap.delete(uuid);
     this.aps.setAddonLoadURICallback(extension.id, null);
-    this.aps.setAddonLocalizeCallback(extension.id, null);
 
     let handler = Services.io.getProtocolHandler("moz-extension");
     handler.QueryInterface(Ci.nsISubstitutingProtocolHandler);
     handler.setSubstitution(uuid, null);
   },
 
   // Return true if the given URI can be loaded from arbitrary web
   // content. The manifest.json |web_accessible_resources| directive
--- a/toolkit/components/extensions/moz.build
+++ b/toolkit/components/extensions/moz.build
@@ -10,10 +10,8 @@ EXTRA_JS_MODULES += [
     'ExtensionManagement.jsm',
     'ExtensionStorage.jsm',
     'ExtensionUtils.jsm',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
--- a/toolkit/components/extensions/test/mochitest/mochitest.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest.ini
@@ -16,17 +16,16 @@ support-files =
   file_script_xhr.js
   file_sample.html
   file_privilege_escalation.html
   file_ext_background_api_injection.js
 
 [test_ext_simple.html]
 [test_ext_geturl.html]
 [test_ext_contentscript.html]
-[test_ext_i18n_css.html]
 [test_ext_webrequest.html]
 [test_ext_generate.html]
 [test_ext_localStorage.html]
 [test_ext_notifications.html]
 [test_ext_runtime_connect.html]
 [test_ext_runtime_disconnect.html]
 [test_ext_runtime_getPlatformInfo.html]
 [test_ext_sandbox_var.html]
deleted file mode 100644
--- a/toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for content script</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript;version=1.8">
-"use strict";
-
-add_task(function* test_i18n_css() {
-  let extension = ExtensionTestUtils.loadExtension({
-    background: "new " + function() {
-      function fetch(url) {
-        return new Promise((resolve, reject) => {
-          let xhr = new XMLHttpRequest;
-          xhr.open("GET", url);
-          xhr.onload = () => { resolve(xhr.responseText) };
-          xhr.onerror = reject;
-          xhr.send();
-        });
-      }
-
-      Promise.all([fetch("foo.css"), fetch("bar.CsS?x#y"), fetch("foo.txt")]).then(results => {
-
-        browser.test.assertEq("body { max-width: 42px; }", results[0], "CSS file localized");
-        browser.test.assertEq("body { max-width: 42px; }", results[1], "CSS file localized");
-
-        browser.test.assertEq("body { __MSG_foo__; }", results[2], "Text file not localized");
-
-        browser.test.notifyPass("i18n-css");
-      });
-
-      browser.test.sendMessage("ready", browser.runtime.getURL("foo.css"));
-    },
-
-    manifest: {
-      "web_accessible_resources": ["foo.css", "foo.txt", "locale.css"],
-
-      "content_scripts": [{
-        "matches": ["http://mochi.test/*/file_sample.html"],
-        "css": ["foo.css"],
-      }],
-
-      "default_locale": "en",
-    },
-
-    files: {
-      "_locales/en/messages.json": JSON.stringify({
-        "foo": {
-          "message": "max-width: 42px",
-          "description": "foo",
-        },
-      }),
-
-      "foo.css": "body { __MSG_foo__; }",
-      "bar.CsS": "body { __MSG_foo__; }",
-      "foo.txt": "body { __MSG_foo__; }",
-      "locale.css": '* { content: "__MSG_@@ui_locale__ __MSG_@@bidi_dir__ __MSG_@@bidi_reversed_dir__ __MSG_@@bidi_start_edge__ __MSG_@@bidi_end_edge__" }',
-    },
-  });
-
-  yield extension.startup();
-  let cssURL = yield extension.awaitMessage("ready");
-
-  function fetch(url) {
-    return new Promise((resolve, reject) => {
-      let xhr = new XMLHttpRequest;
-      xhr.open("GET", url);
-      xhr.onload = () => { resolve(xhr.responseText) };
-      xhr.onerror = reject;
-      xhr.send();
-    });
-  }
-
-  let css = yield fetch(cssURL);
-
-  is(css, "body { max-width: 42px; }", "CSS file localized in mochitest scope");
-
-  let win = window.open("file_sample.html");
-  yield waitForLoad(win);
-
-  let style = win.getComputedStyle(win.document.body);
-  is(style.maxWidth, "42px", "stylesheet correctly applied");
-  win.close();
-
-  cssURL = cssURL.replace(/foo.css$/, "locale.css");
-
-  css = yield fetch(cssURL);
-  is(css, '* { content: "en_US ltr rtl left right" }', "CSS file localized in mochitest scope");
-
-  const LOCALE = "general.useragent.locale";
-  const DIR = "intl.uidirection.en";
-
-  // We don't wind up actually switching the chrome registry locale, since we
-  // don't have a chrome package for Hebrew. So just override it.
-  SpecialPowers.setCharPref(LOCALE, "he");
-  SpecialPowers.setCharPref(DIR, "rtl");
-
-  css = yield fetch(cssURL);
-  is(css, '* { content: "he rtl ltr right left" }', "CSS file localized in mochitest scope");
-
-  SpecialPowers.clearUserPref(LOCALE);
-  SpecialPowers.clearUserPref(DIR);
-
-  yield extension.awaitFinish("i18n-css");
-  yield extension.unload();
-});
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/head.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
-                                  "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
-                                  "resource://gre/modules/Services.jsm");
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/test_locale_converter.js
+++ /dev/null
@@ -1,118 +0,0 @@
-"use strict";
-
-const convService = Cc["@mozilla.org/streamConverters;1"]
-  .getService(Ci.nsIStreamConverterService);
-
-const UUID = "72b61ee3-aceb-476c-be1b-0822b036c9f1";
-const ADDON_ID = "test@web.extension";
-const URI = NetUtil.newURI(`moz-extension://${UUID}/file.css`);
-
-const FROM_TYPE = "application/vnd.mozilla.webext.unlocalized";
-const TO_TYPE = "text/css";
-
-
-function StringStream(string) {
-  let stream = Cc["@mozilla.org/io/string-input-stream;1"]
-    .createInstance(Ci.nsIStringInputStream);
-
-  stream.data = string;
-  return stream;
-}
-
-
-// Initialize the policy service with a stub localizer for our
-// add-on ID.
-add_task(function* init() {
-  const aps = Cc["@mozilla.org/addons/policy-service;1"]
-    .getService(Ci.nsIAddonPolicyService).wrappedJSObject;
-
-  let oldCallback = aps.setExtensionURIToAddonIdCallback(uri => {
-    if (uri.host == UUID) {
-      return ADDON_ID;
-    }
-  });
-
-  aps.setAddonLocalizeCallback(ADDON_ID, string => {
-    return string.replace(/__MSG_(.*?)__/g, "<localized-$1>");
-  });
-
-  do_register_cleanup(() => {
-    aps.setExtensionURIToAddonIdCallback(oldCallback);
-    aps.setAddonLocalizeCallback(ADDON_ID, null);
-  });
-});
-
-
-// Test that the synchronous converter works as expected with a
-// simple string.
-add_task(function* testSynchronousConvert() {
-  let stream = StringStream("Foo __MSG_xxx__ bar __MSG_yyy__ baz");
-
-  let resultStream = convService.convert(stream, FROM_TYPE, TO_TYPE, URI);
-
-  let result = NetUtil.readInputStreamToString(resultStream, resultStream.available());
-
-  equal(result, "Foo <localized-xxx> bar <localized-yyy> baz");
-});
-
-
-// Test that the asynchronous converter works as expected with input
-// split into multiple chunks, and a boundary in the middle of a
-// replacement token.
-add_task(function* testAsyncConvert() {
-  let listener;
-  let awaitResult = new Promise((resolve, reject) => {
-    listener = {
-      QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener]),
-
-      onDataAvailable(request, context, inputStream, offset, count) {
-        this.resultParts.push(NetUtil.readInputStreamToString(inputStream, count));
-      },
-
-      onStartRequest() {
-        ok(!("resultParts" in this));
-        this.resultParts = [];
-      },
-
-      onStopRequest(request, context, statusCode) {
-        if (!Components.isSuccessCode(statusCode)) {
-          reject(new Error(statusCode));
-        }
-
-        resolve(this.resultParts.join("\n"));
-      },
-    };
-  });
-
-  let parts = ["Foo __MSG_x", "xx__ bar __MSG_yyy__ baz"];
-
-  let converter = convService.asyncConvertData(FROM_TYPE, TO_TYPE, listener, URI);
-  converter.onStartRequest(null, null);
-
-  for (let part of parts) {
-    converter.onDataAvailable(null, null, StringStream(part), 0, part.length);
-  }
-
-  converter.onStopRequest(null, null, Cr.NS_OK);
-
-
-  let result = yield awaitResult;
-  equal(result, "Foo <localized-xxx> bar <localized-yyy> baz");
-});
-
-
-// Test that attempting to initialize a converter with the URI of a
-// nonexistent WebExtension fails.
-add_task(function* testInvalidUUID() {
-  let uri = NetUtil.newURI("moz-extension://eb4f3be8-41c9-4970-aa6d-b84d1ecc02b2/file.css");
-
-  Assert.throws(() => {
-    convService.convert(stream, FROM_TYPE, TO_TYPE, uri);
-  });
-
-  Assert.throws(() => {
-    let listener = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener]) };
-
-    convService.asyncConvertData(FROM_TYPE, TO_TYPE, listener, uri);
-  });
-});
deleted file mode 100644
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android' || toolkit == 'gonk'
-
-[test_locale_converter.js]
--- a/toolkit/components/utils/simpleServices.js
+++ b/toolkit/components/utils/simpleServices.js
@@ -7,27 +7,21 @@
  * is overkill. Be careful about namespace pollution, and be mindful about
  * importing lots of JSMs in global scope, since this file will almost certainly
  * be loaded from enough callsites that any such imports will always end up getting
  * eagerly loaded at startup.
  */
 
 "use strict";
 
-const Cc = Components.classes;
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
-                                  "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
-                                  "resource://gre/modules/Services.jsm");
-
 function RemoteTagServiceService()
 {
 }
 
 RemoteTagServiceService.prototype = {
   classID: Components.ID("{dfd07380-6083-11e4-9803-0800200c9a66}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIRemoteTagService, Ci.nsISupportsWeakReference]),
 
@@ -49,45 +43,35 @@ RemoteTagServiceService.prototype = {
     return "generic";
   }
 };
 
 function AddonPolicyService()
 {
   this.wrappedJSObject = this;
   this.mayLoadURICallbacks = new Map();
-  this.localizeCallbacks = new Map();
 }
 
 AddonPolicyService.prototype = {
   classID: Components.ID("{89560ed3-72e3-498d-a0e8-ffe50334d7c5}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAddonPolicyService]),
 
   /*
    * Invokes a callback (if any) associated with the addon to determine whether
    * unprivileged code running within the addon is allowed to perform loads from
    * the given URI.
    *
    * @see nsIAddonPolicyService.addonMayLoadURI
    */
   addonMayLoadURI(aAddonId, aURI) {
-    let cb = this.mayLoadURICallbacks.get(aAddonId);
+    let cb = this.mayLoadURICallbacks[aAddonId];
     return cb ? cb(aURI) : false;
   },
 
   /*
-   * Invokes a callback (if any) associated with the addon to loclaize a
-   * resource belonging to that add-on.
-   */
-  localizeAddonString(aAddonId, aString) {
-    let cb = this.localizeCallbacks.get(aAddonId);
-    return cb ? cb(aString) : aString;
-  },
-
-  /*
    * Invokes a callback (if any) to determine if an extension URI should be
    * web-accessible.
    *
    * @see nsIAddonPolicyService.extensionURILoadableByAnyone
    */
   extensionURILoadableByAnyone(aURI) {
     if (aURI.scheme != "moz-extension") {
       throw new TypeError("non-extension URI passed");
@@ -116,31 +100,19 @@ AddonPolicyService.prototype = {
 
   /*
    * Sets the callbacks used in addonMayLoadURI above. Not accessible over
    * XPCOM - callers should use .wrappedJSObject on the service to call it
    * directly.
    */
   setAddonLoadURICallback(aAddonId, aCallback) {
     if (aCallback) {
-      this.mayLoadURICallbacks.set(aAddonId, aCallback);
+      this.mayLoadURICallbacks[aAddonId] = aCallback;
     } else {
-      delete this.mayLoadURICallbacks.delete(aAddonId);
-    }
-  },
-
-  /*
-   * Sets the callbacks used by the stream converter service to localize
-   * add-on resources.
-   */
-  setAddonLocalizeCallback(aAddonId, aCallback) {
-    if (aCallback) {
-      this.localizeCallbacks.set(aAddonId, aCallback);
-    } else {
-      delete this.localizeCallbacks.delete(aAddonId);
+      delete this.mayLoadURICallbacks[aAddonId];
     }
   },
 
   /*
    * Sets the callback used in extensionURILoadableByAnyone above. Not
    * accessible over XPCOM - callers should use .wrappedJSObject on the
    * service to call it directly.
    */
@@ -157,100 +129,9 @@ AddonPolicyService.prototype = {
    */
   setExtensionURIToAddonIdCallback(aCallback) {
     var old = this.extensionURIToAddonIdCallback;
     this.extensionURIToAddonIdCallback = aCallback;
     return old;
   }
 };
 
-/*
- * This class provides a stream filter for locale messages in CSS files served
- * by the moz-extension: protocol handler.
- *
- * See SubstituteChannel in netwerk/protocol/res/ExtensionProtocolHandler.cpp
- * for usage.
- */
-function AddonLocalizationConverter()
-{
-  this.aps = Cc["@mozilla.org/addons/policy-service;1"].getService(Ci.nsIAddonPolicyService)
-    .wrappedJSObject;
-}
-
-AddonLocalizationConverter.prototype = {
-  classID: Components.ID("{ded150e3-c92e-4077-a396-0dba9953e39f}"),
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamConverter]),
-
-  FROM_TYPE: "application/vnd.mozilla.webext.unlocalized",
-  TO_TYPE: "text/css",
-
-  checkTypes(aFromType, aToType) {
-    if (aFromType != this.FROM_TYPE) {
-      throw Components.Exception("Invalid aFromType value", Cr.NS_ERROR_INVALID_ARG,
-                                 Components.stack.caller.caller);
-    }
-    if (aToType != this.TO_TYPE) {
-      throw Components.Exception("Invalid aToType value", Cr.NS_ERROR_INVALID_ARG,
-                                 Components.stack.caller.caller);
-    }
-  },
-
-  // aContext must be a nsIURI object for a valid moz-extension: URL.
-  getAddonId(aContext) {
-    // In this case, we want the add-on ID even if the URL is web accessible,
-    // so check the root rather than the exact path.
-    let uri = Services.io.newURI("/", null, aContext);
-
-    let id = this.aps.extensionURIToAddonId(uri);
-    if (id == undefined) {
-      throw new Components.Exception("Invalid context", Cr.NS_ERROR_INVALID_ARG);
-    }
-    return id;
-  },
-
-  convertToStream(aAddonId, aString) {
-    let stream = Cc["@mozilla.org/io/string-input-stream;1"]
-      .createInstance(Ci.nsIStringInputStream);
-
-    stream.data = this.aps.localizeAddonString(aAddonId, aString);
-    return stream;
-  },
-
-  convert(aStream, aFromType, aToType, aContext) {
-    this.checkTypes(aFromType, aToType);
-    let addonId = this.getAddonId(aContext);
-
-    let string = NetUtil.readInputStreamToString(aStream, aStream.available());
-    return this.convertToStream(addonId, string);
-  },
-
-  asyncConvertData(aFromType, aToType, aListener, aContext) {
-    this.checkTypes(aFromType, aToType);
-    this.addonId = this.getAddonId(aContext);
-    this.listener = aListener;
-  },
-
-  onStartRequest(aRequest, aContext) {
-    this.parts = [];
-  },
-
-  onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) {
-    this.parts.push(NetUtil.readInputStreamToString(aInputStream, aCount));
-  },
-
-  onStopRequest(aRequest, aContext, aStatusCode) {
-    try {
-      this.listener.onStartRequest(aRequest, null);
-      if (Components.isSuccessCode(aStatusCode)) {
-        let string = this.parts.join("");
-        let stream = this.convertToStream(this.addonId, string);
-
-        this.listener.onDataAvailable(aRequest, null, stream, 0, stream.data.length);
-      }
-    } catch (e) {
-      aStatusCode = e.result || Cr.NS_ERROR_FAILURE;
-    }
-    this.listener.onStopRequest(aRequest, null, aStatusCode);
-  },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RemoteTagServiceService, AddonPolicyService,
-                                                     AddonLocalizationConverter]);
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RemoteTagServiceService, AddonPolicyService]);
--- a/toolkit/components/utils/utils.manifest
+++ b/toolkit/components/utils/utils.manifest
@@ -1,6 +1,4 @@
 component {dfd07380-6083-11e4-9803-0800200c9a66} simpleServices.js
 contract @mozilla.org/addons/remote-tag-service;1 {dfd07380-6083-11e4-9803-0800200c9a66}
 component {89560ed3-72e3-498d-a0e8-ffe50334d7c5} simpleServices.js
 contract @mozilla.org/addons/policy-service;1 {89560ed3-72e3-498d-a0e8-ffe50334d7c5}
-component {ded150e3-c92e-4077-a396-0dba9953e39f} simpleServices.js
-contract @mozilla.org/streamconv;1?from=application/vnd.mozilla.webext.unlocalized&to=text/css {ded150e3-c92e-4077-a396-0dba9953e39f}