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

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

Issue 432553003: Remove redundant mapping of net errors to strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to comments Created 6 years, 4 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
« no previous file with comments | « content/child/socket_stream_dispatcher.cc ('k') | net/base/net_errors.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 closesocket(socket_fd); 214 closesocket(socket_fd);
215 return; 215 return;
216 } 216 }
217 217
218 // Note: We don't have a meaningful |IPEndPoint|, but that is ok since the 218 // Note: We don't have a meaningful |IPEndPoint|, but that is ok since the
219 // TCPSocket implementation does not actually require one. 219 // TCPSocket implementation does not actually require one.
220 int net_result = 220 int net_result =
221 scoped_socket->AdoptConnectedSocket(socket_fd, net::IPEndPoint()); 221 scoped_socket->AdoptConnectedSocket(socket_fd, net::IPEndPoint());
222 if (net_result != net::OK) { 222 if (net_result != net::OK) {
223 error_callback.Run("Error connecting to socket: " + 223 error_callback.Run("Error connecting to socket: " +
224 std::string(net::ErrorToString(net_result))); 224 net::ErrorToString(net_result));
225 closesocket(socket_fd); 225 closesocket(socket_fd);
226 return; 226 return;
227 } 227 }
228 228
229 SetTCPSocket(scoped_socket.Pass()); 229 SetTCPSocket(scoped_socket.Pass());
230 success_callback.Run(); 230 success_callback.Run();
231 } 231 }
232 232
233 void BluetoothSocketWin::DoListen( 233 void BluetoothSocketWin::DoListen(
234 const BluetoothUUID& uuid, 234 const BluetoothUUID& uuid,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return; 387 return;
388 } 388 }
389 389
390 scoped_refptr<BluetoothSocketWin> peer_socket = 390 scoped_refptr<BluetoothSocketWin> peer_socket =
391 CreateBluetoothSocket(ui_task_runner(), socket_thread()); 391 CreateBluetoothSocket(ui_task_runner(), socket_thread());
392 peer_socket->SetTCPSocket(accept_socket.Pass()); 392 peer_socket->SetTCPSocket(accept_socket.Pass());
393 success_callback.Run(peer_device, peer_socket); 393 success_callback.Run(peer_device, peer_socket);
394 } 394 }
395 395
396 } // namespace device 396 } // namespace device
OLDNEW
« no previous file with comments | « content/child/socket_stream_dispatcher.cc ('k') | net/base/net_errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698