| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool needsMainthreadDataCopy() override { return InspectorInstrumentation::h
asFrontends(); } | 112 bool needsMainthreadDataCopy() override { return InspectorInstrumentation::h
asFrontends(); } |
| 113 void acceptMainthreadDataNotification(const char* data, int dataLength, int
encodedDataLength) override | 113 void acceptMainthreadDataNotification(const char* data, int dataLength, int
encodedDataLength) override |
| 114 { | 114 { |
| 115 ASSERT(!data || needsMainthreadDataCopy()); | 115 ASSERT(!data || needsMainthreadDataCopy()); |
| 116 if (lifecycleContext()) | 116 if (lifecycleContext()) |
| 117 lifecycleContext()->loader()->acceptDataFromThreadedReceiver(data, d
ataLength, encodedDataLength); | 117 lifecycleContext()->loader()->acceptDataFromThreadedReceiver(data, d
ataLength, encodedDataLength); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void trace(Visitor* visitor) override | 120 DEFINE_INLINE_VIRTUAL_TRACE() |
| 121 { | 121 { |
| 122 DocumentLifecycleObserver::trace(visitor); | 122 DocumentLifecycleObserver::trace(visitor); |
| 123 } | 123 } |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 ParserDataReceiver(WeakPtr<BackgroundHTMLParser> backgroundParser, Document*
document) | 126 ParserDataReceiver(WeakPtr<BackgroundHTMLParser> backgroundParser, Document*
document) |
| 127 : DocumentLifecycleObserver(document) | 127 : DocumentLifecycleObserver(document) |
| 128 , m_backgroundParser(backgroundParser) | 128 , m_backgroundParser(backgroundParser) |
| 129 { | 129 { |
| 130 } | 130 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 ASSERT(!m_pumpSessionNestingLevel); | 188 ASSERT(!m_pumpSessionNestingLevel); |
| 189 ASSERT(!m_preloadScanner); | 189 ASSERT(!m_preloadScanner); |
| 190 ASSERT(!m_insertionPreloadScanner); | 190 ASSERT(!m_insertionPreloadScanner); |
| 191 ASSERT(!m_haveBackgroundParser); | 191 ASSERT(!m_haveBackgroundParser); |
| 192 // FIXME: We should be able to ASSERT(m_speculations.isEmpty()), | 192 // FIXME: We should be able to ASSERT(m_speculations.isEmpty()), |
| 193 // but there are cases where that's not true currently. For example, | 193 // but there are cases where that's not true currently. For example, |
| 194 // we we're told to stop parsing before we've consumed all the input. | 194 // we we're told to stop parsing before we've consumed all the input. |
| 195 #endif | 195 #endif |
| 196 } | 196 } |
| 197 | 197 |
| 198 void HTMLDocumentParser::trace(Visitor* visitor) | 198 DEFINE_TRACE(HTMLDocumentParser) |
| 199 { | 199 { |
| 200 visitor->trace(m_treeBuilder); | 200 visitor->trace(m_treeBuilder); |
| 201 visitor->trace(m_xssAuditorDelegate); | 201 visitor->trace(m_xssAuditorDelegate); |
| 202 visitor->trace(m_scriptRunner); | 202 visitor->trace(m_scriptRunner); |
| 203 visitor->trace(m_preloader); | 203 visitor->trace(m_preloader); |
| 204 ScriptableDocumentParser::trace(visitor); | 204 ScriptableDocumentParser::trace(visitor); |
| 205 HTMLScriptRunnerHost::trace(visitor); | 205 HTMLScriptRunnerHost::trace(visitor); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void HTMLDocumentParser::detach() | 208 void HTMLDocumentParser::detach() |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 1100 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
| 1101 { | 1101 { |
| 1102 ASSERT(decoder); | 1102 ASSERT(decoder); |
| 1103 DecodedDataDocumentParser::setDecoder(decoder); | 1103 DecodedDataDocumentParser::setDecoder(decoder); |
| 1104 | 1104 |
| 1105 if (m_haveBackgroundParser) | 1105 if (m_haveBackgroundParser) |
| 1106 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); | 1106 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 } | 1109 } |
| OLD | NEW |