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,