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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 5790 matching lines...) Expand 10 before | Expand all | Expand 10 after
5801 BLINK_FROM_HERE, 5801 BLINK_FROM_HERE,
5802 crossThreadBind(&runAddConsoleMessageTask, consoleMessage->source(), 5802 crossThreadBind(&runAddConsoleMessageTask, consoleMessage->source(),
5803 consoleMessage->level(), consoleMessage->message(), 5803 consoleMessage->level(), consoleMessage->message(),
5804 wrapCrossThreadPersistent(this))); 5804 wrapCrossThreadPersistent(this)));
5805 return; 5805 return;
5806 } 5806 }
5807 5807
5808 if (!m_frame) 5808 if (!m_frame)
5809 return; 5809 return;
5810 5810
5811 // PlzNavigate: when trying to commit a navigation, the SourceLocation
5812 // information for how the request was triggered has been stored in the
5813 // provisional DocumentLoader. Use it instead.
5814 DocumentLoader* provisionalLoader =
5815 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
5816 if (provisionalLoader) {
5817 std::unique_ptr<SourceLocation> sourceLocation =
5818 provisionalLoader->copySourceLocation();
5819 if (sourceLocation) {
5820 consoleMessage = ConsoleMessage::create(
5821 consoleMessage->source(), consoleMessage->level(),
5822 consoleMessage->message(), std::move(sourceLocation));
5823 }
5824 }
5825
5811 if (consoleMessage->location()->isUnknown()) { 5826 if (consoleMessage->location()->isUnknown()) {
5812 // TODO(dgozman): capture correct location at call places instead. 5827 // TODO(dgozman): capture correct location at call places instead.
5813 unsigned lineNumber = 0; 5828 unsigned lineNumber = 0;
5814 if (!isInDocumentWrite() && scriptableDocumentParser()) { 5829 if (!isInDocumentWrite() && scriptableDocumentParser()) {
5815 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5830 ScriptableDocumentParser* parser = scriptableDocumentParser();
5816 if (parser->isParsingAtLineNumber()) 5831 if (parser->isParsingAtLineNumber())
5817 lineNumber = parser->lineNumber().oneBasedInt(); 5832 lineNumber = parser->lineNumber().oneBasedInt();
5818 } 5833 }
5819 consoleMessage = ConsoleMessage::create( 5834 consoleMessage = ConsoleMessage::create(
5820 consoleMessage->source(), consoleMessage->level(), 5835 consoleMessage->source(), consoleMessage->level(),
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
6661 } 6676 }
6662 6677
6663 void showLiveDocumentInstances() { 6678 void showLiveDocumentInstances() {
6664 WeakDocumentSet& set = liveDocumentSet(); 6679 WeakDocumentSet& set = liveDocumentSet();
6665 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6680 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6666 for (blink::Document* document : set) 6681 for (blink::Document* document : set)
6667 fprintf(stderr, "- Document %p URL: %s\n", document, 6682 fprintf(stderr, "- Document %p URL: %s\n", document,
6668 document->url().getString().utf8().data()); 6683 document->url().getString().utf8().data());
6669 } 6684 }
6670 #endif 6685 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698