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

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

Issue 1235243005: Refactor the BluetoothDispatcherHost to store requestDevice sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@error-enum-cleanup
Patch Set: Add a comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/bad_message.h ('k') | 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 051e1ab40c50619e6c2d7bcaa7ace817e1328437..c118d15f460e9a35b91f6bc3d92a8301ee94823c 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -51,7 +51,7 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
friend class base::DeleteHelper<BluetoothDispatcherHost>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
- struct DiscoverySessionOptions;
+ struct RequestDeviceSession;
// Set |adapter_| to a BluetoothAdapter instance and register observers,
// releasing references to previous |adapter_|.
@@ -85,7 +85,6 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
void OnDiscoverySessionStarted(
int thread_id,
int request_id,
- scoped_ptr<DiscoverySessionOptions> options,
scoped_ptr<device::BluetoothDiscoverySession> discovery_session);
void OnDiscoverySessionStartedError(int thread_id, int request_id);
@@ -93,13 +92,10 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
void StopDiscoverySession(
int thread_id,
int request_id,
- scoped_ptr<DiscoverySessionOptions> options,
scoped_ptr<device::BluetoothDiscoverySession> discovery_session);
// Callbacks for BluetoothDiscoverySession::Stop.
- void OnDiscoverySessionStopped(int thread_id,
- int request_id,
- scoped_ptr<DiscoverySessionOptions> options);
+ void OnDiscoverySessionStopped(int thread_id, int request_id);
void OnDiscoverySessionStoppedError(int thread_id, int request_id);
// Callbacks for BluetoothDevice::CreateGattConnection.
@@ -137,6 +133,12 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
int request_id,
device::BluetoothGattService::GattErrorCode);
+ // Maps a (thread_id,request_id) to information about its requestDevice call,
+ // including the chooser dialog.
+ // An entry is added to this map in OnRequestDevice, and should be removed
+ // again everywhere a requestDevice() reply is sent.
+ std::map<std::pair<int, int>, RequestDeviceSession> request_device_sessions_;
+
// Maps to get the object's parent based on it's instanceID
// Map of service_instance_id to device_instance_id.
std::map<std::string, std::string> service_to_device_;
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698