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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1997293002: Introduce SourceLocation to be used for console messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5195 matching lines...) Expand 10 before | Expand all | Expand 10 after
5206 if (!m_frame) 5206 if (!m_frame)
5207 return; 5207 return;
5208 5208
5209 if (!consoleMessage->messageId() && !consoleMessage->relatedMessageId() && c onsoleMessage->url().isNull() && !consoleMessage->lineNumber()) { 5209 if (!consoleMessage->messageId() && !consoleMessage->relatedMessageId() && c onsoleMessage->url().isNull() && !consoleMessage->lineNumber()) {
5210 unsigned lineNumber = 0; 5210 unsigned lineNumber = 0;
5211 if (!isInDocumentWrite() && scriptableDocumentParser()) { 5211 if (!isInDocumentWrite() && scriptableDocumentParser()) {
5212 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5212 ScriptableDocumentParser* parser = scriptableDocumentParser();
5213 if (parser->isParsingAtLineNumber()) 5213 if (parser->isParsingAtLineNumber())
5214 lineNumber = parser->lineNumber().oneBasedInt(); 5214 lineNumber = parser->lineNumber().oneBasedInt();
5215 } 5215 }
5216 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), url().getString(), lineNumber, 0, consoleMessage->callStack(), 0, consoleMessage->scriptArguments()); 5216 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), url().getString(), lineNumber, 0, consoleMessage->stackTrace() ? consoleMessage->stackTrace()->clone() : nullptr, 0, consoleMessage->scriptArguments());
5217 } 5217 }
5218 m_frame->console().addMessage(consoleMessage); 5218 m_frame->console().addMessage(consoleMessage);
5219 } 5219 }
5220 5220
5221 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5221 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5222 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task) 5222 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task)
5223 { 5223 {
5224 m_taskRunner->postTask(location, std::move(task)); 5224 m_taskRunner->postTask(location, std::move(task));
5225 } 5225 }
5226 5226
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 #ifndef NDEBUG 6015 #ifndef NDEBUG
6016 using namespace blink; 6016 using namespace blink;
6017 void showLiveDocumentInstances() 6017 void showLiveDocumentInstances()
6018 { 6018 {
6019 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6019 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6020 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6020 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6021 for (Document* document : set) 6021 for (Document* document : set)
6022 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6022 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6023 } 6023 }
6024 #endif 6024 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/v8.gypi ('k') | third_party/WebKit/Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698