Bug 1249702 - Fix e10s feed handling with auto content handler prefs. r=Gijs
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 23 Feb 2016 10:53:49 -0600
changeset 285607 1bcb9055be8c62b9f61cab5b9d79f5bfa2b92222
parent 285606 684054d29f9b49e6445d74a9ac83e04f311d0c7f
child 285608 ba871a36752cdf91f4fc5a6f328e2af6ebb29587
push id17835
push userjryans@gmail.com
push dateThu, 25 Feb 2016 23:26:27 +0000
treeherderfx-team@1bcb9055be8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1249702
milestone47.0a1
Bug 1249702 - Fix e10s feed handling with auto content handler prefs. r=Gijs MozReview-Commit-ID: 3ggmJxUmuxp
browser/components/feeds/WebContentConverter.js
browser/modules/Feeds.jsm
--- a/browser/components/feeds/WebContentConverter.js
+++ b/browser/components/feeds/WebContentConverter.js
@@ -896,38 +896,16 @@ WebContentConverterRegistrarContent.prot
     for (num of nums) {
       let branch = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH + num + ".");
       try {
         this._registerContentHandlerHavingBranch(branch);
       } catch(ex) {
         // do nothing, the next branch might have values
       }
     }
-
-    // We need to do this _after_ registering all of the available handlers,
-    // so that getWebContentHandlerByURI can return successfully.
-    let autoBranch;
-    try {
-      autoBranch = ps.getBranch(PREF_CONTENTHANDLERS_AUTO);
-    } catch (e) {
-      // No auto branch yet, that's fine
-      //LOG("WCCR.init: There is no auto branch, benign");
-    }
-
-    if (autoBranch) {
-      for (let type of autoBranch.getChildList("")) {
-        let uri = autoBranch.getCharPref(type);
-        if (uri) {
-          let handler = this.getWebContentHandlerByURI(type, uri);
-          if (handler) {
-            this._setAutoHandler(type, handler);
-          }
-        }
-      }
-    }
   },
 
   _typeIsRegistered(contentType, uri) {
     return this._contentTypes[contentType]
                .some(e => e.uri == uri);
   },
 
   /**
--- a/browser/modules/Feeds.jsm
+++ b/browser/modules/Feeds.jsm
@@ -41,17 +41,17 @@ this.Feeds = {
                           getService(Ci.nsIWebContentHandlerRegistrar);
         registrar.registerContentHandler(data.contentType, data.uri, data.title,
                                          aMessage.target);
         break;
       }
 
       case "WCCR:setAutoHandler": {
         let registrar = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"].
-                          getService(Ci.nsIWebContentHandlerRegistrar);
+                          getService(Ci.nsIWebContentConverterService);
         registrar.setAutoHandler(data.contentType, data.handler);
         break;
       }
 
       case "FeedConverter:addLiveBookmark": {
         let topWindow = RecentWindow.getMostRecentBrowserWindow();
         topWindow.PlacesCommandHook.addLiveBookmark(data.spec, data.title, data.subtitle)
                                    .catch(Components.utils.reportError);