1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WebThreadedDataReceiver_h
6 #define WebThreadedDataReceiver_h
8 #include "public/platform/WebCommon.h"
9 #include "public/platform/WebPrivatePtr.h"
13 class ThreadedDataReceiver
;
16 class WebThreadedDataReceiver
{
18 ~WebThreadedDataReceiver() { reset(); }
20 WebThreadedDataReceiver() { }
21 WebThreadedDataReceiver(const WebThreadedDataReceiver
& r
) { assign(r
); }
22 WebThreadedDataReceiver
& operator=(const WebThreadedDataReceiver
& r
)
28 BLINK_PLATFORM_EXPORT
void reset();
29 BLINK_PLATFORM_EXPORT
void assign(const WebThreadedDataReceiver
&);
31 bool isNull() const { return m_private
.isNull(); }
34 BLINK_PLATFORM_EXPORT
explicit WebThreadedDataReceiver(const PassRefPtrWillBeRawPtr
<ThreadedDataReceiver
>&);
37 BLINK_PLATFORM_EXPORT
void acceptData(const char* data
, int dataLength
);
38 BLINK_PLATFORM_EXPORT WebThread
* backgroundThread();
40 BLINK_PLATFORM_EXPORT
bool needsMainthreadDataCopy();
41 BLINK_PLATFORM_EXPORT
void acceptMainthreadDataNotification(const char* data
, int dataLength
, int encodedDataLength
);
44 WebPrivatePtr
<ThreadedDataReceiver
> m_private
;
49 #endif // WebThreadedDataReceiver_h