| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void BluetoothSocketWin::ResetData() { | 130 void BluetoothSocketWin::ResetData() { |
| 131 if (service_reg_data_) { | 131 if (service_reg_data_) { |
| 132 if (WSASetService(&service_reg_data_->service,RNRSERVICE_DELETE, 0) == | 132 if (WSASetService(&service_reg_data_->service,RNRSERVICE_DELETE, 0) == |
| 133 SOCKET_ERROR) { | 133 SOCKET_ERROR) { |
| 134 LOG(WARNING) << "Failed to unregister service."; | 134 LOG(WARNING) << "Failed to unregister service."; |
| 135 } | 135 } |
| 136 service_reg_data_.reset(); | 136 service_reg_data_.reset(); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 void BluetoothSocketWin::Accept( |
| 141 const AcceptCompletionCallback& success_callback, |
| 142 const ErrorCompletionCallback& error_callback) { |
| 143 NOTIMPLEMENTED(); |
| 144 } |
| 145 |
| 140 void BluetoothSocketWin::DoConnect( | 146 void BluetoothSocketWin::DoConnect( |
| 141 const base::Closure& success_callback, | 147 const base::Closure& success_callback, |
| 142 const ErrorCompletionCallback& error_callback) { | 148 const ErrorCompletionCallback& error_callback) { |
| 143 DCHECK(socket_thread()->task_runner()->RunsTasksOnCurrentThread()); | 149 DCHECK(socket_thread()->task_runner()->RunsTasksOnCurrentThread()); |
| 144 base::ThreadRestrictions::AssertIOAllowed(); | 150 base::ThreadRestrictions::AssertIOAllowed(); |
| 145 | 151 |
| 146 if (tcp_socket()) { | 152 if (tcp_socket()) { |
| 147 error_callback.Run(kSocketAlreadyConnected); | 153 error_callback.Run(kSocketAlreadyConnected); |
| 148 return; | 154 return; |
| 149 } | 155 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 ui_task_runner(), | 339 ui_task_runner(), |
| 334 socket_thread(), | 340 socket_thread(), |
| 335 net_log(), | 341 net_log(), |
| 336 source()); | 342 source()); |
| 337 peer->SetTCPSocket(accept_socket.Pass()); | 343 peer->SetTCPSocket(accept_socket.Pass()); |
| 338 | 344 |
| 339 on_new_connection_callback_.Run(peer, peer_address); | 345 on_new_connection_callback_.Run(peer, peer_address); |
| 340 } | 346 } |
| 341 | 347 |
| 342 } // namespace device | 348 } // namespace device |
| OLD | NEW |