| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "DocumentParser.h" | 27 #include "DocumentParser.h" |
| 28 | 28 |
| 29 #include <wtf/Assertions.h> | 29 #include <wtf/Assertions.h> |
| 30 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 DocumentParser::DocumentParser(Document* document) | 33 DocumentParser::DocumentParser(Document* document) |
| 34 : m_state(ParsingState) | 34 : m_parserStopped(false) |
| 35 , m_document(document) | 35 , m_document(document) |
| 36 { | 36 { |
| 37 ASSERT(document); | 37 ASSERT(document); |
| 38 } | 38 } |
| 39 | 39 |
| 40 DocumentParser::~DocumentParser() | 40 DocumentParser::~DocumentParser() |
| 41 { | 41 { |
| 42 // Document is expected to call detach() before releasing its ref. | 42 // Document is expected to call detach() before releasing its ref. |
| 43 // This ASSERT is slightly awkward for parsers with a fragment case | 43 // This ASSERT is slightly awkward for parsers with a fragment case |
| 44 // as there is no Document to release the ref. | 44 // as there is no Document to release the ref. |
| 45 ASSERT(!m_document); | 45 ASSERT(!m_document); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void DocumentParser::startParsing() | |
| 49 { | |
| 50 m_state = ParsingState; | |
| 51 } | |
| 52 | |
| 53 void DocumentParser::prepareToStopParsing() | |
| 54 { | |
| 55 if (m_state == ParsingState) | |
| 56 m_state = StoppingState; | |
| 57 } | |
| 58 | |
| 59 void DocumentParser::stopParsing() | |
| 60 { | |
| 61 m_state = StoppedState; | |
| 62 } | |
| 63 | |
| 64 void DocumentParser::detach() | 48 void DocumentParser::detach() |
| 65 { | 49 { |
| 66 m_state = DetachedState; | |
| 67 m_document = 0; | 50 m_document = 0; |
| 68 } | 51 } |
| 69 | 52 |
| 70 }; | 53 }; |
| 71 | 54 |
| OLD | NEW |