B2G/gecko/browser/components/thumbnails/PageThumbs.jsm
/**
   * Captures a thumbnail for the given window.
   * @param aWindow The DOM window to capture a thumbnail from.
   * @param aCallback The function to be called when the thumbnail has been
   *                  captured. The first argument will be the data stream
   *                  containing the image data.
   */
Captures a thumbnail for the given window.
@param aWindow The DOM window to capture a thumbnail from.
@param aCallback The function to be called when the thumbnail has been
captured. The first argument will be the data stream
containing the image data.
Captures a thumbnail for the given window . @param aWindow The DOM window to capture a thumbnail from . @param aCallback The function to be called when the thumbnail has been captured . The first argument will be the data stream containing the image data .
function PageThumbs_capture(aWindow, aCallback) {
    if (!this._prefEnabled()) {
      return;
    }
    let canvas = this._createCanvas();
    this.captureToCanvas(aWindow, canvas);
    Services.tm.currentThread.dispatch(function () {
      canvas.mozFetchAsStream(aCallback, this.contentType);
    }.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
  }
function PageThumbs_capture ( aWindow , aCallback ) { if ( ! this . _prefEnabled ( ) ) { return ; } let canvas = this . _createCanvas ( ) ; this . captureToCanvas ( aWindow , canvas ) ; Services . tm . currentThread . dispatch ( function ( ) { canvas . mozFetchAsStream ( aCallback , this . contentType ) ; } . bind ( this ) , Ci . nsIThread . DISPATCH_NORMAL ) ; }
Captures a thumbnail for the given window.
Captures a thumbnail for the given window .
// Fetch the canvas data on the next event loop tick so that we allow // some event processing in between drawing to the canvas and encoding // its data. We want to block the UI as short as possible. See bug 744100.