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

Side by Side Diff: content/browser/bluetooth/web_bluetooth_service_impl.cc

Issue 2016973003: bluetooth: Fix logic mistake in DeviceChanged (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // ID Not In Map Note: 5 // ID Not In Map Note:
6 // A service, characteristic, or descriptor ID not in the corresponding 6 // A service, characteristic, or descriptor ID not in the corresponding
7 // WebBluetoothServiceImpl map [service_id_to_device_address_, 7 // WebBluetoothServiceImpl map [service_id_to_device_address_,
8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a 8 // characteristic_id_to_service_id_, descriptor_to_characteristic_] implies a
9 // hostile renderer because a renderer obtains the corresponding ID from this 9 // hostile renderer because a renderer obtains the corresponding ID from this
10 // class and it will be added to the map at that time. 10 // class and it will be added to the map at that time.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (device_chooser_controller_.get()) { 210 if (device_chooser_controller_.get()) {
211 VLOG(1) << "Adding device to device chooser controller: " 211 VLOG(1) << "Adding device to device chooser controller: "
212 << device->GetAddress(); 212 << device->GetAddress();
213 device_chooser_controller_->AddFilteredDevice(*device); 213 device_chooser_controller_->AddFilteredDevice(*device);
214 } 214 }
215 } 215 }
216 216
217 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter, 217 void WebBluetoothServiceImpl::DeviceChanged(device::BluetoothAdapter* adapter,
218 device::BluetoothDevice* device) { 218 device::BluetoothDevice* device) {
219 DCHECK_CURRENTLY_ON(BrowserThread::UI); 219 DCHECK_CURRENTLY_ON(BrowserThread::UI);
220 if (!device->IsGattConnected() || !device->IsConnected()) { 220 if (!device->IsGattConnected() && !device->IsConnected()) {
Jeffrey Yasskin 2016/05/28 02:48:00 Should we only check one of these? All of our conn
Jeffrey Yasskin 2016/05/28 03:49:52 Does it make sense to implement it to forward to I
ortuno 2016/05/31 16:33:21 Done. I thought it was going to be much harder so
221 std::string device_id = 221 std::string device_id =
222 connected_devices_->CloseConnectionToDeviceWithAddress( 222 connected_devices_->CloseConnectionToDeviceWithAddress(
223 device->GetAddress()); 223 device->GetAddress());
224 if (!device_id.empty()) { 224 if (!device_id.empty()) {
225 if (client_) { 225 if (client_) {
226 client_->GattServerDisconnected(device_id); 226 client_->GattServerDisconnected(device_id);
227 } 227 }
228 } 228 }
229 } 229 }
230 } 230 }
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 characteristic_id_to_service_id_.clear(); 952 characteristic_id_to_service_id_.clear();
953 service_id_to_device_address_.clear(); 953 service_id_to_device_address_.clear();
954 connected_devices_.reset( 954 connected_devices_.reset(
955 new FrameConnectedBluetoothDevices(render_frame_host_)); 955 new FrameConnectedBluetoothDevices(render_frame_host_));
956 allowed_devices_map_ = BluetoothAllowedDevicesMap(); 956 allowed_devices_map_ = BluetoothAllowedDevicesMap();
957 device_chooser_controller_.reset(); 957 device_chooser_controller_.reset();
958 GetBluetoothAdapterFactoryWrapper()->ReleaseAdapter(this); 958 GetBluetoothAdapterFactoryWrapper()->ReleaseAdapter(this);
959 } 959 }
960 960
961 } // namespace content 961 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698