B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * extract the base domain from a history entry and its children
   * @param aEntry
   *        the history entry, serialized
   * @param aHosts
   *        the hash that will be used to store hosts eg, { hostname: true }
   * @param aCheckPrivacy
   *        should we check the privacy level for https
   * @param aIsPinned
   *        is the entry we're evaluating for a pinned tab; used only if
   *        aCheckPrivacy
   */
extract the base domain from a history entry and its children
@param aEntry
the history entry, serialized
@param aHosts
the hash that will be used to store hosts eg, { hostname: true }
@param aCheckPrivacy
should we check the privacy level for https
@param aIsPinned
is the entry we're evaluating for a pinned tab; used only if
aCheckPrivacy
extract the base domain from a history entry and its children @param aEntry the history entry serialized @param aHosts the hash that will be used to store hosts eg { hostname : true } @param aCheckPrivacy should we check the privacy level for https @param aIsPinned is the entry we ' re evaluating for a pinned tab ; used only if aCheckPrivacy
function ssi_extractHostsForCookiesFromEntry(aEntry, aHosts, aCheckPrivacy, aIsPinned) {
    let host = aEntry._host,
        scheme = aEntry._scheme;
    if (!host && !scheme) {
      try {
        let uri = this._getURIFromString(aEntry.url);
        host = uri.host;
        scheme = uri.scheme;
        this._extractHostsForCookiesFromHostScheme(host, scheme, aHosts, aCheckPrivacy, aIsPinned);
      }
      catch(ex) { }
    }
    if (aEntry.children) {
      aEntry.children.forEach(function(entry) {
        this._extractHostsForCookiesFromEntry(entry, aHosts, aCheckPrivacy, aIsPinned);
      }, this);
    }
  }
function ssi_extractHostsForCookiesFromEntry ( aEntry , aHosts , aCheckPrivacy , aIsPinned ) { let host = aEntry . _host , scheme = aEntry . _scheme ; if ( ! host && ! scheme ) { try { let uri = this . _getURIFromString ( aEntry . url ) ; host = uri . host ; scheme = uri . scheme ; this . _extractHostsForCookiesFromHostScheme ( host , scheme , aHosts , aCheckPrivacy , aIsPinned ) ; } catch ( ex ) { } } if ( aEntry . children ) { aEntry . children . forEach ( function ( entry ) { this . _extractHostsForCookiesFromEntry ( entry , aHosts , aCheckPrivacy , aIsPinned ) ; } , this ) ; } }
extract the base domain from a history entry and its children
 @param aEntry
        the history entry, serialized
 @param aHosts
        the hash that will be used to store hosts eg, { hostname: true }
 @param aCheckPrivacy
        should we check the privacy level for https
 @param aIsPinned
        is the entry we're evaluating for a pinned tab; used only if
        aCheckPrivacy
extract the base domain from a history entry and its children @param aEntry the history entry serialized @param aHosts the hash that will be used to store hosts eg { hostname : true } @param aCheckPrivacy should we check the privacy level for https @param aIsPinned is the entry we ' re evaluating for a pinned tab ; used only if aCheckPrivacy
// If host & scheme aren't defined, then we are likely here in the startup // process via _splitCookiesFromWindow. In that case, we'll turn aEntry.url // into an nsIURI and get host/scheme from that. This will throw for about: // urls in which case we don't need to do anything.