From 4e4332aa982e35e911116e9da5d3816a4482bc80 Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Mon, 16 Nov 2015 11:43:12 -0800 Subject: [PATCH] Bug 1224865: Don't set a document in FetchDriver for requests in workers. r=bkelly --- dom/fetch/Fetch.cpp | 5 ----- dom/fetch/FetchDriver.cpp | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index 7468b5545cb..8cd2ec76335 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -136,11 +136,6 @@ public: nsCOMPtr loadGroup = proxy->GetWorkerPrivate()->GetLoadGroup(); MOZ_ASSERT(loadGroup); RefPtr 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))) { diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index cdc62db8eca..50c31bec433 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -241,10 +241,8 @@ FetchDriver::HttpFetch() MOZ_ASSERT(mLoadGroup); nsCOMPtr 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,