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

Issue 20890003: Limit console messages' automatic collection of parser state. (Closed)

Created:
7 years, 4 months ago by Mike West
Modified:
3 years, 5 months ago
Reviewers:
caseq, ojan
CC:
blink-reviews, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin, mkwst+watchlist_chromium.org, gavinp+loader_chromium.org
Visibility:
Public.

Description

Limit console messages' automatic collection of parser state. PageConsole::addMessage currently grabs the current line number from the ScriptableDocumentParser if it looks like parsing might be responsible for the message. We override that line number later on in the reporting process (ConsoleMessage::autogenerateMetadata) for JavaScript-driven console messages. This is generally awesome, as it means we don't have to collect line numbers at every callsite where we'd like to write something to the console. It is, however, flaky. Asynchronousness can cause messages to be triggered before the parser's done parsing, even though they have nothing to do with whatever the parser is currently looking at. The line number will be corrected before it hits the console, but we unfortunately notify clients (and therefore Content Shell) too early in the process for that to keep the flake from making its way into test expectations. 'http/tests/security/canvas-remote-read-data-url-svg-image.html' is one example: I'm sure there are many more. This patch changes PageConsole's behavior to only automatically collect metadata for MessageSources that we know to be generally parser-driven. It also adds a mechanism for particular messages from atypical MessageSources to force metadata collection if they are known to be parser-driven. The rebaselines associated with this patch are a happy consequence, as we shouldn't have had line numbers with these errors to begin with: These tests' console messages are triggered from HTTP headers, not the document: * 'http/tests/security/xssAuditor/malformed-xss-*' * 'http/tests/security/contentSecurityPolicy/1.1/reflected-xss-*' * 'http/tests/security/no-javascript-refresh.php' 'http/tests/security/frame-loading-via-document-write.html' shouldn't grab a line number, as the console message is triggered via 'document.write', and will end up being collected along with the stack trace. BUG=224317

Patch Set 1 #

Patch Set 2 : Added 'fast/frames/sandboxed-iframe-autofocus-denied.html'. #

Patch Set 3 : rebaseline "http/tests/security/frame-loading-via-document-write-expected.txt" #

Patch Set 4 : rebaseline "fast/frames/sandboxed-iframe-autofocus-denied.html" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -34 lines) Patch
M LayoutTests/TestExpectations View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/fast/frames/sandboxed-iframe-autofocus-denied-expected.txt View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-allow-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-block-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-filter-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-invalid-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/contentSecurityPolicy/1.1/reflected-xss-and-xss-protection-unset-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/no-javascript-refresh-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-1-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-2-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-3-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-4-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-5-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-6-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-7-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-8-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/security/xssAuditor/malformed-xss-protection-header-9-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/ScriptController.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M Source/core/dom/ScriptExecutionContext.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/XSSAuditorDelegate.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/MixedContentChecker.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/cache/ResourceFetcher.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/ConsoleTypes.h View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/page/PageConsole.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/PageConsole.cpp View 2 chunks +7 lines, -2 lines 0 comments Download
M Source/core/workers/WorkerGlobalScope.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/workers/WorkerGlobalScope.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Mike West
Hi Pavel and Andrey, would you mind taking a look at this change to ::addConsoleMessage? ...
7 years, 4 months ago (2013-07-28 15:40:44 UTC) #1
pfeldman
Could you elaborate more on where the flakiness comes from?
7 years, 4 months ago (2013-07-29 12:42:00 UTC) #2
Mike West
On 2013/07/29 12:42:00, pfeldman wrote: > Could you elaborate more on where the flakiness comes ...
7 years, 4 months ago (2013-07-29 13:17:10 UTC) #3
Mike West
Ping. :)
7 years, 4 months ago (2013-07-30 14:33:18 UTC) #4
Mike West
Friendlier ping. :)
7 years, 4 months ago (2013-08-02 12:14:24 UTC) #5
pfeldman
7 years, 3 months ago (2013-08-26 11:40:28 UTC) #6
Do we want to close this review for now?

Powered by Google App Engine
This is Rietveld 408576698