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

Side by Side Diff: content/child/bluetooth/web_bluetooth_impl.cc

Issue 1234413006: Move the Web Bluetooth implementation from child/ to renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Rebase Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/child/bluetooth/web_bluetooth_impl.h ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "content/child/bluetooth/web_bluetooth_impl.h"
6
7 #include "content/child/bluetooth/bluetooth_dispatcher.h"
8 #include "content/child/thread_safe_sender.h"
9
10 namespace content {
11
12 WebBluetoothImpl::WebBluetoothImpl(ThreadSafeSender* thread_safe_sender)
13 : thread_safe_sender_(thread_safe_sender) {
14 }
15
16 WebBluetoothImpl::~WebBluetoothImpl() {
17 }
18
19 void WebBluetoothImpl::requestDevice(
20 const blink::WebRequestDeviceOptions& options,
21 blink::WebBluetoothRequestDeviceCallbacks* callbacks) {
22 GetDispatcher()->requestDevice(options, callbacks);
23 }
24
25 void WebBluetoothImpl::connectGATT(const blink::WebString& device_instance_id,
26 blink::WebBluetoothConnectGATTCallbacks* callbacks) {
27 GetDispatcher()->connectGATT(device_instance_id, callbacks);
28 }
29
30 void WebBluetoothImpl::getPrimaryService(
31 const blink::WebString& device_instance_id,
32 const blink::WebString& service_uuid,
33 blink::WebBluetoothGetPrimaryServiceCallbacks* callbacks) {
34 GetDispatcher()->getPrimaryService(device_instance_id, service_uuid,
35 callbacks);
36 }
37
38 void WebBluetoothImpl::getCharacteristic(
39 const blink::WebString& service_instance_id,
40 const blink::WebString& characteristic_uuid,
41 blink::WebBluetoothGetCharacteristicCallbacks* callbacks) {
42 GetDispatcher()->getCharacteristic(service_instance_id, characteristic_uuid,
43 callbacks);
44 }
45
46 void WebBluetoothImpl::readValue(
47 const blink::WebString& characteristic_instance_id,
48 blink::WebBluetoothReadValueCallbacks* callbacks) {
49 GetDispatcher()->readValue(characteristic_instance_id, callbacks);
50 }
51
52 void WebBluetoothImpl::writeValue(
53 const blink::WebString& characteristic_instance_id,
54 const std::vector<uint8_t>& value,
55 blink::WebBluetoothWriteValueCallbacks* callbacks) {
56 GetDispatcher()->writeValue(characteristic_instance_id, value, callbacks);
57 }
58
59 BluetoothDispatcher* WebBluetoothImpl::GetDispatcher() {
60 return BluetoothDispatcher::GetOrCreateThreadSpecificInstance(
61 thread_safe_sender_.get());
62 }
63
64 } // namespace content
OLDNEW
« no previous file with comments | « content/child/bluetooth/web_bluetooth_impl.h ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698