Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Unified Diff: public/platform/WebThreadedResourceProvider.h

Issue 100563004: Redirect HTML resource bytes directly to parser thread (Blink side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_decodermove
Patch Set: Cache parser thread pointer in HTMLDocumentParser Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698