| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/html/parser/TextResourceDecoder.h" | 30 #include "core/html/parser/TextResourceDecoder.h" |
| 31 #include "wtf/Assertions.h" | 31 #include "wtf/Assertions.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 DocumentParser::DocumentParser(Document* document) | 35 DocumentParser::DocumentParser(Document* document) |
| 36 : m_state(ParsingState) | 36 : m_state(ParsingState) |
| 37 , m_documentWasLoadedAsPartOfNavigation(false) | 37 , m_documentWasLoadedAsPartOfNavigation(false) |
| 38 , m_document(document) | 38 , m_document(document) |
| 39 { | 39 { |
| 40 ASSERT(document); | 40 DCHECK(document); |
| 41 } | 41 } |
| 42 | 42 |
| 43 DocumentParser::~DocumentParser() | 43 DocumentParser::~DocumentParser() |
| 44 { | 44 { |
| 45 #if !ENABLE(OILPAN) | 45 #if !ENABLE(OILPAN) |
| 46 // Document is expected to call detach() before releasing its ref. | 46 // Document is expected to call detach() before releasing its ref. |
| 47 // This ASSERT is slightly awkward for parsers with a fragment case | 47 // This ASSERT is slightly awkward for parsers with a fragment case |
| 48 // as there is no Document to release the ref. | 48 // as there is no Document to release the ref. |
| 49 ASSERT(!m_document); | 49 DCHECK(!m_document); |
| 50 #endif | 50 #endif |
| 51 } | 51 } |
| 52 | 52 |
| 53 DEFINE_TRACE(DocumentParser) | 53 DEFINE_TRACE(DocumentParser) |
| 54 { | 54 { |
| 55 visitor->trace(m_document); | 55 visitor->trace(m_document); |
| 56 visitor->trace(m_clients); | 56 visitor->trace(m_clients); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>) | 59 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>) |
| 60 { | 60 { |
| 61 ASSERT_NOT_REACHED(); | 61 ASSERT_NOT_REACHED(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 TextResourceDecoder* DocumentParser::decoder() | 64 TextResourceDecoder* DocumentParser::decoder() |
| 65 { | 65 { |
| 66 return nullptr; | 66 return nullptr; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void DocumentParser::prepareToStopParsing() | 69 void DocumentParser::prepareToStopParsing() |
| 70 { | 70 { |
| 71 ASSERT(m_state == ParsingState); | 71 DCHECK_EQ(m_state, ParsingState); |
| 72 m_state = StoppingState; | 72 m_state = StoppingState; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void DocumentParser::stopParsing() | 75 void DocumentParser::stopParsing() |
| 76 { | 76 { |
| 77 m_state = StoppedState; | 77 m_state = StoppedState; |
| 78 | 78 |
| 79 // Clients may be removed while in the loop. Make a snapshot for iteration. | 79 // Clients may be removed while in the loop. Make a snapshot for iteration. |
| 80 HeapVector<Member<DocumentParserClient>> clientsSnapshot; | 80 HeapVector<Member<DocumentParserClient>> clientsSnapshot; |
| 81 copyToVector(m_clients, clientsSnapshot); | 81 copyToVector(m_clients, clientsSnapshot); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 106 { | 106 { |
| 107 m_clients.add(client); | 107 m_clients.add(client); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void DocumentParser::removeClient(DocumentParserClient* client) | 110 void DocumentParser::removeClient(DocumentParserClient* client) |
| 111 { | 111 { |
| 112 m_clients.remove(client); | 112 m_clients.remove(client); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace blink | 115 } // namespace blink |
| OLD | NEW |