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

Unified Diff: device/bluetooth/bluetooth_socket_win.cc

Issue 246393010: Replaced FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM) with logging::SystemErrorCodeToString. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/platform_util_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_socket_win.cc
diff --git a/device/bluetooth/bluetooth_socket_win.cc b/device/bluetooth/bluetooth_socket_win.cc
index 044fa9899ca057cb78adfb33ddaf55da489be968..addcd7763be83d51fa4c2b4cd0ea2eb88984c61e 100644
--- a/device/bluetooth/bluetooth_socket_win.cc
+++ b/device/bluetooth/bluetooth_socket_win.cc
@@ -27,18 +27,6 @@ const char kSocketNotConnected[] = "Socket is not connected.";
using device::BluetoothSocketWin;
-std::string FormatErrorMessage(DWORD error_code) {
- TCHAR error_msg[1024];
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
- 0,
- error_code,
- 0,
- error_msg,
- 1024,
- NULL);
- return base::SysWideToUTF8(error_msg);
-}
-
static void DeactivateSocket(
const scoped_refptr<device::BluetoothSocketThreadWin>& socket_thread) {
socket_thread->OnSocketDeactivate();
@@ -208,9 +196,9 @@ void BluetoothSocketWin::DoConnect(
if (!(status == 0 || error_code == WSAEINPROGRESS)) {
LOG(ERROR) << "Failed to connect bluetooth socket "
<< "(" << device_address_ << "): "
- << "(" << error_code << ")" << FormatErrorMessage(error_code);
+ << logging::SystemErrorCodeToString(error_code);
error_callback.Run("Error connecting to socket: " +
- FormatErrorMessage(error_code));
+ logging::SystemErrorCodeToString(error_code));
closesocket(socket_fd);
return;
}
« no previous file with comments | « chrome/browser/platform_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698