# HG changeset patch
# User Dragana Damjanovic
# Parent 7eb3814fa06d0d5a0950c667ee6bc92bbb25aadc
Bug 1246956 - Add originURI to Sessionstore. r=bz
diff --git a/browser/components/sessionstore/SessionHistory.jsm b/browser/components/sessionstore/SessionHistory.jsm
--- a/browser/components/sessionstore/SessionHistory.jsm
+++ b/browser/components/sessionstore/SessionHistory.jsm
@@ -187,16 +187,23 @@ let SessionHistoryInternal = {
// We will include the property only if it's truthy to save a couple of
// bytes when the resulting object is stringified and saved to disk.
if (shEntry.referrerURI) {
entry.referrer = shEntry.referrerURI.spec;
entry.referrerPolicy = shEntry.referrerPolicy;
}
+ var shEntryESR38 = shEntry.QueryInterface(Ci.nsISHEntry_ESR38);
+ if (shEntryESR38) {
+ if (shEntryESR38.originalURI) {
+ entry.originalURI = shEntryESR38.originalURI.spec;
+ }
+ }
+
if (shEntry.srcdocData)
entry.srcdocData = shEntry.srcdocData;
if (shEntry.isSrcdocEntry)
entry.isSrcdocEntry = shEntry.isSrcdocEntry;
if (shEntry.baseURI)
entry.baseURI = shEntry.baseURI.spec;
@@ -328,29 +335,32 @@ let SessionHistoryInternal = {
* Hash for ensuring unique frame IDs
* @param docIdentMap
* Hash to ensure reuse of BFCache entries
* @returns nsISHEntry
*/
deserializeEntry: function (entry, idMap, docIdentMap) {
var shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].
- createInstance(Ci.nsISHEntry);
+ createInstance(Ci.nsISHEntry_ESR38);
shEntry.setURI(Utils.makeURI(entry.url));
shEntry.setTitle(entry.title || entry.url);
if (entry.subframe)
shEntry.setIsSubFrame(entry.subframe || false);
shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory;
if (entry.contentType)
shEntry.contentType = entry.contentType;
if (entry.referrer) {
shEntry.referrerURI = Utils.makeURI(entry.referrer);
shEntry.referrerPolicy = entry.referrerPolicy;
}
+ if (entry.originalURI) {
+ shEntry.originalURI = Utils.makeURI(entry.originalURI);
+ }
if (entry.isSrcdocEntry)
shEntry.srcdocData = entry.srcdocData;
if (entry.baseURI)
shEntry.baseURI = Utils.makeURI(entry.baseURI);
if (entry.cacheKey) {
var cacheKey = Cc["@mozilla.org/supports-PRUint32;1"].
createInstance(Ci.nsISupportsPRUint32);
diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -734,16 +734,23 @@ SessionStore.prototype = {
entry.ID = aEntry.ID;
entry.docshellID = aEntry.docshellID;
if (aEntry.referrerURI) {
entry.referrer = aEntry.referrerURI.spec;
}
+ var entryESR38 = shEntry.QueryInterface(Ci.nsISHEntry_ESR38);
+ if (entryESR38) {
+ if (entryESR38.originalURI) {
+ entry.originalURI = entryESR38.originalURI.spec;
+ }
+ }
+
if (aEntry.contentType) {
entry.contentType = aEntry.contentType;
}
let x = {}, y = {};
aEntry.getScrollPosition(x, y);
if (x.value != 0 || y.value != 0) {
entry.scroll = x.value + "," + y.value;
@@ -799,31 +806,35 @@ SessionStore.prototype = {
entry.children = children;
}
}
return entry;
},
_deserializeHistoryEntry: function _deserializeHistoryEntry(aEntry, aIdMap, aDocIdentMap) {
- let shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].createInstance(Ci.nsISHEntry);
+ let shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].createInstance(Ci.nsISHEntry_ESR38);
shEntry.setURI(Services.io.newURI(aEntry.url, null, null));
shEntry.setTitle(aEntry.title || aEntry.url);
if (aEntry.subframe) {
shEntry.setIsSubFrame(aEntry.subframe || false);
}
shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory;
if (aEntry.contentType) {
shEntry.contentType = aEntry.contentType;
}
if (aEntry.referrer) {
shEntry.referrerURI = Services.io.newURI(aEntry.referrer, null, null);
}
+ if (aEntry.originalURI) {
+ shEntry.originalURI = Services.io.newURI(aEntry.originalURI, null, null);
+ }
+
if (aEntry.cacheKey) {
let cacheKey = Cc["@mozilla.org/supports-PRUint32;1"].createInstance(Ci.nsISupportsPRUint32);
cacheKey.data = aEntry.cacheKey;
shEntry.cacheKey = cacheKey;
}
if (aEntry.ID) {
// get a new unique ID for this frame (since the one from the last