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

Unified Diff: Source/core/page/PageConsole.cpp

Issue 20890003: Limit console messages' automatic collection of parser state. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline "fast/frames/sandboxed-iframe-autofocus-denied.html" Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/PageConsole.h ('k') | Source/core/workers/WorkerGlobalScope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageConsole.cpp
diff --git a/Source/core/page/PageConsole.cpp b/Source/core/page/PageConsole.cpp
index 07bbb252a6ce2974edde7df033fa5d860034e9b2..034341e56882cd105cc822aa9115a8f28d0b7e42 100644
--- a/Source/core/page/PageConsole.cpp
+++ b/Source/core/page/PageConsole.cpp
@@ -46,6 +46,11 @@ namespace {
int muteCount = 0;
+static bool shouldCollectParserStateForSourceType(MessageSource source)
+{
+ return source == RenderingMessageSource || source == CSSMessageSource || source == OtherMessageSource;
+}
+
}
PageConsole::PageConsole(Page* page)
@@ -55,13 +60,13 @@ PageConsole::PageConsole(Page* page)
PageConsole::~PageConsole() { }
-void PageConsole::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, Document* document)
+void PageConsole::addMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier, Document* document, ParserStateCollectionDisposition parserStateDisposition)
{
String url;
if (document)
url = document->url().string();
unsigned line = 0;
- if (document && document->parsing() && !document->isInDocumentWrite() && document->scriptableDocumentParser()) {
+ if ((shouldCollectParserStateForSourceType(source) || parserStateDisposition == ForceParserStateCollection) && document && document->parsing() && !document->isInDocumentWrite() && document->scriptableDocumentParser()) {
ScriptableDocumentParser* parser = document->scriptableDocumentParser();
if (!parser->isWaitingForScripts() && !parser->isExecutingScript())
line = parser->lineNumber().oneBasedInt();
« no previous file with comments | « Source/core/page/PageConsole.h ('k') | Source/core/workers/WorkerGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698