B2G/gecko/browser/components/feeds/src/WebContentConverter.js
/**
   * Load the auto handler, content handler and protocol tables from 
   * preferences.
   */
Load the auto handler, content handler and protocol tables from
preferences.
Load the auto handler content handler and protocol tables from preferences .
function WCCR__init() {
    var ps = 
        Cc["@mozilla.org/preferences-service;1"].
        getService(Ci.nsIPrefService);
    var kids = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH)
                 .getChildList("");
    var nums = [];
    for (var i = 0; i < kids.length; i++) {
      var match = /^(\d+)\.uri$/.exec(kids[i]);
      if (!match)
        continue;
      else
        nums.push(match[1]);
    }
    nums.sort(function(a, b) {return a - b;});
    for (var i = 0; i < nums.length; i++) {
      var branch = ps.getBranch(PREF_CONTENTHANDLERS_BRANCH + nums[i] + ".");
      this._registerContentHandlerWithBranch(branch);
    }
    try {
      var autoBranch = ps.getBranch(PREF_CONTENTHANDLERS_AUTO);
      var childPrefs = autoBranch.getChildList("");
      for (var i = 0; i < childPrefs.length; ++i) {
        var type = childPrefs[i];
        var uri = autoBranch.getCharPref(type);
        if (uri) {
          var handler = this.getWebContentHandlerByURI(type, uri);
          this._setAutoHandler(type, handler);
        }
      }
    }
    catch (e) {
    }
  }
function WCCR__init ( ) { var ps = Cc [ "@mozilla.org/preferences-service;1" ] . getService ( Ci . nsIPrefService ) ; var kids = ps . getBranch ( PREF_CONTENTHANDLERS_BRANCH ) . getChildList ( "" ) ; var nums = [ ] ; for ( var i = 0 ; i < kids . length ; i ++ ) { var match = / ^(\d+)\.uri$ / . exec ( kids [ i ] ) ; if ( ! match ) continue ; else nums . push ( match [ 1 ] ) ; } nums . sort ( function ( a , b ) { return a - b ; } ) ; for ( var i = 0 ; i < nums . length ; i ++ ) { var branch = ps . getBranch ( PREF_CONTENTHANDLERS_BRANCH + nums [ i ] + "." ) ; this . _registerContentHandlerWithBranch ( branch ) ; } try { var autoBranch = ps . getBranch ( PREF_CONTENTHANDLERS_AUTO ) ; var childPrefs = autoBranch . getChildList ( "" ) ; for ( var i = 0 ; i < childPrefs . length ; ++ i ) { var type = childPrefs [ i ] ; var uri = autoBranch . getCharPref ( type ) ; if ( uri ) { var handler = this . getWebContentHandlerByURI ( type , uri ) ; this . _setAutoHandler ( type , handler ) ; } } } catch ( e ) { } }
Load the auto handler, content handler and protocol tables from
 preferences.
Load the auto handler content handler and protocol tables from preferences .
// first get the numbers of the providers by getting all ###.uri prefs // sort them, to get them back in order // now register them // We need to do this _after_ registering all of the available handlers,  // so that getWebContentHandlerByURI can return successfully. // No auto branch yet, that's fine //LOG("WCCR.init: There is no auto branch, benign");