Bug 957150 - Fix errors in history deserialization on Metro [r=TimAbraldes a=lsblakk]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 15 Jan 2014 07:56:15 -0800
changeset 175848 df0434426efef71b92b718aacf80e1d183d39d5d
parent 175847 d4f1634861e908d6e64251582be9c8f87416f87c
child 175849 594af05e92a341c4ecf67bfda65af680ad5167f7
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersTimAbraldes, lsblakk
bugs957150
milestone28.0a2
Bug 957150 - Fix errors in history deserialization on Metro [r=TimAbraldes a=lsblakk]
browser/metro/base/content/bindings/browser.js
--- a/browser/metro/base/content/bindings/browser.js
+++ b/browser/metro/base/content/bindings/browser.js
@@ -4,19 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let Cc = Components.classes;
 let Ci = Components.interfaces;
 let Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 
-XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator",
-                                   "@mozilla.org/uuid-generator;1", "nsIUUIDGenerator");
-
 let WebProgressListener = {
   _lastLocation: null,
   _firstPaint: false,
 
   init: function() {
     let flags = Ci.nsIWebProgress.NOTIFY_LOCATION |
                 Ci.nsIWebProgress.NOTIFY_SECURITY |
                 Ci.nsIWebProgress.NOTIFY_STATE_WINDOW |
@@ -258,17 +255,17 @@ let WebNavigation =  {
       shEntry.cacheKey = cacheKey;
     }
 
     if (aEntry.ID) {
       // get a new unique ID for this frame (since the one from the last
       // start might already be in use)
       let id = aIdMap[aEntry.ID] || 0;
       if (!id) {
-        id = gUUIDGenerator.generateUUID();
+        for (id = Date.now(); id in aIdMap.used; id++);
         aIdMap[aEntry.ID] = id;
         aIdMap.used[id] = true;
       }
       shEntry.ID = id;
     }
 
     if (aEntry.docshellID)
       shEntry.docshellID = aEntry.docshellID;
@@ -293,17 +290,17 @@ let WebNavigation =  {
       // which matches that doc identifier and adopt that SHEntry's
       // BFCacheEntry.  If we don't find a match, insert shEntry as the match
       // for the document identifier.
       let matchingEntry = aDocIdentMap[aEntry.docIdentifier];
       if (!matchingEntry) {
         matchingEntry = {shEntry: shEntry, childDocIdents: childDocIdents};
         aDocIdentMap[aEntry.docIdentifier] = matchingEntry;
       } else {
-        shEntry.adoptBFCacheEntry(matchingEntry);
+        shEntry.adoptBFCacheEntry(matchingEntry.shEntry);
         childDocIdents = matchingEntry.childDocIdents;
       }
     }
 
     if (aEntry.owner_b64) {
       let ownerInput = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
       let binaryData = atob(aEntry.owner_b64);
       ownerInput.setData(binaryData, binaryData.length);