summaryrefslogtreecommitdiffstats
path: root/toolkit/components/sessionstore/SessionStoreParent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/sessionstore/SessionStoreParent.cpp')
-rw-r--r--toolkit/components/sessionstore/SessionStoreParent.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/toolkit/components/sessionstore/SessionStoreParent.cpp b/toolkit/components/sessionstore/SessionStoreParent.cpp
index 58be84d4d9..b917990633 100644
--- a/toolkit/components/sessionstore/SessionStoreParent.cpp
+++ b/toolkit/components/sessionstore/SessionStoreParent.cpp
@@ -19,7 +19,7 @@
#include "mozilla/dom/InProcessParent.h"
#include "mozilla/dom/SessionStoreChild.h"
#include "mozilla/dom/SessionStoreUtilsBinding.h"
-#include "SessionStoreFunctions.h"
+#include "nsISessionStoreFunctions.h"
#include "nsISupports.h"
#include "nsIXULRuntime.h"
#include "nsImportModule.h"
@@ -146,9 +146,14 @@ static void DoSessionStoreUpdate(CanonicalBrowsingContext* aBrowsingContext,
data.mScroll.Construct(aScroll);
}
- nsCOMPtr<nsISessionStoreFunctions> funcs = do_ImportESModule(
- "resource://gre/modules/SessionStoreFunctions.sys.mjs", fallible);
- nsCOMPtr<nsIXPConnectWrappedJS> wrapped = do_QueryInterface(funcs);
+ nsCOMPtr<nsISessionStoreFunctions> sessionStoreFuncs =
+ do_GetService("@mozilla.org/toolkit/sessionstore-functions;1");
+ if (!sessionStoreFuncs) {
+ return;
+ }
+
+ nsCOMPtr<nsIXPConnectWrappedJS> wrapped =
+ do_QueryInterface(sessionStoreFuncs);
if (!wrapped) {
return;
}
@@ -166,8 +171,8 @@ static void DoSessionStoreUpdate(CanonicalBrowsingContext* aBrowsingContext,
JS::Rooted<JS::Value> key(jsapi.cx(),
aBrowsingContext->Top()->PermanentKey());
- Unused << funcs->UpdateSessionStore(nullptr, aBrowsingContext, key, aEpoch,
- aNeedCollectSHistory, update);
+ Unused << sessionStoreFuncs->UpdateSessionStore(
+ nullptr, aBrowsingContext, key, aEpoch, aNeedCollectSHistory, update);
}
#endif