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

Unified Diff: third_party/WebKit/Source/core/dom/Document.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/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 68f3db8462f93e3e8ca826cb651871163efc95cb..99ab86995cc48f407f6bbda7a60c3d4706409a95 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5808,6 +5808,21 @@ void Document::addConsoleMessage(ConsoleMessage* consoleMessage) {
if (!m_frame)
return;
+ // PlzNavigate: when trying to commit a navigation, the SourceLocation
+ // information for how the request was triggered has been stored in the
+ // provisional DocumentLoader. Use it instead.
+ DocumentLoader* provisionalLoader =
+ m_frame->loader().provisionalDocumentLoader();
Nate Chapin 2017/03/01 23:22:19 This seems wrong. Anything going through a Documen
clamy 2017/03/02 13:34:32 I thought the message I whose SourceLocation I nee
+ if (provisionalLoader) {
+ std::unique_ptr<SourceLocation> sourceLocation =
+ provisionalLoader->copySourceLocation();
+ if (sourceLocation) {
+ consoleMessage = ConsoleMessage::create(
+ consoleMessage->source(), consoleMessage->level(),
+ consoleMessage->message(), std::move(sourceLocation));
+ }
+ }
+
if (consoleMessage->location()->isUnknown()) {
// TODO(dgozman): capture correct location at call places instead.
unsigned lineNumber = 0;

Powered by Google App Engine
This is Rietveld 408576698