B2G/gecko/browser/components/sessionstore/src/SessionStorage.jsm
/**
   * Writes session storage data to the given tab.
   * @param aDocShell
   *        A tab's docshell (containing the sessionStorage)
   * @param aStorageData
   *        Storage data to be restored
   */
Writes session storage data to the given tab.
@param aDocShell
A tab's docshell (containing the sessionStorage)
@param aStorageData
Storage data to be restored
Writes session storage data to the given tab . @param aDocShell A tab ' s docshell ( containing the sessionStorage ) @param aStorageData Storage data to be restored
function DomStorage_write(aDocShell, aStorageData) {
    for (let [host, data] in Iterator(aStorageData)) {
      let uri = Services.io.newURI(host, null, null);
      let principal = Services.scriptSecurityManager.getDocShellCodebasePrincipal(uri, aDocShell);
      let storage = aDocShell.getSessionStorageForPrincipal(principal, "", true);
      for (let [key, value] in Iterator(data)) {
        try {
          storage.setItem(key, value);
        } catch (e) {
          Cu.reportError(e);
        }
      }
    }
  }
function DomStorage_write ( aDocShell , aStorageData ) { for ( let [ host , data ] in Iterator ( aStorageData ) ) { let uri = Services . io . newURI ( host , null , null ) ; let principal = Services . scriptSecurityManager . getDocShellCodebasePrincipal ( uri , aDocShell ) ; let storage = aDocShell . getSessionStorageForPrincipal ( principal , "" , true ) ; for ( let [ key , value ] in Iterator ( data ) ) { try { storage . setItem ( key , value ) ; } catch ( e ) { Cu . reportError ( e ) ; } } } }
Writes session storage data to the given tab.
Writes session storage data to the given tab .
// throws e.g. for URIs that can't have sessionStorage