Bug 1222464 - Part 1: Save a client ID for top-level navigations on the docshell and assign it as the document ID when we start loading the document; r=jdm

For top-level navigations, we need to compute the client ID when we decide to
intercept the document load, and we need to make sure the document that will
be created later will end up using that same ID.
This commit is contained in:
Ehsan Akhgari
2015-11-25 18:03:59 -05:00
parent c69751b438
commit f08794455e
8 changed files with 68 additions and 27 deletions

View File

@@ -14163,6 +14163,11 @@ nsDocShell::ChannelIntercepted(nsIInterceptedChannel* aChannel,
if (!doc) {
return NS_ERROR_NOT_AVAILABLE;
}
} else {
// For top-level navigations, save a document ID which will be passed to
// the FetchEvent as the clientId later on.
rv = nsIDocument::GenerateDocumentId(mInterceptedDocumentId);
NS_ENSURE_SUCCESS(rv, rv);
}
bool isReload = mLoadType & LOAD_CMD_RELOAD;