зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1560940 - Change tests that use session history listeners to listen in the parent process. r=nika
Expose SHistory object from CanonicalBrowsingContext. Differential Revision: https://phabricator.services.mozilla.com/D35654 --HG-- extra : rebase_source : 83b465a1ea387d79889f9cec73f3129adca66016 extra : source : 6d2db7f001668a7a18e7c8dc0693236d6f6964ba extra : histedit_source : cced2d0317eef396dacd626b72cebf9625238897
This commit is contained in:
Родитель
1fb1e00105
Коммит
1fa7fd2c48
|
@ -154,12 +154,14 @@ JSObject* CanonicalBrowsingContext::WrapObject(
|
|||
void CanonicalBrowsingContext::Traverse(
|
||||
nsCycleCollectionTraversalCallback& cb) {
|
||||
CanonicalBrowsingContext* tmp = this;
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowGlobals, mCurrentWindowGlobal);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowGlobals, mCurrentWindowGlobal,
|
||||
mSessionHistory);
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::Unlink() {
|
||||
CanonicalBrowsingContext* tmp = this;
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowGlobals, mCurrentWindowGlobal);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowGlobals, mCurrentWindowGlobal,
|
||||
mSessionHistory);
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::NotifyStartDelayedAutoplayMedia() {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "nsWrapperCache.h"
|
||||
#include "nsTHashtable.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsISHistory.h"
|
||||
|
||||
class nsIDocShell;
|
||||
|
||||
|
@ -60,6 +61,10 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
|||
|
||||
already_AddRefed<WindowGlobalParent> GetEmbedderWindowGlobal() const;
|
||||
|
||||
nsISHistory* GetSessionHistory() { return mSessionHistory; }
|
||||
void SetSessionHistory(nsISHistory* aSHistory) {
|
||||
mSessionHistory = aSHistory;
|
||||
}
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
|
@ -144,6 +149,8 @@ class CanonicalBrowsingContext final : public BrowsingContext {
|
|||
|
||||
// The current remoteness change which is in a pending state.
|
||||
RefPtr<PendingRemotenessChange> mPendingRemotenessChange;
|
||||
|
||||
nsCOMPtr<nsISHistory> mSessionHistory;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -12,6 +12,13 @@
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
LegacySHistory::LegacySHistory(CanonicalBrowsingContext* aRootBC,
|
||||
const nsID& aDocShellID)
|
||||
: nsSHistory(aRootBC, aDocShellID) {
|
||||
mIsRemote = true;
|
||||
aRootBC->SetSessionHistory(this);
|
||||
}
|
||||
|
||||
static void FillInLoadResult(PContentParent* aManager, nsresult aRv,
|
||||
const nsSHistory::LoadEntryResult& aLoadResult,
|
||||
LoadSHEntryResult* aResult) {
|
||||
|
|
|
@ -27,11 +27,8 @@ class LegacySHistory final : public nsSHistory {
|
|||
virtual ~LegacySHistory() {}
|
||||
|
||||
public:
|
||||
LegacySHistory(mozilla::dom::BrowsingContext* aRootBC,
|
||||
const nsID& aDocShellID)
|
||||
: nsSHistory(aRootBC, aDocShellID) {
|
||||
mIsRemote = true;
|
||||
}
|
||||
LegacySHistory(mozilla::dom::CanonicalBrowsingContext* aRootBC,
|
||||
const nsID& aDocShellID);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,6 +86,8 @@ interface CanonicalBrowsingContext : BrowsingContext {
|
|||
[Throws]
|
||||
Promise<unsigned long long> changeFrameRemoteness(
|
||||
DOMString remoteType, unsigned long long pendingSwitchId);
|
||||
|
||||
readonly attribute nsISHistory? sessionHistory;
|
||||
};
|
||||
|
||||
[Exposed=Window, ChromeOnly]
|
||||
|
|
Загрузка…
Ссылка в новой задаче