Bug 1539482 - Reduce the number of IPC calls on nsISHEntry in nsDocShell::LoadHistoryEntry, r=peterv, r=nika for adding sync IPC messages
In nsDocShell::LoadHistoryEntry method, when it gets called from parent process, there are 13 sync IPC calls on nsISHEntry that retrieve information from the session history entry and create a doc shell load state object using the retrieved information. By adding a new method 'CreateLoadInfo'on nsISHEntry, inside of which the doc shell load state object will be created (with appropriate data filled out) and returned, we eliminate 12 sync IPC call, resulting in just 1 IPC call to nsISHEntry::CreateLoadInfo. Differential Revision: https://phabricator.services.mozilla.com/D26042
This commit is contained in:
@@ -52,7 +52,6 @@ nsDocShellLoadState::nsDocShellLoadState(
|
||||
mOriginalFrameSrc = aLoadState.OriginalFrameSrc();
|
||||
mIsFormSubmission = aLoadState.IsFormSubmission();
|
||||
mLoadType = aLoadState.LoadType();
|
||||
mSrcdocData.SetIsVoid(true);
|
||||
mTarget = aLoadState.Target();
|
||||
mLoadFlags = aLoadState.LoadFlags();
|
||||
mFirstParty = aLoadState.FirstParty();
|
||||
@@ -66,11 +65,14 @@ nsDocShellLoadState::nsDocShellLoadState(
|
||||
mBaseURI = aLoadState.BaseURI();
|
||||
mTriggeringPrincipal = aLoadState.TriggeringPrincipal();
|
||||
mPrincipalToInherit = aLoadState.PrincipalToInherit();
|
||||
mStoragePrincipalToInherit = aLoadState.StoragePrincipalToInherit();
|
||||
mCsp = aLoadState.Csp();
|
||||
mOriginalURIString = aLoadState.OriginalURIString();
|
||||
mCancelContentJSEpoch = aLoadState.CancelContentJSEpoch();
|
||||
mPostDataStream = aLoadState.PostDataStream();
|
||||
mHeadersStream = aLoadState.HeadersStream();
|
||||
mSrcdocData = aLoadState.SrcdocData();
|
||||
mResultPrincipalURI = aLoadState.ResultPrincipalURI();
|
||||
}
|
||||
|
||||
nsDocShellLoadState::~nsDocShellLoadState() {}
|
||||
@@ -323,6 +325,15 @@ void nsDocShellLoadState::SetPrincipalToInherit(
|
||||
mPrincipalToInherit = aPrincipalToInherit;
|
||||
}
|
||||
|
||||
nsIPrincipal* nsDocShellLoadState::StoragePrincipalToInherit() const {
|
||||
return mStoragePrincipalToInherit;
|
||||
}
|
||||
|
||||
void nsDocShellLoadState::SetStoragePrincipalToInherit(
|
||||
nsIPrincipal* aStoragePrincipalToInherit) {
|
||||
mStoragePrincipalToInherit = aStoragePrincipalToInherit;
|
||||
}
|
||||
|
||||
void nsDocShellLoadState::SetCsp(nsIContentSecurityPolicy* aCsp) {
|
||||
mCsp = aCsp;
|
||||
}
|
||||
@@ -629,12 +640,15 @@ DocShellLoadStateInit nsDocShellLoadState::Serialize() {
|
||||
loadState.BaseURI() = mBaseURI;
|
||||
loadState.TriggeringPrincipal() = mTriggeringPrincipal;
|
||||
loadState.PrincipalToInherit() = mPrincipalToInherit;
|
||||
loadState.StoragePrincipalToInherit() = mStoragePrincipalToInherit;
|
||||
loadState.Csp() = mCsp;
|
||||
loadState.OriginalURIString() = mOriginalURIString;
|
||||
loadState.CancelContentJSEpoch() = mCancelContentJSEpoch;
|
||||
loadState.ReferrerInfo() = mReferrerInfo;
|
||||
loadState.PostDataStream() = mPostDataStream;
|
||||
loadState.HeadersStream() = mHeadersStream;
|
||||
loadState.SrcdocData() = mSrcdocData;
|
||||
loadState.ResultPrincipalURI() = mResultPrincipalURI;
|
||||
|
||||
return loadState;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user