diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/components/sessionstore/SessionStoreListener.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/sessionstore/SessionStoreListener.cpp')
-rw-r--r-- | toolkit/components/sessionstore/SessionStoreListener.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/toolkit/components/sessionstore/SessionStoreListener.cpp b/toolkit/components/sessionstore/SessionStoreListener.cpp index 11b9966954..c8135752f5 100644 --- a/toolkit/components/sessionstore/SessionStoreListener.cpp +++ b/toolkit/components/sessionstore/SessionStoreListener.cpp @@ -24,7 +24,7 @@ #include "nsIXULRuntime.h" #include "nsPresContext.h" #include "nsPrintfCString.h" -#include "SessionStoreFunctions.h" +#include "nsISessionStoreFunctions.h" using namespace mozilla; using namespace mozilla::dom; @@ -436,9 +436,13 @@ void TabListener::UpdateSessionStore(bool aIsFlush) { data.mIsPrivate.Construct() = mSessionStore->GetPrivateModeEnabled(); } - 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; } @@ -456,7 +460,7 @@ void TabListener::UpdateSessionStore(bool aIsFlush) { JS::Rooted<JS::Value> key(jsapi.cx(), context->Canonical()->Top()->PermanentKey()); - nsresult rv = funcs->UpdateSessionStore( + nsresult rv = sessionStoreFuncs->UpdateSessionStore( mOwnerContent, context, key, mEpoch, mSessionStore->GetAndClearSHistoryChanged(), update); if (NS_FAILED(rv)) { |