Bug 1266223 - Add logging for session store closed tab data messaging. r=margaret
MozReview-Commit-ID: AWyq0q7HiB0
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -188,20 +188,22 @@ SessionStore.prototype = {
// executed. After onPause, the application may be terminated at any
// point without notice; therefore, we must synchronously write out any
// pending save state to ensure that this data does not get lost.
log("application-background");
this.flushPendingState();
break;
case "ClosedTabs:StartNotifications":
this._notifyClosedTabs = true;
+ log("ClosedTabs:StartNotifications");
this._sendClosedTabsToJava(Services.wm.getMostRecentWindow("navigator:browser"));
break;
case "ClosedTabs:StopNotifications":
this._notifyClosedTabs = false;
+ log("ClosedTabs:StopNotifications");
break;
case "last-pb-context-exited":
// Clear private closed tab data when we leave private browsing.
for (let [, window] in Iterator(this._windows)) {
window.closedTabs = window.closedTabs.filter(tab => !tab.isPrivate);
}
this._lastClosedTabIndex = -1;
break;
@@ -1221,16 +1223,17 @@ SessionStore.prototype = {
tab.browser.__SS_restore = true;
tab.browser.setAttribute("pending", "true");
}
}
// Restore the closed tabs array on the current window.
if (state.windows[0].closedTabs) {
this._windows[window.__SSID].closedTabs = state.windows[0].closedTabs;
+ log("_restoreWindow() loaded " + state.windows[0].closedTabs.length + " closed tabs");
}
},
getClosedTabCount: function ss_getClosedTabCount(aWindow) {
if (!aWindow || !aWindow.__SSID || !this._windows[aWindow.__SSID]) {
return 0; // not a browser window, or not otherwise tracked by SS.
}
@@ -1324,16 +1327,17 @@ SessionStore.prototype = {
let lastEntry = tab.entries[tab.entries.length - 1];
return {
url: lastEntry.url,
title: lastEntry.title || "",
data: tab
};
});
+ log("sending " + tabs.length + " closed tabs to Java");
Messaging.sendRequest({
type: "ClosedTabs:Data",
tabs: tabs
});
},
getTabValue: function ss_getTabValue(aTab, aKey) {
let browser = aTab.browser;