Chromium Code Reviews| 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; |