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

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: Fix typo 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..b4ca61cab898e12748fbb345d47fc81cb2dea7f5 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 m_requestorDocument->url();
}
const WebURLRequest& WebDataSourceImpl::originalRequest() const {
@@ -139,8 +145,10 @@ WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type) {
WebDataSourceImpl::WebDataSourceImpl(LocalFrame* frame,
const ResourceRequest& request,
const SubstituteData& data,
- ClientRedirectPolicy clientRedirectPolicy)
+ ClientRedirectPolicy clientRedirectPolicy,
+ Document* requestorDocument)
: DocumentLoader(frame, request, data, clientRedirectPolicy),
+ m_requestorDocument(requestorDocument),
m_originalRequestWrapper(DocumentLoader::originalRequest()),
m_requestWrapper(DocumentLoader::request()),
m_responseWrapper(DocumentLoader::response()) {}
@@ -162,6 +170,7 @@ void WebDataSourceImpl::setSubresourceFilter(
DEFINE_TRACE(WebDataSourceImpl) {
DocumentLoader::trace(visitor);
+ visitor->trace(m_requestorDocument);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698