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

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

Issue 2030973002: bluetooth: Handle two consecutives requestDevice calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Created 4 years, 6 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/web_bluetooth_service_impl.cc
diff --git a/content/browser/bluetooth/web_bluetooth_service_impl.cc b/content/browser/bluetooth/web_bluetooth_service_impl.cc
index 46c94f109ceaf62569af389968a7edaec44d75c4..3c6846f0a0d061c6ef87c5881356677779fa324e 100644
--- a/content/browser/bluetooth/web_bluetooth_service_impl.cc
+++ b/content/browser/bluetooth/web_bluetooth_service_impl.cc
@@ -650,10 +650,10 @@ void WebBluetoothServiceImpl::RequestDeviceImpl(
blink::mojom::WebBluetoothRequestDeviceOptionsPtr options,
const RequestDeviceCallback& callback,
device::BluetoothAdapter* adapter) {
- // requestDevice() can only be called when processing a user-gesture and
- // any user gesture outside of a chooser should close the chooser so we should
- // never get a request with an open chooser.
- CHECK(!device_chooser_controller_.get());
+ // requestDevice() can only be called when processing a user-gesture and any
+ // user gesture outside of a chooser should close the chooser. But this does
+ // not happen on all platforms so we manually close any open choosers.
+ device_chooser_controller_.reset();
Jeffrey Yasskin 2016/06/10 00:49:22 Can you just delete this line? That'll wind up des
ortuno 2016/06/10 18:10:07 I revised the comment. Let me know if you don't th
Jeffrey Yasskin 2016/06/10 18:47:18 Well, the second chooser doesn't open until you ca
ortuno 2016/06/10 19:32:01 Done. Thanks for the suggestion!
device_chooser_controller_.reset(new BluetoothDeviceChooserController(
this, render_frame_host_, adapter,

Powered by Google App Engine
This is Rietveld 408576698