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

Side by Side Diff: net/socket/tcp_client_socket_win.cc

Issue 9147026: API for connection type (Ethernet/WIFI/WWAN ...) in NetworkChangeNotifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync Created 8 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
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 "net/socket/tcp_client_socket_win.h" 5 #include "net/socket/tcp_client_socket_win.h"
6 6
7 #include <mstcpip.h> 7 #include <mstcpip.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return ERR_NETWORK_ACCESS_DENIED; 135 return ERR_NETWORK_ACCESS_DENIED;
136 case WSAETIMEDOUT: 136 case WSAETIMEDOUT:
137 return ERR_CONNECTION_TIMED_OUT; 137 return ERR_CONNECTION_TIMED_OUT;
138 default: { 138 default: {
139 int net_error = MapSystemError(os_error); 139 int net_error = MapSystemError(os_error);
140 if (net_error == ERR_FAILED) 140 if (net_error == ERR_FAILED)
141 return ERR_CONNECTION_FAILED; // More specific than ERR_FAILED. 141 return ERR_CONNECTION_FAILED; // More specific than ERR_FAILED.
142 142
143 // Give a more specific error when the user is offline. 143 // Give a more specific error when the user is offline.
144 if (net_error == ERR_ADDRESS_UNREACHABLE && 144 if (net_error == ERR_ADDRESS_UNREACHABLE &&
145 NetworkChangeNotifier::IsOffline()) { 145 NetworkChangeNotifier::GetConnectionType() ==
146 NetworkChangeNotifier::CONNECTION_NONE) {
wtc 2012/05/11 01:35:05 Nit: this line doesn't need to be indented.
146 return ERR_INTERNET_DISCONNECTED; 147 return ERR_INTERNET_DISCONNECTED;
147 } 148 }
148 149
149 return net_error; 150 return net_error;
150 } 151 }
151 } 152 }
152 } 153 }
153 154
154 } // namespace 155 } // namespace
155 156
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 use_history_.set_was_used_to_convey_data(); 909 use_history_.set_was_used_to_convey_data();
909 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, num_bytes, 910 net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, num_bytes,
910 core_->write_buffer_.buf); 911 core_->write_buffer_.buf);
911 } 912 }
912 } 913 }
913 core_->write_iobuffer_ = NULL; 914 core_->write_iobuffer_ = NULL;
914 DoWriteCallback(rv); 915 DoWriteCallback(rv);
915 } 916 }
916 917
917 } // namespace net 918 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698