Index: public/platform/WebThreadedResourceProvider.h |
diff --git a/Source/core/html/parser/HTMLParserThread.h b/public/platform/WebThreadedResourceProvider.h |
similarity index 66% |
rename from Source/core/html/parser/HTMLParserThread.h |
rename to public/platform/WebThreadedResourceProvider.h |
index e0b85f9399c3856f6881e3fed668477b8a4257c2..becbb274d0413c4035c754870b98f3bf6972befb 100644 |
--- a/Source/core/html/parser/HTMLParserThread.h |
+++ b/public/platform/WebThreadedResourceProvider.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2013 Google Inc. All rights reserved. |
+ * Copyright (C) 2013 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,27 +28,35 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef HTMLParserThread_h |
-#define HTMLParserThread_h |
+#ifndef WebThreadedResourceProvider_h |
+#define WebThreadedResourceProvider_h |
-#include "wtf/Functional.h" |
-#include "wtf/OwnPtr.h" |
-#include "public/platform/WebThread.h" |
+namespace blink { |
-namespace WebCore { |
+class WebThread; |
-class HTMLParserThread { |
+class WebThreadedResourceBackgroundClient { |
+public: |
+ virtual void didReceivedData(const char* data, size_t length) = 0; |
+}; |
+ |
+class WebThreadedResourceForegroundClient { |
+public: |
+ virtual void didSwitchedToBackgroundClient() = 0; |
+ |
+ virtual ~WebThreadedResourceForegroundClient() { } |
+}; |
+ |
+class WebThreadedResourceProvider { |
public: |
- static HTMLParserThread* shared(); |
- void postTask(const Closure&); |
-private: |
- HTMLParserThread(); |
- ~HTMLParserThread(); |
+ virtual void setBackgroundClient(WebThreadedResourceBackgroundClient*) = 0; |
+ virtual void setForegroundClient(WebThreadedResourceForegroundClient*) = 0; |
+ virtual WebThread* resourceThread() = 0; |
- OwnPtr<blink::WebThread> m_thread; |
+ virtual ~WebThreadedResourceProvider() { } |
}; |
-} // namespace WebCore |
+} // namespace blink |
-#endif // HTMLParserThread_h |
+#endif |