Chromium Code Reviews| Index: content/child/bluetooth/web_bluetooth_impl.h |
| diff --git a/content/child/bluetooth/web_bluetooth_impl.h b/content/child/bluetooth/web_bluetooth_impl.h |
| index e9143a8c811f6c862798a86bb00af155dd713e53..c4fa94bd0844cf6805f17124cb529a85d24c34f0 100644 |
| --- a/content/child/bluetooth/web_bluetooth_impl.h |
| +++ b/content/child/bluetooth/web_bluetooth_impl.h |
| @@ -5,30 +5,43 @@ |
| #ifndef CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| #define CONTENT_CHILD_BLUETOOTH_WEB_BLUETOOTH_IMPL_H_ |
| +#include <string> |
| + |
| #include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| #include "content/common/content_export.h" |
| #include "third_party/WebKit/public/platform/WebBluetooth.h" |
| -#include "third_party/WebKit/public/platform/WebBluetoothError.h" |
| namespace content { |
| -// Mock implementation of blink::WebBluetooth until a more complete |
| -// implementation is built out. |
| +class BluetoothDispatcher; |
| +class ThreadSafeSender; |
| + |
| +// Implementation of blink::WebBluetooth. Passes calls through to the thread |
| +// specific BluetoothDispatcher. |
| class CONTENT_EXPORT WebBluetoothImpl |
| : NON_EXPORTED_BASE(public blink::WebBluetooth) { |
| public: |
| - WebBluetoothImpl(); |
| + explicit WebBluetoothImpl(ThreadSafeSender* thread_safe_sender); |
| + ~WebBluetoothImpl(); |
| - // WebBluetooth interface: |
| - void requestDevice(blink::WebBluetoothRequestDeviceCallbacks*) override; |
| + // blink::WebBluetooth interface: |
| + // TODO: Remove void version after crrev.com/715613005 lands. |
|
nasko
2014/11/25 23:27:01
nit: TODO(username):
scheib
2014/11/26 00:46:34
Done.
|
| + void requestDevice( |
| + blink::WebCallbacks<void, blink::WebBluetoothError>* callbacks) override; |
| + void requestDevice( |
| + blink::WebCallbacks<blink::WebBluetoothDevice, blink::WebBluetoothError>* |
| + callbacks) override; |
| // Testing interface: |
| void SetBluetoothMockDataSetForTesting(const std::string& name); |
| private: |
| - enum class MockData { NOT_MOCKING, REJECT, RESOLVE }; |
| - MockData m_bluetoothMockDataSet; |
| - blink::WebBluetoothError::ErrorType m_bluetoothRequestDeviceRejectType; |
| + BluetoothDispatcher* GetDispatcher(); |
| + |
| + scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebBluetoothImpl); |
| }; |
| } // namespace content |