Bug 736456 - Cache the spec in captureAndStore, since currentURI may not be available later; r=ttaubert a=akeybl
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 16 Mar 2012 16:13:34 +0100
changeset 90610 c6f1210231c1ffbde39bd822156ea6183edb4c16
parent 90609 787aedcb98ebac868c462520d71916112419f6d4
child 90611 85b2776948f6833b7ed40dfdef0ecbb884605edb
push id1032
push usertim.taubert@gmx.de
push dateThu, 29 Mar 2012 09:27:55 +0000
treeherdermozilla-aurora@85b2776948f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, akeybl
bugs736456
milestone13.0a2
Bug 736456 - Cache the spec in captureAndStore, since currentURI may not be available later; r=ttaubert a=akeybl
browser/components/thumbnails/PageThumbs.jsm
--- a/browser/components/thumbnails/PageThumbs.jsm
+++ b/browser/components/thumbnails/PageThumbs.jsm
@@ -104,31 +104,32 @@ let PageThumbs = {
   },
 
   /**
    * Captures a thumbnail for the given browser and stores it to the cache.
    * @param aBrowser The browser to capture a thumbnail for.
    * @param aCallback The function to be called when finished (optional).
    */
   captureAndStore: function PageThumbs_captureAndStore(aBrowser, aCallback) {
+    let url = aBrowser.currentURI.spec;
     this.capture(aBrowser.contentWindow, function (aInputStream) {
       let telemetryStoreTime = new Date();
 
       function finish(aSuccessful) {
         if (aSuccessful) {
           Services.telemetry.getHistogramById("FX_THUMBNAILS_STORE_TIME_MS")
             .add(new Date() - telemetryStoreTime);
         }
 
         if (aCallback)
           aCallback(aSuccessful);
       }
 
       // Get a writeable cache entry.
-      PageThumbsCache.getWriteEntry(aBrowser.currentURI.spec, function (aEntry) {
+      PageThumbsCache.getWriteEntry(url, function (aEntry) {
         if (!aEntry) {
           finish(false);
           return;
         }
 
         let outputStream = aEntry.openOutputStream(0);
 
         // Write the image data to the cache entry.