| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef HTMLParserThread_h | 31 #ifndef HTMLParserThread_h |
| 32 #define HTMLParserThread_h | 32 #define HTMLParserThread_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "platform/WebThreadSupportingGC.h" | 35 #include "platform/WebThreadSupportingGC.h" |
| 36 #include "wtf/Allocator.h" |
| 36 #include "wtf/Functional.h" | 37 #include "wtf/Functional.h" |
| 37 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 38 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class CORE_EXPORT HTMLParserThread { | 43 class CORE_EXPORT HTMLParserThread { |
| 44 WTF_MAKE_FAST_ALLOCATED(HTMLParserThread); |
| 43 public: | 45 public: |
| 44 static void init(); | 46 static void init(); |
| 45 static void shutdown(); | 47 static void shutdown(); |
| 46 | 48 |
| 47 // It is an error to call shared() before init() or after shutdown(); | 49 // It is an error to call shared() before init() or after shutdown(); |
| 48 static HTMLParserThread* shared(); | 50 static HTMLParserThread* shared(); |
| 49 | 51 |
| 50 void postTask(PassOwnPtr<Closure>); | 52 void postTask(PassOwnPtr<Closure>); |
| 51 WebThread& platformThread(); | 53 WebThread& platformThread(); |
| 52 bool isRunning(); | 54 bool isRunning(); |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 HTMLParserThread(); | 57 HTMLParserThread(); |
| 56 ~HTMLParserThread(); | 58 ~HTMLParserThread(); |
| 57 void setupHTMLParserThread(); | 59 void setupHTMLParserThread(); |
| 58 void cleanupHTMLParserThread(); | 60 void cleanupHTMLParserThread(); |
| 59 | 61 |
| 60 OwnPtr<WebThreadSupportingGC> m_thread; | 62 OwnPtr<WebThreadSupportingGC> m_thread; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 } // namespace blink | 65 } // namespace blink |
| 64 | 66 |
| 65 #endif // HTMLParserThread_h | 67 #endif // HTMLParserThread_h |
| OLD | NEW |