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

Unified Diff: third_party/WebKit/Source/web/WebDataSourceImpl.cpp

Issue 2416523002: Expose the initiating origin/URL of a navigation in the Blink public API (Closed)
Patch Set: rebase 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/web/WebDataSourceImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
index 87d7436594aaa6c661bb7cdb376afe18dc1db45a..1c610593947b1464897666c9f4457a9963ca7691 100644
--- a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
+++ b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
@@ -44,8 +44,14 @@ WebDataSourceImpl* WebDataSourceImpl::create(
LocalFrame* frame,
const ResourceRequest& request,
const SubstituteData& data,
- ClientRedirectPolicy clientRedirectPolicy) {
- return new WebDataSourceImpl(frame, request, data, clientRedirectPolicy);
+ ClientRedirectPolicy clientRedirectPolicy,
+ Document* requestorDocument) {
+ return new WebDataSourceImpl(frame, request, data, clientRedirectPolicy,
+ requestorDocument);
+}
+
+WebURL WebDataSourceImpl::requestorURL() const {
+ return requestorDocument() ? WebURL(requestorDocument()->url()) : WebURL();
}
const WebURLRequest& WebDataSourceImpl::originalRequest() const {
@@ -139,8 +145,13 @@ WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type) {
WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame,
const ResourceRequest& request,
const SubstituteData& data,
- ClientRedirectPolicy clientRedirectPolicy)
- : DocumentLoader(frame, request, data, clientRedirectPolicy),
+ ClientRedirectPolicy clientRedirectPolicy,
+ Document* requestorDocument)
+ : DocumentLoader(frame,
+ request,
+ data,
+ clientRedirectPolicy,
+ requestorDocument),
m_originalRequestWrapper(DocumentLoader::originalRequest()),
m_requestWrapper(DocumentLoader::request()),
m_responseWrapper(DocumentLoader::response()) {}
« no previous file with comments | « third_party/WebKit/Source/web/WebDataSourceImpl.h ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698