| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 DocumentParser::DocumentParser(Document* document) | 35 DocumentParser::DocumentParser(Document* document) |
| 36 : m_state(ParsingState) | 36 : m_state(ParsingState) |
| 37 , m_document(document) | 37 , m_document(document) |
| 38 { | 38 { |
| 39 ASSERT(document); | 39 ASSERT(document); |
| 40 } | 40 } |
| 41 | 41 |
| 42 DocumentParser::~DocumentParser() | 42 DocumentParser::~DocumentParser() |
| 43 { | 43 { |
| 44 #if !ENABLE(OILPAN) | |
| 45 // Document is expected to call detach() before releasing its ref. | 44 // Document is expected to call detach() before releasing its ref. |
| 46 // This ASSERT is slightly awkward for parsers with a fragment case | 45 // This ASSERT is slightly awkward for parsers with a fragment case |
| 47 // as there is no Document to release the ref. | 46 // as there is no Document to release the ref. |
| 48 ASSERT(!m_document); | 47 ASSERT(!m_document); |
| 49 #endif | |
| 50 } | |
| 51 | |
| 52 void DocumentParser::trace(Visitor* visitor) | |
| 53 { | |
| 54 visitor->trace(m_document); | |
| 55 } | 48 } |
| 56 | 49 |
| 57 void DocumentParser::prepareToStopParsing() | 50 void DocumentParser::prepareToStopParsing() |
| 58 { | 51 { |
| 59 ASSERT(m_state == ParsingState); | 52 ASSERT(m_state == ParsingState); |
| 60 m_state = StoppingState; | 53 m_state = StoppingState; |
| 61 } | 54 } |
| 62 | 55 |
| 63 void DocumentParser::stopParsing() | 56 void DocumentParser::stopParsing() |
| 64 { | 57 { |
| 65 m_state = StoppedState; | 58 m_state = StoppedState; |
| 66 } | 59 } |
| 67 | 60 |
| 68 void DocumentParser::detach() | 61 void DocumentParser::detach() |
| 69 { | 62 { |
| 70 m_state = DetachedState; | 63 m_state = DetachedState; |
| 71 m_document = nullptr; | 64 m_document = nullptr; |
| 72 } | 65 } |
| 73 | 66 |
| 74 }; | 67 }; |
| 75 | 68 |
| OLD | NEW |