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

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

Issue 376213002: DevTools: Make FrameConsole methods accept ConsoleMessage objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scriptFailedToParse
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/events/TouchEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 #include "core/html/canvas/CanvasRenderingContext.h" 143 #include "core/html/canvas/CanvasRenderingContext.h"
144 #include "core/html/canvas/CanvasRenderingContext2D.h" 144 #include "core/html/canvas/CanvasRenderingContext2D.h"
145 #include "core/html/canvas/WebGLRenderingContext.h" 145 #include "core/html/canvas/WebGLRenderingContext.h"
146 #include "core/html/forms/FormController.h" 146 #include "core/html/forms/FormController.h"
147 #include "core/html/imports/HTMLImportLoader.h" 147 #include "core/html/imports/HTMLImportLoader.h"
148 #include "core/html/imports/HTMLImportsController.h" 148 #include "core/html/imports/HTMLImportsController.h"
149 #include "core/html/parser/HTMLDocumentParser.h" 149 #include "core/html/parser/HTMLDocumentParser.h"
150 #include "core/html/parser/HTMLParserIdioms.h" 150 #include "core/html/parser/HTMLParserIdioms.h"
151 #include "core/html/parser/NestingLevelIncrementer.h" 151 #include "core/html/parser/NestingLevelIncrementer.h"
152 #include "core/html/parser/TextResourceDecoder.h" 152 #include "core/html/parser/TextResourceDecoder.h"
153 #include "core/inspector/ConsoleMessage.h"
153 #include "core/inspector/InspectorCounters.h" 154 #include "core/inspector/InspectorCounters.h"
154 #include "core/inspector/InspectorInstrumentation.h" 155 #include "core/inspector/InspectorInstrumentation.h"
155 #include "core/inspector/InspectorTraceEvents.h" 156 #include "core/inspector/InspectorTraceEvents.h"
156 #include "core/inspector/ScriptCallStack.h" 157 #include "core/inspector/ScriptCallStack.h"
157 #include "core/loader/CookieJar.h" 158 #include "core/loader/CookieJar.h"
158 #include "core/loader/DocumentLoader.h" 159 #include "core/loader/DocumentLoader.h"
159 #include "core/loader/FrameLoader.h" 160 #include "core/loader/FrameLoader.h"
160 #include "core/loader/FrameLoaderClient.h" 161 #include "core/loader/FrameLoaderClient.h"
161 #include "core/loader/ImageLoader.h" 162 #include "core/loader/ImageLoader.h"
162 #include "core/loader/appcache/ApplicationCacheHost.h" 163 #include "core/loader/appcache/ApplicationCacheHost.h"
(...skipping 4854 matching lines...) Expand 10 before | Expand all | Expand 10 after
5017 5018
5018 String messageURL = sourceURL; 5019 String messageURL = sourceURL;
5019 if (!scriptState && sourceURL.isNull() && !lineNumber) { 5020 if (!scriptState && sourceURL.isNull() && !lineNumber) {
5020 messageURL = url().string(); 5021 messageURL = url().string();
5021 if (parsing() && !isInDocumentWrite() && scriptableDocumentParser()) { 5022 if (parsing() && !isInDocumentWrite() && scriptableDocumentParser()) {
5022 ScriptableDocumentParser* parser = scriptableDocumentParser(); 5023 ScriptableDocumentParser* parser = scriptableDocumentParser();
5023 if (!parser->isWaitingForScripts() && !parser->isExecutingScript()) 5024 if (!parser->isWaitingForScripts() && !parser->isExecutingScript())
5024 lineNumber = parser->lineNumber().oneBasedInt(); 5025 lineNumber = parser->lineNumber().oneBasedInt();
5025 } 5026 }
5026 } 5027 }
5027 m_frame->console().addMessage(source, level, message, messageURL, lineNumber , 0, callStack, scriptState, 0); 5028 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, level , message, messageURL, lineNumber);
5029 consoleMessage->setCallStack(callStack);
5030 consoleMessage->setScriptState(scriptState);
5031 m_frame->console().addMessage(consoleMessage.release());
5028 } 5032 }
5029 5033
5030 void Document::addConsoleMessageWithRequestIdentifier(MessageSource source, Mess ageLevel level, const String& message, unsigned long requestIdentifier) 5034 void Document::addConsoleMessageWithRequestIdentifier(MessageSource source, Mess ageLevel level, const String& message, unsigned long requestIdentifier)
5031 { 5035 {
5032 if (!isContextThread()) { 5036 if (!isContextThread()) {
5033 m_taskRunner->postTask(AddConsoleMessageTask::create(source, level, mess age)); 5037 m_taskRunner->postTask(AddConsoleMessageTask::create(source, level, mess age));
5034 return; 5038 return;
5035 } 5039 }
5036 5040
5037 if (m_frame) 5041 if (m_frame) {
5038 m_frame->console().addMessage(source, level, message, String(), 0, 0, nu llptr, 0, requestIdentifier); 5042 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, l evel, message);
5043 consoleMessage->setRequestIdentifier(requestIdentifier);
5044 m_frame->console().addMessage(consoleMessage.release());
5045 }
5039 } 5046 }
5040 5047
5041 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration. 5048 // FIXME(crbug.com/305497): This should be removed after ExecutionContext-LocalD OMWindow migration.
5042 void Document::postTask(PassOwnPtr<ExecutionContextTask> task) 5049 void Document::postTask(PassOwnPtr<ExecutionContextTask> task)
5043 { 5050 {
5044 m_taskRunner->postTask(task); 5051 m_taskRunner->postTask(task);
5045 } 5052 }
5046 5053
5047 void Document::postInspectorTask(PassOwnPtr<ExecutionContextTask> task) 5054 void Document::postInspectorTask(PassOwnPtr<ExecutionContextTask> task)
5048 { 5055 {
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
5895 using namespace blink; 5902 using namespace blink;
5896 void showLiveDocumentInstances() 5903 void showLiveDocumentInstances()
5897 { 5904 {
5898 WeakDocumentSet& set = liveDocumentSet(); 5905 WeakDocumentSet& set = liveDocumentSet();
5899 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5906 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5900 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5907 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5901 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5908 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5902 } 5909 }
5903 } 5910 }
5904 #endif 5911 #endif
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/events/TouchEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698