OLD | NEW |
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_socket_win.h" | 5 #include "device/bluetooth/bluetooth_socket_win.h" |
6 | 6 |
7 #include <objbase.h> | 7 #include <objbase.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return; | 111 return; |
112 } | 112 } |
113 | 113 |
114 const BluetoothServiceRecordWin* service_record_win = | 114 const BluetoothServiceRecordWin* service_record_win = |
115 device->GetServiceRecord(uuid); | 115 device->GetServiceRecord(uuid); |
116 if (!service_record_win) { | 116 if (!service_record_win) { |
117 error_callback.Run(kInvalidUUID); | 117 error_callback.Run(kInvalidUUID); |
118 return; | 118 return; |
119 } | 119 } |
120 | 120 |
121 device_address_ = service_record_win->address(); | 121 device_address_ = service_record_win->device_address(); |
122 if (service_record_win->SupportsRfcomm()) { | 122 if (service_record_win->SupportsRfcomm()) { |
123 supports_rfcomm_ = true; | 123 supports_rfcomm_ = true; |
124 rfcomm_channel_ = service_record_win->rfcomm_channel(); | 124 rfcomm_channel_ = service_record_win->rfcomm_channel(); |
125 bth_addr_ = service_record_win->bth_addr(); | 125 bth_addr_ = service_record_win->device_bth_addr(); |
126 } | 126 } |
127 | 127 |
128 socket_thread()->task_runner()->PostTask( | 128 socket_thread()->task_runner()->PostTask( |
129 FROM_HERE, | 129 FROM_HERE, |
130 base::Bind( | 130 base::Bind( |
131 &BluetoothSocketWin::DoConnect, | 131 &BluetoothSocketWin::DoConnect, |
132 this, | 132 this, |
133 base::Bind(&BluetoothSocketWin::PostSuccess, this, success_callback), | 133 base::Bind(&BluetoothSocketWin::PostSuccess, this, success_callback), |
134 base::Bind( | 134 base::Bind( |
135 &BluetoothSocketWin::PostErrorCompletion, this, error_callback))); | 135 &BluetoothSocketWin::PostErrorCompletion, this, error_callback))); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 scoped_refptr<BluetoothSocketWin> peer_socket = CreateBluetoothSocket( | 392 scoped_refptr<BluetoothSocketWin> peer_socket = CreateBluetoothSocket( |
393 ui_task_runner(), | 393 ui_task_runner(), |
394 socket_thread(), | 394 socket_thread(), |
395 net_log(), | 395 net_log(), |
396 source()); | 396 source()); |
397 peer_socket->SetTCPSocket(accept_socket.Pass()); | 397 peer_socket->SetTCPSocket(accept_socket.Pass()); |
398 success_callback.Run(peer_device, peer_socket); | 398 success_callback.Run(peer_device, peer_socket); |
399 } | 399 } |
400 | 400 |
401 } // namespace device | 401 } // namespace device |
OLD | NEW |