Bug 1224865: Don't set a document in FetchDriver for requests in workers. r=bkelly

This commit is contained in:
Jonas Sicking 2015-11-16 11:43:12 -08:00
parent 4ab9e210d3
commit 4e4332aa98
2 changed files with 2 additions and 9 deletions

View File

@ -136,11 +136,6 @@ public:
nsCOMPtr<nsILoadGroup> loadGroup = proxy->GetWorkerPrivate()->GetLoadGroup();
MOZ_ASSERT(loadGroup);
RefPtr<FetchDriver> fetch = new FetchDriver(mRequest, principal, loadGroup);
nsIDocument* doc = proxy->GetWorkerPrivate()->GetDocument();
if (doc) {
fetch->SetDocument(doc);
}
nsresult rv = fetch->Fetch(mResolver);
// Right now we only support async fetch, which should never directly fail.
if (NS_WARN_IF(NS_FAILED(rv))) {

View File

@ -241,10 +241,8 @@ FetchDriver::HttpFetch()
MOZ_ASSERT(mLoadGroup);
nsCOMPtr<nsIChannel> chan;
// For dedicated workers mDocument refers to the parent document of the
// worker (why do we do that?). In that case we don't want to use the
// document here since that is not the correct principal.
if (mDocument && mDocument->NodePrincipal() == mPrincipal) {
if (mDocument) {
MOZ_ASSERT(mDocument->NodePrincipal() == mPrincipal);
rv = NS_NewChannel(getter_AddRefs(chan),
uri,
mDocument,