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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.h

Issue 1315573004: bluetooth: Refactor code that checks if device/service/characteristic is in cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.h
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h
index 7e3e7af45cb7d59206db6e04237ee11c962828d7..70517898a292cc24d231afefb0a86f750a547951 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -18,6 +18,10 @@ namespace device {
class BluetoothUUID;
}
+namespace blink {
+enum class WebBluetoothError;
+}
+
namespace content {
struct BluetoothScanFilter;
@@ -55,6 +59,23 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
struct RequestDeviceSession;
+ enum class CacheQueryOutcome {
+ SUCCESS = 0,
+ BAD_RENDERER = 1,
+ NO_DEVICE = 2,
+ NO_SERVICE = 3,
+ NO_CHARACTERISTIC = 4
+ };
+
+ blink::WebBluetoothError CacheQueryOutcomeToWebBluetoothError(
+ CacheQueryOutcome outcome);
+ std::pair<CacheQueryOutcome, device::BluetoothDevice*> QueryForDevice(
+ const std::string& device_instance_id);
+ std::pair<CacheQueryOutcome, device::BluetoothGattService*> QueryForService(
+ const std::string& service_instance_id);
+ std::pair<CacheQueryOutcome, device::BluetoothGattCharacteristic*>
+ QueryForCharacteristic(const std::string& characteristic_instance_id);
+
// Set |adapter_| to a BluetoothAdapter instance and register observers,
// releasing references to previous |adapter_|.
void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter);
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698