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

Unified Diff: content/child/bluetooth/web_bluetooth_impl.h

Issue 699843003: bluetooth: Impl uses new WebBluetoothDevice in content/browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Addressing comments from 12 - 14 Created 6 years, 1 month 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: 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

Powered by Google App Engine
This is Rietveld 408576698