OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_mac.h" | 5 #include "device/bluetooth/bluetooth_socket_mac.h" |
6 | 6 |
7 #import <IOBluetooth/IOBluetooth.h> | 7 #import <IOBluetooth/IOBluetooth.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 | 227 |
228 temp->success_callback.Run(); | 228 temp->success_callback.Run(); |
229 } | 229 } |
230 | 230 |
231 void BluetoothSocketMac::Close() { | 231 void BluetoothSocketMac::Close() { |
232 DCHECK(thread_checker_.CalledOnValidThread()); | 232 DCHECK(thread_checker_.CalledOnValidThread()); |
233 | 233 |
234 ReleaseChannel(); | 234 ReleaseChannel(); |
235 } | 235 } |
236 | 236 |
237 void BluetoothSocketMac::Disconnect(const base::Closure& callback) { | 237 void BluetoothSocketMac::Disconnect(const base::Closure& success_callback) { |
238 DCHECK(thread_checker_.CalledOnValidThread()); | 238 DCHECK(thread_checker_.CalledOnValidThread()); |
239 | 239 |
240 ReleaseChannel(); | 240 ReleaseChannel(); |
241 callback.Run(); | 241 callback.Run(); |
Ilya Sherman
2014/04/30 23:57:42
You should probably update the name here, too ;)
keybuk
2014/05/01 00:24:09
The success_callback thing was a holdover from a c
| |
242 } | 242 } |
243 | 243 |
244 void BluetoothSocketMac::Receive( | 244 void BluetoothSocketMac::Receive( |
245 int /* buffer_size */, | 245 int /* buffer_size */, |
246 const ReceiveCompletionCallback& success_callback, | 246 const ReceiveCompletionCallback& success_callback, |
247 const ReceiveErrorCompletionCallback& error_callback) { | 247 const ReceiveErrorCompletionCallback& error_callback) { |
248 DCHECK(thread_checker_.CalledOnValidThread()); | 248 DCHECK(thread_checker_.CalledOnValidThread()); |
249 | 249 |
250 if (connecting()) { | 250 if (connecting()) { |
251 error_callback.Run(BluetoothSocket::kSystemError, kSocketConnecting); | 251 error_callback.Run(BluetoothSocket::kSystemError, kSocketConnecting); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 if (receive_callbacks_) { | 414 if (receive_callbacks_) { |
415 scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); | 415 scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); |
416 temp->error_callback.Run(BluetoothSocket::kDisconnected, | 416 temp->error_callback.Run(BluetoothSocket::kDisconnected, |
417 kSocketNotConnected); | 417 kSocketNotConnected); |
418 } | 418 } |
419 | 419 |
420 ReleaseChannel(); | 420 ReleaseChannel(); |
421 } | 421 } |
422 | 422 |
423 } // namespace device | 423 } // namespace device |
OLD | NEW |