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_chromeos.h" | 5 #include "device/bluetooth/bluetooth_socket_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 this, | 63 this, |
64 base::Passed(&fd), | 64 base::Passed(&fd), |
65 base::Bind(&BluetoothSocketChromeOS::PostSuccess, | 65 base::Bind(&BluetoothSocketChromeOS::PostSuccess, |
66 this, | 66 this, |
67 success_callback), | 67 success_callback), |
68 base::Bind(&BluetoothSocketChromeOS::PostErrorCompletion, | 68 base::Bind(&BluetoothSocketChromeOS::PostErrorCompletion, |
69 this, | 69 this, |
70 error_callback))); | 70 error_callback))); |
71 } | 71 } |
72 | 72 |
| 73 void BluetoothSocketChromeOS::Accept( |
| 74 const AcceptCompletionCallback& success_callback, |
| 75 const ErrorCompletionCallback& error_callback) { |
| 76 NOTIMPLEMENTED(); |
| 77 } |
| 78 |
73 void BluetoothSocketChromeOS::DoConnect( | 79 void BluetoothSocketChromeOS::DoConnect( |
74 scoped_ptr<dbus::FileDescriptor> fd, | 80 scoped_ptr<dbus::FileDescriptor> fd, |
75 const base::Closure& success_callback, | 81 const base::Closure& success_callback, |
76 const ErrorCompletionCallback& error_callback) { | 82 const ErrorCompletionCallback& error_callback) { |
77 DCHECK(socket_thread()->task_runner()->RunsTasksOnCurrentThread()); | 83 DCHECK(socket_thread()->task_runner()->RunsTasksOnCurrentThread()); |
78 base::ThreadRestrictions::AssertIOAllowed(); | 84 base::ThreadRestrictions::AssertIOAllowed(); |
79 DCHECK(fd->is_valid()); | 85 DCHECK(fd->is_valid()); |
80 | 86 |
81 if (tcp_socket()) { | 87 if (tcp_socket()) { |
82 error_callback.Run(kSocketAlreadyConnected); | 88 error_callback.Run(kSocketAlreadyConnected); |
(...skipping 10 matching lines...) Expand all Loading... |
93 error_callback.Run("Error connecting to socket: " + | 99 error_callback.Run("Error connecting to socket: " + |
94 std::string(net::ErrorToString(net_result))); | 100 std::string(net::ErrorToString(net_result))); |
95 return; | 101 return; |
96 } | 102 } |
97 | 103 |
98 fd->TakeValue(); | 104 fd->TakeValue(); |
99 success_callback.Run(); | 105 success_callback.Run(); |
100 } | 106 } |
101 | 107 |
102 } // namespace chromeos | 108 } // namespace chromeos |
OLD | NEW |