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

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: all tests pass Created 4 years, 6 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 5173 matching lines...) Expand 10 before | Expand all | Expand 10 after
5184 void Document::addConsoleMessage(ConsoleMessage* consoleMessage) 5184 void Document::addConsoleMessage(ConsoleMessage* consoleMessage)
5185 { 5185 {
5186 if (!isContextThread()) { 5186 if (!isContextThread()) {
5187 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message())); 5187 m_taskRunner->postTask(BLINK_FROM_HERE, AddConsoleMessageTask::create(co nsoleMessage->source(), consoleMessage->level(), consoleMessage->message()));
5188 return; 5188 return;
5189 } 5189 }
5190 5190
5191 if (!m_frame) 5191 if (!m_frame)
5192 return; 5192 return;
5193 5193
5194 if (!consoleMessage->messageId() && !consoleMessage->relatedMessageId() && c onsoleMessage->location()->isUnknown()) { 5194 if (consoleMessage->location()->isUnknown()) {
5195 // TODO(dgozman): capture correct location at call places instead. 5195 // TODO(dgozman): capture correct location at call places instead.
5196 unsigned lineNumber = 0; 5196 unsigned lineNumber = 0;
5197 if (!isInDocumentWrite() && scriptableDocumentParser()) { 5197 if (!isInDocumentWrite() && scriptableDocumentParser()) {
5198 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5198 ScriptableDocumentParser* parser = scriptableDocumentParser();
5199 if (parser->isParsingAtLineNumber()) 5199 if (parser->isParsingAtLineNumber())
5200 lineNumber = parser->lineNumber().oneBasedInt(); 5200 lineNumber = parser->lineNumber().oneBasedInt();
5201 } 5201 }
5202 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), SourceLocation::create(url().getSt ring(), lineNumber, 0, nullptr), consoleMessage->scriptArguments()); 5202 consoleMessage = ConsoleMessage::create(consoleMessage->source(), consol eMessage->level(), consoleMessage->message(), SourceLocation::create(url().getSt ring(), lineNumber, 0, nullptr));
5203 } 5203 }
5204 m_frame->console().addMessage(consoleMessage); 5204 m_frame->console().addMessage(consoleMessage);
5205 } 5205 }
5206 5206
5207 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5207 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5208 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task) 5208 void Document::postTask(const WebTraceLocation& location, std::unique_ptr<Execut ionContextTask> task)
5209 { 5209 {
5210 m_taskRunner->postTask(location, std::move(task)); 5210 m_taskRunner->postTask(location, std::move(task));
5211 } 5211 }
5212 5212
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
6013 } 6013 }
6014 6014
6015 void showLiveDocumentInstances() 6015 void showLiveDocumentInstances()
6016 { 6016 {
6017 WeakDocumentSet& set = liveDocumentSet(); 6017 WeakDocumentSet& set = liveDocumentSet();
6018 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6018 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6019 for (Document* document : set) 6019 for (Document* document : set)
6020 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6020 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6021 } 6021 }
6022 #endif 6022 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698