B2G/gecko/services/aitc/modules/browserid.js
/**
 * An object that represents a sandbox in an iframe loaded with uri. The
 * callback provided to the constructor will be invoked when the sandbox is
 * ready to be used. The callback will receive this object as its only argument
 * and the prepared sandbox may be accessed via the "box" property.
 *
 * Please call free() when you are finished with the sandbox to explicitely free
 * up all associated resources.
 *
 * @param cb
 *        (function) Callback to be invoked with a Sandbox, when ready.
 * @param uri
 *        (String) URI to be loaded in the Sandbox.
 */
An object that represents a sandbox in an iframe loaded with uri. The
callback provided to the constructor will be invoked when the sandbox is
ready to be used. The callback will receive this object as its only argument
and the prepared sandbox may be accessed via the "box" property.

Please call free() when you are finished with the sandbox to explicitely free
up all associated resources.

@param cb
(function) Callback to be invoked with a Sandbox, when ready.
@param uri
(String) URI to be loaded in the Sandbox.
An object that represents a sandbox in an iframe loaded with uri . The callback provided to the constructor will be invoked when the sandbox is ready to be used . The callback will receive this object as its only argument and the prepared sandbox may be accessed via the " box " property . Please call free () when you are finished with the sandbox to explicitely free up all associated resources . @param cb ( function ) Callback to be invoked with a Sandbox when ready . @param uri ( String ) URI to be loaded in the Sandbox .
function Sandbox(cb, uri) {
  this._uri = uri;
  try {
    this._createFrame();
    this._createSandbox(cb, uri);
  } catch(e) {
    this._log = Log4Moz.repository.getLogger("Service.AITC.BrowserID.Sandbox");
    this._log.level = Log4Moz.Level[PREFS.get("log")];
    this._log.error("Could not create Sandbox " + e);
    cb(null);
  }
}
function Sandbox ( cb , uri ) { this . _uri = uri ; try { this . _createFrame ( ) ; this . _createSandbox ( cb , uri ) ; } catch ( e ) { this . _log = Log4Moz . repository . getLogger ( "Service.AITC.BrowserID.Sandbox" ) ; this . _log . level = Log4Moz . Level [ PREFS . get ( "log" ) ] ; this . _log . error ( "Could not create Sandbox " + e ) ; cb ( null ) ; } }
An object that represents a sandbox in an iframe loaded with uri.
An object that represents a sandbox in an iframe loaded with uri .
// Put in a try/catch block because Services.wm.getMostRecentWindow, called in // _createFrame will be null in XPCShell.