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

Side by Side Diff: device/bluetooth/bluetooth_device_win.cc

Issue 1284073002: bluetooth: Add adapter to BluetoothDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-drop-callback-
Patch Set: Merge TOT Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "device/bluetooth/bluetooth_device_win.h" 5 #include "device/bluetooth/bluetooth_device_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "device/bluetooth/bluetooth_adapter_win.h"
15 #include "device/bluetooth/bluetooth_service_record_win.h" 16 #include "device/bluetooth/bluetooth_service_record_win.h"
16 #include "device/bluetooth/bluetooth_socket_thread.h" 17 #include "device/bluetooth/bluetooth_socket_thread.h"
17 #include "device/bluetooth/bluetooth_socket_win.h" 18 #include "device/bluetooth/bluetooth_socket_win.h"
18 #include "device/bluetooth/bluetooth_task_manager_win.h" 19 #include "device/bluetooth/bluetooth_task_manager_win.h"
19 #include "device/bluetooth/bluetooth_uuid.h" 20 #include "device/bluetooth/bluetooth_uuid.h"
20 21
21 namespace { 22 namespace {
22 23
23 const char kApiUnavailable[] = "This API is not implemented on this platform."; 24 const char kApiUnavailable[] = "This API is not implemented on this platform.";
24 25
25 } // namespace 26 } // namespace
26 27
27 namespace device { 28 namespace device {
28 29
29 BluetoothDeviceWin::BluetoothDeviceWin( 30 BluetoothDeviceWin::BluetoothDeviceWin(
31 BluetoothAdapterWin* adapter,
30 const BluetoothTaskManagerWin::DeviceState& device_state, 32 const BluetoothTaskManagerWin::DeviceState& device_state,
31 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner, 33 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
32 const scoped_refptr<BluetoothSocketThread>& socket_thread, 34 const scoped_refptr<BluetoothSocketThread>& socket_thread,
33 net::NetLog* net_log, 35 net::NetLog* net_log,
34 const net::NetLog::Source& net_log_source) 36 const net::NetLog::Source& net_log_source)
35 : BluetoothDevice(), 37 : BluetoothDevice(adapter),
36 ui_task_runner_(ui_task_runner), 38 ui_task_runner_(ui_task_runner),
37 socket_thread_(socket_thread), 39 socket_thread_(socket_thread),
38 net_log_(net_log), 40 net_log_(net_log),
39 net_log_source_(net_log_source) { 41 net_log_source_(net_log_source) {
40 Update(device_state); 42 Update(device_state);
41 } 43 }
42 44
43 BluetoothDeviceWin::~BluetoothDeviceWin() { 45 BluetoothDeviceWin::~BluetoothDeviceWin() {
44 } 46 }
45 47
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); 284 for (ServiceRecordList::const_iterator iter = service_record_list_.begin();
283 iter != service_record_list_.end(); 285 iter != service_record_list_.end();
284 ++iter) { 286 ++iter) {
285 if ((*iter)->uuid() == uuid) 287 if ((*iter)->uuid() == uuid)
286 return *iter; 288 return *iter;
287 } 289 }
288 return NULL; 290 return NULL;
289 } 291 }
290 292
291 } // namespace device 293 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device_win.h ('k') | device/bluetooth/bluetooth_device_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698