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

Side by Side Diff: content/browser/bluetooth/web_bluetooth_service_impl.h

Issue 2059543002: bluetooth: Move FactoryWrapper to device and expose a function for testing in chooser controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Remove code from client interface Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 #include "mojo/public/cpp/bindings/binding.h" 24 #include "mojo/public/cpp/bindings/binding.h"
25 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om.h" 25 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om.h"
26 26
27 namespace url { 27 namespace url {
28 class Origin; 28 class Origin;
29 } // namespace url 29 } // namespace url
30 30
31 namespace content { 31 namespace content {
32 32
33 class BluetoothDeviceChooserController; 33 class BluetoothDeviceChooserController;
34 class BluetoothAdapterFactoryWrapper;
35 class FrameConnectedBluetoothDevices; 34 class FrameConnectedBluetoothDevices;
36 class RenderFrameHost; 35 class RenderFrameHost;
37 class RenderProcessHost; 36 class RenderProcessHost;
38 37
39 // Implementation of Mojo WebBluetoothService located in 38 // Implementation of Mojo WebBluetoothService located in
40 // third_party/WebKit/public/platform/modules/bluetooth. 39 // third_party/WebKit/public/platform/modules/bluetooth.
41 // It handles Web Bluetooth API requests coming from Blink / renderer 40 // It handles Web Bluetooth API requests coming from Blink / renderer
42 // process and uses the platform abstraction of device/bluetooth. 41 // process and uses the platform abstraction of device/bluetooth.
43 // WebBluetoothServiceImpl is not thread-safe and should be created on the 42 // WebBluetoothServiceImpl is not thread-safe and should be created on the
44 // UI thread as required by device/bluetooth. 43 // UI thread as required by device/bluetooth.
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // in the |outcome| field, and |device| and |service| fields if successful. 200 // in the |outcome| field, and |device| and |service| fields if successful.
202 CacheQueryResult QueryCacheForService(const std::string& service_instance_id); 201 CacheQueryResult QueryCacheForService(const std::string& service_instance_id);
203 202
204 // Queries the platform cache for a characteristic with 203 // Queries the platform cache for a characteristic with
205 // |characteristic_instance_id|. Fills in the |outcome| field, and |device|, 204 // |characteristic_instance_id|. Fills in the |outcome| field, and |device|,
206 // |service| and |characteristic| fields if successful. 205 // |service| and |characteristic| fields if successful.
207 CacheQueryResult QueryCacheForCharacteristic( 206 CacheQueryResult QueryCacheForCharacteristic(
208 const std::string& characteristic_instance_id); 207 const std::string& characteristic_instance_id);
209 208
210 RenderProcessHost* GetRenderProcessHost(); 209 RenderProcessHost* GetRenderProcessHost();
211 BluetoothAdapterFactoryWrapper* GetBluetoothAdapterFactoryWrapper();
212 device::BluetoothAdapter* GetAdapter(); 210 device::BluetoothAdapter* GetAdapter();
213 url::Origin GetOrigin(); 211 url::Origin GetOrigin();
214 212
215 // Clears all state (maps, sets, etc). 213 // Clears all state (maps, sets, etc).
216 void ClearState(); 214 void ClearState();
217 215
218 // Used to open a BluetoothChooser and start a device discovery session. 216 // Used to open a BluetoothChooser and start a device discovery session.
219 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_; 217 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_;
220 218
221 // Keeps track of which devices the frame's origin is allowed to access. 219 // Keeps track of which devices the frame's origin is allowed to access.
(...skipping 28 matching lines...) Expand all
250 mojo::Binding<blink::mojom::WebBluetoothService> binding_; 248 mojo::Binding<blink::mojom::WebBluetoothService> binding_;
251 249
252 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; 250 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_;
253 251
254 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); 252 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl);
255 }; 253 };
256 254
257 } // namespace content 255 } // namespace content
258 256
259 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ 257 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698