OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, | 7 // BluetoothDispatcherHost map [service_to_device_, characteristic_to_service_, |
8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer | 8 // descriptor_to_characteristic_] implies a hostile renderer because a renderer |
9 // obtains the corresponding ID from this class and it will be added to the map | 9 // obtains the corresponding ID from this class and it will be added to the map |
10 // at that time. | 10 // at that time. |
11 | 11 |
12 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" | 12 #include "content/browser/bluetooth/bluetooth_dispatcher_host.h" |
13 | 13 |
| 14 #include <utility> |
| 15 |
14 #include "base/bind.h" | 16 #include "base/bind.h" |
15 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
17 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
18 #include "content/browser/bad_message.h" | 20 #include "content/browser/bad_message.h" |
19 #include "content/browser/bluetooth/bluetooth_metrics.h" | 21 #include "content/browser/bluetooth/bluetooth_metrics.h" |
20 #include "content/browser/bluetooth/first_device_bluetooth_chooser.h" | 22 #include "content/browser/bluetooth/first_device_bluetooth_chooser.h" |
21 #include "content/browser/frame_host/render_frame_host_impl.h" | 23 #include "content/browser/frame_host/render_frame_host_impl.h" |
22 #include "content/common/bluetooth/bluetooth_messages.h" | 24 #include "content/common/bluetooth/bluetooth_messages.h" |
23 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // Since this can happen after the test is done and the cleanup function is | 292 // Since this can happen after the test is done and the cleanup function is |
291 // called, we clean them here. | 293 // called, we clean them here. |
292 service_to_device_.clear(); | 294 service_to_device_.clear(); |
293 characteristic_to_service_.clear(); | 295 characteristic_to_service_.clear(); |
294 characteristic_id_to_notify_session_.clear(); | 296 characteristic_id_to_notify_session_.clear(); |
295 active_characteristic_threads_.clear(); | 297 active_characteristic_threads_.clear(); |
296 connections_.clear(); | 298 connections_.clear(); |
297 devices_with_discovered_services_.clear(); | 299 devices_with_discovered_services_.clear(); |
298 } | 300 } |
299 | 301 |
300 set_adapter(mock_adapter.Pass()); | 302 set_adapter(std::move(mock_adapter)); |
301 } | 303 } |
302 | 304 |
303 BluetoothDispatcherHost::~BluetoothDispatcherHost() { | 305 BluetoothDispatcherHost::~BluetoothDispatcherHost() { |
304 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 306 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
305 // Clear adapter, releasing observer references. | 307 // Clear adapter, releasing observer references. |
306 set_adapter(scoped_refptr<device::BluetoothAdapter>()); | 308 set_adapter(scoped_refptr<device::BluetoothAdapter>()); |
307 } | 309 } |
308 | 310 |
309 // Stores information associated with an in-progress requestDevice call. This | 311 // Stores information associated with an in-progress requestDevice call. This |
310 // will include the state of the active chooser dialog in a future patch. | 312 // will include the state of the active chooser dialog in a future patch. |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1342 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1341 NOTIMPLEMENTED(); | 1343 NOTIMPLEMENTED(); |
1342 } | 1344 } |
1343 | 1345 |
1344 void BluetoothDispatcherHost::ShowNeedLocationLink() { | 1346 void BluetoothDispatcherHost::ShowNeedLocationLink() { |
1345 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1347 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1346 NOTIMPLEMENTED(); | 1348 NOTIMPLEMENTED(); |
1347 } | 1349 } |
1348 | 1350 |
1349 } // namespace content | 1351 } // namespace content |
OLD | NEW |