| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/proxy/proxy_resolver_winhttp.h" | 5 #include "net/proxy/proxy_resolver_winhttp.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <winhttp.h> | 8 #include <winhttp.h> |
| 9 | 9 |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| 11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 | 12 |
| 13 #pragma comment(lib, "winhttp.lib") | 13 #pragma comment(lib, "winhttp.lib") |
| 14 | 14 |
| 15 using base::TimeDelta; |
| 16 using base::TimeTicks; |
| 17 |
| 15 namespace net { | 18 namespace net { |
| 16 | 19 |
| 17 // A small wrapper for histogramming purposes ;-) | 20 // A small wrapper for histogramming purposes ;-) |
| 18 static BOOL CallWinHttpGetProxyForUrl(HINTERNET session, LPCWSTR url, | 21 static BOOL CallWinHttpGetProxyForUrl(HINTERNET session, LPCWSTR url, |
| 19 WINHTTP_AUTOPROXY_OPTIONS* options, | 22 WINHTTP_AUTOPROXY_OPTIONS* options, |
| 20 WINHTTP_PROXY_INFO* results) { | 23 WINHTTP_PROXY_INFO* results) { |
| 21 TimeTicks time_start = TimeTicks::Now(); | 24 TimeTicks time_start = TimeTicks::Now(); |
| 22 BOOL rv = WinHttpGetProxyForUrl(session, url, options, results); | 25 BOOL rv = WinHttpGetProxyForUrl(session, url, options, results); |
| 23 TimeDelta time_delta = TimeTicks::Now() - time_start; | 26 TimeDelta time_delta = TimeTicks::Now() - time_start; |
| 24 // Record separately success and failure times since they will have very | 27 // Record separately success and failure times since they will have very |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 168 |
| 166 void ProxyResolverWinHttp::CloseWinHttpSession() { | 169 void ProxyResolverWinHttp::CloseWinHttpSession() { |
| 167 if (session_handle_) { | 170 if (session_handle_) { |
| 168 WinHttpCloseHandle(session_handle_); | 171 WinHttpCloseHandle(session_handle_); |
| 169 session_handle_ = NULL; | 172 session_handle_ = NULL; |
| 170 } | 173 } |
| 171 } | 174 } |
| 172 | 175 |
| 173 } // namespace net | 176 } // namespace net |
| 174 | 177 |
| OLD | NEW |