summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js
diff options
context:
space:
mode:
authoreric@webkit.org <eric@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2013-03-14 09:25:01 +0000
committereric@webkit.org <eric@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2013-03-14 09:25:01 +0000
commit84fec92ef724b3628917bf6ac1e8282353bf9aff (patch)
treefcadb28babe33b7d34ef9cb3ff4b5d9acd75cfcd /third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js
parent6ce03b6c129d76c01afdc8023f8a81d0ff0f0904 (diff)
downloadchromium_src-84fec92ef724b3628917bf6ac1e8282353bf9aff.zip
chromium_src-84fec92ef724b3628917bf6ac1e8282353bf9aff.tar.gz
chromium_src-84fec92ef724b3628917bf6ac1e8282353bf9aff.tar.bz2
Threaded HTML Parser should limit speculation to avoid using too much memory
https://bugs.webkit.org/show_bug.cgi?id=112069 Reviewed by Adam Barth. Source/WebCore: This is a speculative fix for memory issues seen in: https://code.google.com/p/chromium/issues/detail?id=180819 This also fixed https://bugs.webkit.org/show_bug.cgi?id=110546 as a side-effect of simplifying the m_currentChunk handling. We now tell the background html parser every time we start a chunk on the main thread (instead of end), which greatly simplified the checkpoint cleanup code from: https://trac.webkit.org/changeset/145277 The cost for this is now we have more messages going to the background thread (and postTask acquires a lock to write to the message queue). Chromium has more advanced (lock-less) primatives for message posting, which we'll hopefully add to WebKit in furture patches. The outstanding chunks limit has not been tuned. But it makes sense that we should not keeping infinite speculative tokens around for large documents with slow-to-load scripts. * html/parser/BackgroundHTMLInputStream.cpp: (WebCore::BackgroundHTMLInputStream::BackgroundHTMLInputStream): (WebCore::BackgroundHTMLInputStream::invalidateCheckpointsBefore): (WebCore): (WebCore::BackgroundHTMLInputStream::rewindTo): * html/parser/BackgroundHTMLInputStream.h: (BackgroundHTMLInputStream): (WebCore::BackgroundHTMLInputStream::outstandingCheckpointCount): (Checkpoint): (WebCore::BackgroundHTMLInputStream::Checkpoint::isNull): (WebCore::BackgroundHTMLInputStream::Checkpoint::clear): * html/parser/BackgroundHTMLParser.cpp: (WebCore): (WebCore::BackgroundHTMLParser::startedChunkWithCheckpoint): (WebCore::BackgroundHTMLParser::pumpTokenizer): * html/parser/BackgroundHTMLParser.h: (BackgroundHTMLParser): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::validateSpeculations): (WebCore::HTMLDocumentParser::discardSpeculationsAndResumeFrom): (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser): (WebCore::HTMLDocumentParser::pumpPendingSpeculations): (WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution): * html/parser/HTMLDocumentParser.h: (HTMLDocumentParser): LayoutTests: Test that this fixes https://bugs.webkit.org/show_bug.cgi?id=110546 for the threaded parser. Ports using the main-thread parser are expected to fail (ASSERT in Debug). * fast/parser/document-write-partial-entity-before-load-expected.txt: Added. * fast/parser/document-write-partial-entity-before-load.html: Added. * fast/parser/external-script-document-write-expected.txt: Added. * fast/parser/external-script-document-write.html: Added. * fast/parser/resources/external-script-document-write.js: Added. * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: git-svn-id: svn://svn.chromium.org/blink/trunk@145797 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js')
-rw-r--r--third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js b/third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js
new file mode 100644
index 0000000..40e6d56
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/parser/resources/external-script-document-write.js
@@ -0,0 +1 @@
+document.write("<plaintext>");