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

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

Issue 278663002: Implement chrome.bluetoothSocket.listenUsing*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BluetoothAdapterMac include typo Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698