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

Unified Diff: public/platform/WebThreadedDataReceiver.h

Issue 863113004: Make WebThreadedDataReceiver wrap a Blink-managed object instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix msvc compilation Created 5 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/WebThreadedDataReceiver.h
diff --git a/public/platform/WebThreadedDataReceiver.h b/public/platform/WebThreadedDataReceiver.h
index 516c13b870bc61b75e539c13ee153172a7cafa3c..99f32facc539ea32d0c82c529cf8a8abf698cb78 100644
--- a/public/platform/WebThreadedDataReceiver.h
+++ b/public/platform/WebThreadedDataReceiver.h
@@ -5,21 +5,44 @@
#ifndef WebThreadedDataReceiver_h
#define WebThreadedDataReceiver_h
+#include "public/platform/WebPrivatePtr.h"
+
namespace blink {
+class ThreadedDataReceiver;
class WebThread;
class WebThreadedDataReceiver {
public:
- virtual void acceptData(const char* data, int dataLength) = 0;
- virtual WebThread* backgroundThread() = 0;
+ ~WebThreadedDataReceiver() { reset(); }
+
+ WebThreadedDataReceiver() { }
+ WebThreadedDataReceiver(const WebThreadedDataReceiver& r) { assign(r); }
+ WebThreadedDataReceiver& operator=(const WebThreadedDataReceiver& r)
+ {
+ assign(r);
+ return *this;
+ }
+
+ BLINK_EXPORT void reset();
+ BLINK_EXPORT void assign(const WebThreadedDataReceiver&);
+
+ bool isNull() const { return m_private.isNull(); }
- virtual bool needsMainthreadDataCopy() = 0;
- virtual void acceptMainthreadDataNotification(const char* data, int dataLength, int encodedDataLength) = 0;
+#if BLINK_IMPLEMENTATION
+ explicit WebThreadedDataReceiver(const PassRefPtrWillBeRawPtr<ThreadedDataReceiver>&);
+#endif
+
+ BLINK_EXPORT void acceptData(const char* data, int dataLength);
+ BLINK_EXPORT WebThread* backgroundThread();
- virtual ~WebThreadedDataReceiver() { }
+ BLINK_EXPORT bool needsMainthreadDataCopy();
+ BLINK_EXPORT void acceptMainthreadDataNotification(const char* data, int dataLength, int encodedDataLength);
+
+private:
+ WebPrivatePtr<ThreadedDataReceiver> m_private;
};
} // namespace blink
-#endif
+#endif // WebThreadedDataReceiver_h
« Source/core/html/parser/ThreadedDataReceiver.h ('K') | « public/platform/WebPrivatePtr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698