зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1659991 - Generate an id if we create a new session history entry in the child process. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87742
This commit is contained in:
Родитель
a4a8b3da89
Коммит
6e49bf5815
|
@ -129,10 +129,9 @@ SessionHistoryInfo::SharedState SessionHistoryInfo::SharedState::Create(
|
|||
aPartitionedPrincipalToInherit, aCsp, aContentType));
|
||||
}
|
||||
|
||||
// FIXME Pass the correct ID!!!
|
||||
return SharedState(MakeUnique<SHEntrySharedState>(
|
||||
0, aTriggeringPrincipal, aPrincipalToInherit,
|
||||
aPartitionedPrincipalToInherit, aCsp, aContentType));
|
||||
aTriggeringPrincipal, aPrincipalToInherit, aPartitionedPrincipalToInherit,
|
||||
aCsp, aContentType));
|
||||
}
|
||||
|
||||
SessionHistoryInfo::SharedState::SharedState() {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "nsSHEntryShared.h"
|
||||
|
||||
#include "nsArray.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDocShellEditorData.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsISHistory.h"
|
||||
|
@ -28,13 +29,17 @@ uint64_t gSHEntrySharedID = 0;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/* static */
|
||||
uint64_t SHEntrySharedState::GenerateId() {
|
||||
return nsContentUtils::GenerateProcessSpecificId(++gSHEntrySharedID);
|
||||
}
|
||||
|
||||
SHEntrySharedParentState::SHEntrySharedParentState(
|
||||
nsIPrincipal* aTriggeringPrincipal, nsIPrincipal* aPrincipalToInherit,
|
||||
nsIPrincipal* aPartitionedPrincipalToInherit,
|
||||
nsIContentSecurityPolicy* aCsp, const nsACString& aContentType)
|
||||
: SHEntrySharedState(++gSHEntrySharedID, aTriggeringPrincipal,
|
||||
aPrincipalToInherit, aPartitionedPrincipalToInherit,
|
||||
aCsp, aContentType) {}
|
||||
: SHEntrySharedState(aTriggeringPrincipal, aPrincipalToInherit,
|
||||
aPartitionedPrincipalToInherit, aCsp, aContentType) {}
|
||||
|
||||
SHEntrySharedParentState::~SHEntrySharedParentState() {}
|
||||
|
||||
|
|
|
@ -48,14 +48,14 @@ class Document;
|
|||
* parent process.
|
||||
*/
|
||||
struct SHEntrySharedState {
|
||||
SHEntrySharedState() = default;
|
||||
SHEntrySharedState() : mId(GenerateId()) {}
|
||||
SHEntrySharedState(const SHEntrySharedState& aState) = default;
|
||||
SHEntrySharedState(uint64_t aId, nsIPrincipal* aTriggeringPrincipal,
|
||||
SHEntrySharedState(nsIPrincipal* aTriggeringPrincipal,
|
||||
nsIPrincipal* aPrincipalToInherit,
|
||||
nsIPrincipal* aPartitionedPrincipalToInherit,
|
||||
nsIContentSecurityPolicy* aCsp,
|
||||
const nsACString& aContentType)
|
||||
: mId(aId),
|
||||
: mId(GenerateId()),
|
||||
mTriggeringPrincipal(aTriggeringPrincipal),
|
||||
mPrincipalToInherit(aPrincipalToInherit),
|
||||
mPartitionedPrincipalToInherit(aPartitionedPrincipalToInherit),
|
||||
|
@ -77,6 +77,9 @@ struct SHEntrySharedState {
|
|||
// moved to bfcache.
|
||||
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
|
||||
uint32_t mCacheKey = 0;
|
||||
|
||||
protected:
|
||||
static uint64_t GenerateId();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче