diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/loader/DocumentWriter.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/loader/DocumentWriter.cpp')
-rw-r--r-- | Source/WebCore/loader/DocumentWriter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/WebCore/loader/DocumentWriter.cpp b/Source/WebCore/loader/DocumentWriter.cpp index 1a16eec56..749caa497 100644 --- a/Source/WebCore/loader/DocumentWriter.cpp +++ b/Source/WebCore/loader/DocumentWriter.cpp @@ -39,6 +39,7 @@ #include "PlaceholderDocument.h" #include "PluginDocument.h" #include "RawDataDocumentParser.h" +#include "ScriptController.h" #include "ScriptableDocumentParser.h" #include "SecurityOrigin.h" #include "SegmentedString.h" @@ -46,7 +47,6 @@ #include "SinkDocument.h" #include "TextResourceDecoder.h" - namespace WebCore { static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame) @@ -78,8 +78,12 @@ void DocumentWriter::replaceDocument(const String& source, Document* ownerDocume // FIXME: This should call DocumentParser::appendBytes instead of append // to support RawDataDocumentParsers. - if (DocumentParser* parser = m_frame->document()->parser()) - parser->append(source); + if (DocumentParser* parser = m_frame->document()->parser()) { + parser->pinToMainThread(); + // Because we're pinned to the main thread we don't need to worry about + // passing ownership of the source string. + parser->append(source.impl()); + } } end(); @@ -100,7 +104,7 @@ void DocumentWriter::begin() PassRefPtr<Document> DocumentWriter::createDocument(const KURL& url) { - if (!m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldUsePluginDocument(m_mimeType)) + if (!m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldAlwaysUsePluginDocument(m_mimeType)) return PluginDocument::create(m_frame, url); if (!m_frame->loader()->client()->hasHTMLView()) return PlaceholderDocument::create(m_frame, url); |