summaryrefslogtreecommitdiffstats
path: root/docshell/base/CanonicalBrowsingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'docshell/base/CanonicalBrowsingContext.cpp')
-rw-r--r--docshell/base/CanonicalBrowsingContext.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp
index 4c92988c9b..78de7474b0 100644
--- a/docshell/base/CanonicalBrowsingContext.cpp
+++ b/docshell/base/CanonicalBrowsingContext.cpp
@@ -59,7 +59,7 @@
#include "nsBrowserStatusFilter.h"
#include "nsIBrowser.h"
#include "nsTHashSet.h"
-#include "SessionStoreFunctions.h"
+#include "nsISessionStoreFunctions.h"
#include "nsIXPConnect.h"
#include "nsImportModule.h"
#include "UnitTransforms.h"
@@ -2673,13 +2673,14 @@ void CanonicalBrowsingContext::RestoreState::Resolve() {
nsresult CanonicalBrowsingContext::WriteSessionStorageToSessionStore(
const nsTArray<SSCacheCopy>& aSesssionStorage, uint32_t aEpoch) {
- nsCOMPtr<nsISessionStoreFunctions> funcs = do_ImportESModule(
- "resource://gre/modules/SessionStoreFunctions.sys.mjs", fallible);
- if (!funcs) {
+ nsCOMPtr<nsISessionStoreFunctions> sessionStoreFuncs =
+ do_GetService("@mozilla.org/toolkit/sessionstore-functions;1");
+ if (!sessionStoreFuncs) {
return NS_ERROR_FAILURE;
}
- nsCOMPtr<nsIXPConnectWrappedJS> wrapped = do_QueryInterface(funcs);
+ nsCOMPtr<nsIXPConnectWrappedJS> wrapped =
+ do_QueryInterface(sessionStoreFuncs);
AutoJSAPI jsapi;
if (!jsapi.Init(wrapped->GetJSObjectGlobal())) {
return NS_ERROR_FAILURE;
@@ -2700,8 +2701,8 @@ nsresult CanonicalBrowsingContext::WriteSessionStorageToSessionStore(
update.setNull();
}
- return funcs->UpdateSessionStoreForStorage(Top()->GetEmbedderElement(), this,
- key, aEpoch, update);
+ return sessionStoreFuncs->UpdateSessionStoreForStorage(
+ Top()->GetEmbedderElement(), this, key, aEpoch, update);
}
void CanonicalBrowsingContext::UpdateSessionStoreSessionStorage(