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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.h

Issue 2416523002: Expose the initiating origin/URL of a navigation in the Blink public API (Closed)
Patch Set: Use less memory, add tests, etc. Created 4 years, 1 month 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/loader/DocumentLoader.h
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h
index 21af660142a3493b92cd39e5a1f50910b72cedba..7a7f40396ebf5b05bc58de71eddc298d0d5ae69e 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.h
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -72,8 +72,10 @@ class CORE_EXPORT DocumentLoader
static DocumentLoader* create(LocalFrame* frame,
const ResourceRequest& request,
const SubstituteData& data,
- ClientRedirectPolicy clientRedirectPolicy) {
- return new DocumentLoader(frame, request, data, clientRedirectPolicy);
+ ClientRedirectPolicy clientRedirectPolicy,
+ Document* requestorDocument = nullptr) {
dcheng 2016/11/23 08:32:59 The default arg made it easier to add this argumen
Mike West 2016/11/23 11:11:20 Looks like we only call it in ~5 places, mostly te
dcheng 2016/11/23 14:41:44 Done.
+ return new DocumentLoader(frame, request, data, clientRedirectPolicy,
+ requestorDocument);
}
~DocumentLoader() override;
@@ -188,7 +190,10 @@ class CORE_EXPORT DocumentLoader
DocumentLoader(LocalFrame*,
const ResourceRequest&,
const SubstituteData&,
- ClientRedirectPolicy);
+ ClientRedirectPolicy,
+ Document* requestorDocument);
+
+ Document* requestorDocument() const { return m_requestorDocument; }
void didRedirect(const KURL& oldURL, const KURL& newURL);
@@ -241,6 +246,8 @@ class CORE_EXPORT DocumentLoader
Member<DocumentWriter> m_writer;
+ Member<Document> m_requestorDocument;
+
// A reference to actual request used to create the data source.
// The only part of this request that should change is the url, and
// that only in the case of a same-document navigation.

Powered by Google App Engine
This is Rietveld 408576698