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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 // and script-sourced input streams whereas the spec treats them | 619 // and script-sourced input streams whereas the spec treats them |
620 // differently. | 620 // differently. |
621 return m_input.hasInsertionPoint() || (wasCreatedByScript() && !m_input.have
SeenEndOfFile()); | 621 return m_input.hasInsertionPoint() || (wasCreatedByScript() && !m_input.have
SeenEndOfFile()); |
622 } | 622 } |
623 | 623 |
624 void HTMLDocumentParser::insert(const SegmentedString& source) | 624 void HTMLDocumentParser::insert(const SegmentedString& source) |
625 { | 625 { |
626 if (isStopped()) | 626 if (isStopped()) |
627 return; | 627 return; |
628 | 628 |
629 TRACE_EVENT0("webkit", "HTMLDocumentParser::insert"); | 629 TRACE_EVENT1("webkit", "HTMLDocumentParser::insert", "source_length", source
.length()); |
630 | 630 |
631 // pumpTokenizer can cause this parser to be detached from the Document, | 631 // pumpTokenizer can cause this parser to be detached from the Document, |
632 // but we need to ensure it isn't deleted yet. | 632 // but we need to ensure it isn't deleted yet. |
633 RefPtr<HTMLDocumentParser> protect(this); | 633 RefPtr<HTMLDocumentParser> protect(this); |
634 | 634 |
635 if (!m_tokenizer) { | 635 if (!m_tokenizer) { |
636 ASSERT(!inPumpSession()); | 636 ASSERT(!inPumpSession()); |
637 ASSERT(m_haveBackgroundParser || wasCreatedByScript()); | 637 ASSERT(m_haveBackgroundParser || wasCreatedByScript()); |
638 m_token = adoptPtr(new HTMLToken); | 638 m_token = adoptPtr(new HTMLToken); |
639 m_tokenizer = HTMLTokenizer::create(m_options); | 639 m_tokenizer = HTMLTokenizer::create(m_options); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 998 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
999 { | 999 { |
1000 ASSERT(decoder); | 1000 ASSERT(decoder); |
1001 DecodedDataDocumentParser::setDecoder(decoder); | 1001 DecodedDataDocumentParser::setDecoder(decoder); |
1002 | 1002 |
1003 if (m_haveBackgroundParser) | 1003 if (m_haveBackgroundParser) |
1004 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); | 1004 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); |
1005 } | 1005 } |
1006 | 1006 |
1007 } | 1007 } |
OLD | NEW |