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

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

Issue 2035653006: [DevTools] Move Console to v8 inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved api a bit Created 4 years, 5 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, createCrossThreadTask(&runAddCon soleMessageTask, consoleMessage->source(), consoleMessage->level(), consoleMessa ge->message())); 5202 m_taskRunner->postTask(BLINK_FROM_HERE, createCrossThreadTask(&runAddCon soleMessageTask, consoleMessage->source(), consoleMessage->level(), consoleMessa ge->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->messageId() && !consoleMessage->relatedMessageId() && c onsoleMessage->location()->isUnknown()) { 5209 if (consoleMessage->location()->isUnknown()) {
5210 // TODO(dgozman): capture correct location at call places instead. 5210 // TODO(dgozman): capture correct location at call places instead.
5211 unsigned lineNumber = 0; 5211 unsigned lineNumber = 0;
5212 if (!isInDocumentWrite() && scriptableDocumentParser()) { 5212 if (!isInDocumentWrite() && scriptableDocumentParser()) {
5213 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5213 ScriptableDocumentParser* parser = scriptableDocumentParser();
5214 if (parser->isParsingAtLineNumber()) 5214 if (parser->isParsingAtLineNumber())
5215 lineNumber = parser->lineNumber().oneBasedInt(); 5215 lineNumber = parser->lineNumber().oneBasedInt();
5216 } 5216 }
5217 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), SourceLocation::create(url().getSt ring(), lineNumber, 0, nullptr), consoleMessage->scriptArguments()); 5217 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), SourceLocation::create(url().getSt ring(), lineNumber, 0, nullptr));
5218 } 5218 }
5219 m_frame->console().addMessage(consoleMessage); 5219 m_frame->console().addMessage(consoleMessage);
5220 } 5220 }
5221 5221
5222 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5222 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5223 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task, const String& taskNameForInstrumentation) 5223 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task, const String& taskNameForInstrumentation)
5224 { 5224 {
5225 m_taskRunner->postTask(location, std::move(task), taskNameForInstrumentation ); 5225 m_taskRunner->postTask(location, std::move(task), taskNameForInstrumentation );
5226 } 5226 }
5227 5227
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
6030 } 6030 }
6031 6031
6032 void showLiveDocumentInstances() 6032 void showLiveDocumentInstances()
6033 { 6033 {
6034 WeakDocumentSet& set = liveDocumentSet(); 6034 WeakDocumentSet& set = liveDocumentSet();
6035 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6035 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6036 for (Document* document : set) 6036 for (Document* document : set)
6037 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6037 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6038 } 6038 }
6039 #endif 6039 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core_generated.gypi ('k') | third_party/WebKit/Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698