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

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

Issue 2720763002: PlzNavigate: preserve SourceLocation when navigating (Closed)
Patch Set: PlzNavigate: preserve SourceLocation when navigating Created 3 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/web/LocalFrameClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
index 73c1b65eae7e909e3c67d43e77b7aad96d22c5d4..348f30c675909d4dcad1716f70fcb89cfa298474 100644
--- a/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
+++ b/third_party/WebKit/Source/web/LocalFrameClientImpl.cpp
@@ -571,6 +571,17 @@ NavigationPolicy LocalFrameClientImpl::decidePolicyForNavigation(
if (form)
navigationInfo.form = WebFormElement(form);
+ std::unique_ptr<SourceLocation> sourceLocation =
+ SourceLocation::capture(m_webFrame->frame()->document());
+ if (sourceLocation && !sourceLocation->isUnknown()) {
+ navigationInfo.hasSourceLocation = true;
Nate Chapin 2017/03/01 23:22:19 Rather than have hasSourceLocation, could we eithe
clamy 2017/03/02 13:34:32 Done.
+ navigationInfo.sourceLocation.url = sourceLocation->url();
+ navigationInfo.sourceLocation.lineNumber = sourceLocation->lineNumber();
+ navigationInfo.sourceLocation.columnNumber = sourceLocation->columnNumber();
+ } else {
+ navigationInfo.hasSourceLocation = false;
+ }
+
WebNavigationPolicy webPolicy =
m_webFrame->client()->decidePolicyForNavigation(navigationInfo);
return static_cast<NavigationPolicy>(webPolicy);

Powered by Google App Engine
This is Rietveld 408576698