зеркало из https://github.com/mozilla/gecko-dev.git
Bug 996785 - Fix existing CPOW uses to prepare for weak references (r=mrbkap)
This commit is contained in:
Родитель
c9f2d3779d
Коммит
66f604e9e1
|
@ -11,7 +11,7 @@ Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
|||
Cu.import("resource://gre/modules/RemoteAddonsChild.jsm");
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
let SyncHandler = {
|
||||
let FocusSyncHandler = {
|
||||
init: function() {
|
||||
sendAsyncMessage("SetSyncHandler", {}, {handler: this});
|
||||
},
|
||||
|
@ -25,7 +25,7 @@ let SyncHandler = {
|
|||
},
|
||||
};
|
||||
|
||||
SyncHandler.init();
|
||||
FocusSyncHandler.init();
|
||||
|
||||
let WebProgressListener = {
|
||||
init: function() {
|
||||
|
@ -122,8 +122,6 @@ let WebProgressListener = {
|
|||
WebProgressListener.init();
|
||||
|
||||
let WebNavigation = {
|
||||
_webNavigation: docShell.QueryInterface(Ci.nsIWebNavigation),
|
||||
|
||||
init: function() {
|
||||
addMessageListener("WebNavigation:GoBack", this);
|
||||
addMessageListener("WebNavigation:GoForward", this);
|
||||
|
@ -132,8 +130,13 @@ let WebNavigation = {
|
|||
addMessageListener("WebNavigation:Reload", this);
|
||||
addMessageListener("WebNavigation:Stop", this);
|
||||
|
||||
// Send a CPOW for the sessionHistory object.
|
||||
let history = this._webNavigation.sessionHistory;
|
||||
this._webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
this._sessionHistory = this._webNavigation.sessionHistory;
|
||||
|
||||
// Send a CPOW for the sessionHistory object. We need to make sure
|
||||
// it stays alive as long as the content script since CPOWs are
|
||||
// weakly held.
|
||||
let history = this._sessionHistory;
|
||||
sendAsyncMessage("WebNavigation:setHistory", {}, {history: history});
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче