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

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

Issue 1859463002: bluetooth: Remove disconnect when page hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jyasskin's comments Created 4 years, 8 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 | third_party/WebKit/LayoutTests/bluetooth/connect.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index 71f66c3f8083cded7e21ab6bc9cd23c1b93de6cf..c7a2dd3c5d1d75e97a7c619156e51d6fee24e341 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -701,16 +701,11 @@ void BluetoothDispatcherHost::OnGATTServerDisconnect(
RecordWebBluetoothFunctionCall(
UMAWebBluetoothFunction::REMOTE_GATT_SERVER_DISCONNECT);
- // Make sure the origin is allowed to access the device. We perform this check
- // in case a hostile renderer is trying to disconnect a device that the
- // renderer is not allowed to access.
- if (allowed_devices_map_.GetDeviceAddress(GetOrigin(frame_routing_id),
- device_id)
- .empty()) {
- bad_message::ReceivedBadMessage(
- this, bad_message::BDH_DEVICE_NOT_ALLOWED_FOR_ORIGIN);
- return;
- }
+ // Frames can send a disconnect request after they've started navigating,
+ // making calls to GetLastCommitted origin invalid. Because we still need
+ // to disconnect the device, otherwise we would leave users with no other
+ // option to disconnect than closing the tab, we purposefully don't
+ // check if the frame has permission to interact with the device.
RenderFrameHostImpl* render_frame_host =
RenderFrameHostImpl::FromID(render_process_id_, frame_routing_id);
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/bluetooth/connect.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698