OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010. Adam Barth. All rights reserved. | 2 * Copyright (C) 2010. Adam Barth. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const AtomicString& mimeType, | 49 const AtomicString& mimeType, |
50 const AtomicString& encoding) { | 50 const AtomicString& encoding) { |
51 return new DocumentWriter(document, parsingPolicy, mimeType, encoding); | 51 return new DocumentWriter(document, parsingPolicy, mimeType, encoding); |
52 } | 52 } |
53 | 53 |
54 DocumentWriter::DocumentWriter(Document* document, | 54 DocumentWriter::DocumentWriter(Document* document, |
55 ParserSynchronizationPolicy parserSyncPolicy, | 55 ParserSynchronizationPolicy parserSyncPolicy, |
56 const AtomicString& mimeType, | 56 const AtomicString& mimeType, |
57 const AtomicString& encoding) | 57 const AtomicString& encoding) |
58 : m_document(document), | 58 : m_document(document), |
59 m_decoderBuilder(mimeType, encoding) | 59 m_decoderBuilder(mimeType, encoding), |
60 // We grab a reference to the parser so that we'll always send data to the | 60 // We grab a reference to the parser so that we'll always send data to the |
61 // original parser, even if the document acquires a new parser (e.g., via | 61 // original parser, even if the document acquires a new parser (e.g., via |
62 // document.open). | 62 // document.open). |
63 , | |
64 m_parser(m_document->implicitOpen(parserSyncPolicy)) { | 63 m_parser(m_document->implicitOpen(parserSyncPolicy)) { |
65 if (m_document->frame()) { | 64 if (m_document->frame()) { |
66 if (FrameView* view = m_document->frame()->view()) | 65 if (FrameView* view = m_document->frame()->view()) |
67 view->setContentsSize(IntSize()); | 66 view->setContentsSize(IntSize()); |
68 } | 67 } |
69 } | 68 } |
70 | 69 |
71 DocumentWriter::~DocumentWriter() {} | 70 DocumentWriter::~DocumentWriter() {} |
72 | 71 |
73 DEFINE_TRACE(DocumentWriter) { | 72 DEFINE_TRACE(DocumentWriter) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 m_document = nullptr; | 111 m_document = nullptr; |
113 } | 112 } |
114 | 113 |
115 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() { | 114 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() { |
116 DCHECK(m_parser); | 115 DCHECK(m_parser); |
117 DCHECK(!m_parser->isStopped()); | 116 DCHECK(!m_parser->isStopped()); |
118 m_parser->setDocumentWasLoadedAsPartOfNavigation(); | 117 m_parser->setDocumentWasLoadedAsPartOfNavigation(); |
119 } | 118 } |
120 | 119 |
121 } // namespace blink | 120 } // namespace blink |
OLD | NEW |