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

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

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: address comments Created 3 years, 10 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
Index: content/browser/bluetooth/frame_connected_bluetooth_devices.h
diff --git a/content/browser/bluetooth/frame_connected_bluetooth_devices.h b/content/browser/bluetooth/frame_connected_bluetooth_devices.h
index 4168059d2f92b9a008f3fc0877e815d20a3b9c72..5edd3b187e982e48cea2e6a9c10687d594ba4cff 100644
--- a/content/browser/bluetooth/frame_connected_bluetooth_devices.h
+++ b/content/browser/bluetooth/frame_connected_bluetooth_devices.h
@@ -8,10 +8,12 @@
#include <memory>
#include <string>
#include <unordered_map>
+#include <utility>
#include "base/optional.h"
#include "content/common/bluetooth/web_bluetooth_device_id.h"
#include "content/common/content_export.h"
+#include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom.h"
#include "url/origin.h"
namespace device {
@@ -42,7 +44,8 @@ class CONTENT_EXPORT FrameConnectedBluetoothDevices final {
// If a connection doesn't exist already for |device_id|, adds a connection to
// the map and increases the WebContents count of connected devices.
void Insert(const WebBluetoothDeviceId& device_id,
- std::unique_ptr<device::BluetoothGattConnection> connection);
+ std::unique_ptr<device::BluetoothGattConnection> connection,
+ blink::mojom::WebBluetoothServerClientAssociatedPtr client);
// Deletes the BluetoothGattConnection for |device_id| and decrements the
// WebContents count of connected devices if |device_id| had a connection.
@@ -66,9 +69,11 @@ class CONTENT_EXPORT FrameConnectedBluetoothDevices final {
// Keeps the BluetoothGattConnection objects alive so that connections don't
// get closed.
- std::unordered_map<WebBluetoothDeviceId,
- std::unique_ptr<device::BluetoothGattConnection>,
- WebBluetoothDeviceIdHash>
+ std::unordered_map<
+ WebBluetoothDeviceId,
+ std::pair<std::unique_ptr<device::BluetoothGattConnection>,
+ blink::mojom::WebBluetoothServerClientAssociatedPtr>,
+ WebBluetoothDeviceIdHash>
device_id_to_connection_map_;
// Keeps track of which device addresses correspond to which ids.

Powered by Google App Engine
This is Rietveld 408576698