Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: third_party/WebKit/Source/core/dom/DocumentInit.cpp

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/DocumentInit.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentInit.cpp b/third_party/WebKit/Source/core/dom/DocumentInit.cpp
index c75e302fb53fa52ee48faf6f25fb67338b1af2fe..0b8649257cded3a786628475555d5fbcd7b20698 100644
--- a/third_party/WebKit/Source/core/dom/DocumentInit.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentInit.cpp
@@ -49,25 +49,16 @@ static Document* parentDocument(LocalFrame* frame)
return &ownerElement->document();
}
-
-static Document* ownerDocument(LocalFrame* frame)
+DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtrWillBeRawPtr<Document> contextDocument, HTMLImportsController* importsController)
+ : DocumentInit(nullptr, url, frame, contextDocument, importsController)
{
- if (!frame)
- return 0;
-
- Frame* ownerFrame = frame->tree().parent();
- if (!ownerFrame)
- ownerFrame = frame->loader().opener();
- if (!ownerFrame || !ownerFrame->isLocalFrame())
- return 0;
- return toLocalFrame(ownerFrame)->document();
}
-DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtrWillBeRawPtr<Document> contextDocument, HTMLImportsController* importsController)
+DocumentInit::DocumentInit(PassRefPtrWillBeRawPtr<Document> ownerDocument, const KURL& url, LocalFrame* frame, WeakPtrWillBeRawPtr<Document> contextDocument, HTMLImportsController* importsController)
: m_url(url)
, m_frame(frame)
, m_parent(parentDocument(frame))
- , m_owner(ownerDocument(frame))
+ , m_owner(ownerDocument)
, m_contextDocument(contextDocument)
, m_importsController(importsController)
, m_createNewRegistrationContext(false)

Powered by Google App Engine
This is Rietveld 408576698