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

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

Issue 1397983004: bluetooth: Refactor repeated code used to find a Bluetooth object from its ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-characteristic-changed-1
Patch Set: Fix compile errors on bots Created 5 years, 2 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 d84a8b3dc0b38462612fa856dcc7d03c27654467..9686bf0a624c7d65c0eeb6d926d3884e9c71b4d6 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -56,6 +56,7 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
friend class base::DeleteHelper<BluetoothDispatcherHost>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
+ struct CacheQueryResult;
struct RequestDeviceSession;
// Set |adapter_| to a BluetoothAdapter instance and register observers,
@@ -195,6 +196,29 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
int request_id,
const std::string& characteristic_instance_id);
+ // Functions to query the platform cache for the bluetooth object.
+ // result.outcome == CacheQueryOutcome::SUCCESS if the object was found in the
+ // cache. Otherwise result.outcome that can used to record the outcome and
+ // result.error will contain the error that should be send to the renderer.
+ // One of the possible outcomes is BAD_RENDERER. In this case the outcome
+ // was already recorded and since there renderer crashed there is no need to
+ // send a response.
+
+ // Queries the platform cache for a Device with |device_instance_id|. If
+ // successful the device will be in result.device
+ void QueryCacheForDevice(const std::string& device_instance_id,
+ CacheQueryResult& result);
+ // Queries the platform cache for a Service with |service_instance_id|.
+ // If successfull the service will be in result.service.
+ void QueryCacheForService(const std::string& service_instance_id,
+ CacheQueryResult& result);
+ // Queries the platform cache for a characteristic with
+ // |characteristic_instance_id|. If successfull the characteristic will be in
+ // result.characteristic.
+ void QueryCacheForCharacteristic(
+ const std::string& characteristic_instance_id,
+ CacheQueryResult& result);
+
// Show help pages from the chooser dialog.
void ShowBluetoothOverviewLink();
void ShowBluetoothPairingLink();
« 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