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

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

Issue 1998353003: Reduce ConsoleMessage API surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1999463002
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 5188 matching lines...) Expand 10 before | Expand all | Expand 10 after
5199 void Document::addConsoleMessage(ConsoleMessage* consoleMessage) 5199 void Document::addConsoleMessage(ConsoleMessage* consoleMessage)
5200 { 5200 {
5201 if (!isContextThread()) { 5201 if (!isContextThread()) {
5202 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message())); 5202 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
5203 return; 5203 return;
5204 } 5204 }
5205 5205
5206 if (!m_frame) 5206 if (!m_frame)
5207 return; 5207 return;
5208 5208
5209 if (!consoleMessage->getScriptState() && consoleMessage->url().isNull() && ! consoleMessage->lineNumber()) { 5209 if (!consoleMessage->messageId() && !consoleMessage->relatedMessageId() && c onsoleMessage->url().isNull() && !consoleMessage->lineNumber()) {
5210 consoleMessage->setURL(url().getString()); 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 consoleMessage->setLineNumber(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 } 5217 }
5217 m_frame->console().addMessage(consoleMessage); 5218 m_frame->console().addMessage(consoleMessage);
5218 } 5219 }
5219 5220
5220 // 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.
5221 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)
5222 { 5223 {
5223 m_taskRunner->postTask(location, std::move(task)); 5224 m_taskRunner->postTask(location, std::move(task));
5224 } 5225 }
5225 5226
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
6014 #ifndef NDEBUG 6015 #ifndef NDEBUG
6015 using namespace blink; 6016 using namespace blink;
6016 void showLiveDocumentInstances() 6017 void showLiveDocumentInstances()
6017 { 6018 {
6018 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6019 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6019 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6020 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6020 for (Document* document : set) 6021 for (Document* document : set)
6021 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());
6022 } 6023 }
6023 #endif 6024 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp ('k') | third_party/WebKit/Source/core/frame/FrameConsole.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698