| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef BackgroundHTMLParser_h | 26 #ifndef BackgroundHTMLParser_h |
| 27 #define BackgroundHTMLParser_h | 27 #define BackgroundHTMLParser_h |
| 28 | 28 |
| 29 #include "base/memory/weak_ptr.h" | 29 #include "base/memory/weak_ptr.h" |
| 30 #include "core/html/parser/CompactHTMLToken.h" | 30 #include "core/html/parser/CompactHTMLToken.h" |
| 31 #include "core/html/parser/HTMLParserOptions.h" | |
| 32 #include "core/html/parser/HTMLTokenizer.h" | 31 #include "core/html/parser/HTMLTokenizer.h" |
| 33 #include "core/html/parser/TextResourceDecoder.h" | 32 #include "core/html/parser/TextResourceDecoder.h" |
| 34 #include "mojo/public/cpp/system/core.h" | 33 #include "mojo/public/cpp/system/core.h" |
| 35 #include "platform/fetcher/DataPipeDrainer.h" | 34 #include "platform/fetcher/DataPipeDrainer.h" |
| 36 #include "platform/text/SegmentedString.h" | 35 #include "platform/text/SegmentedString.h" |
| 37 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 38 #include "wtf/WeakPtr.h" | 37 #include "wtf/WeakPtr.h" |
| 39 | 38 |
| 40 namespace blink { | 39 namespace blink { |
| 41 | 40 |
| 42 class HTMLDocumentParser; | 41 class HTMLDocumentParser; |
| 43 class SharedBuffer; | 42 class SharedBuffer; |
| 44 | 43 |
| 45 class BackgroundHTMLParser : public DataPipeDrainer::Client { | 44 class BackgroundHTMLParser : public DataPipeDrainer::Client { |
| 46 WTF_MAKE_FAST_ALLOCATED; | 45 WTF_MAKE_FAST_ALLOCATED; |
| 47 public: | 46 public: |
| 48 struct Configuration { | 47 struct Configuration { |
| 49 HTMLParserOptions options; | |
| 50 mojo::ScopedDataPipeConsumerHandle source; | 48 mojo::ScopedDataPipeConsumerHandle source; |
| 51 WeakPtr<HTMLDocumentParser> parser; | 49 WeakPtr<HTMLDocumentParser> parser; |
| 52 }; | 50 }; |
| 53 | 51 |
| 54 static base::WeakPtr<BackgroundHTMLParser> create(PassOwnPtr<Configuration>)
; | 52 static base::WeakPtr<BackgroundHTMLParser> create(PassOwnPtr<Configuration>)
; |
| 55 | 53 |
| 56 void start(); | 54 void start(); |
| 57 void stop(); | 55 void stop(); |
| 58 | 56 |
| 59 private: | 57 private: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 79 | 77 |
| 80 mojo::ScopedDataPipeConsumerHandle m_source; | 78 mojo::ScopedDataPipeConsumerHandle m_source; |
| 81 OwnPtr<DataPipeDrainer> m_drainer; | 79 OwnPtr<DataPipeDrainer> m_drainer; |
| 82 | 80 |
| 83 base::WeakPtrFactory<BackgroundHTMLParser> m_weakFactory; | 81 base::WeakPtrFactory<BackgroundHTMLParser> m_weakFactory; |
| 84 }; | 82 }; |
| 85 | 83 |
| 86 } | 84 } |
| 87 | 85 |
| 88 #endif | 86 #endif |
| OLD | NEW |