1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_PROXY_PROXY_RESOLVER_WINHTTP_H_
6 #define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_
8 #include "base/compiler_specific.h"
9 #include "googleurl/src/gurl.h"
10 #include "net/proxy/proxy_resolver.h"
12 typedef void* HINTERNET
; // From winhttp.h
16 // An implementation of ProxyResolver that uses WinHTTP and the system
18 class NET_EXPORT_PRIVATE ProxyResolverWinHttp
: public ProxyResolver
{
20 ProxyResolverWinHttp();
21 virtual ~ProxyResolverWinHttp();
23 // ProxyResolver implementation:
24 virtual int GetProxyForURL(const GURL
& url
,
26 const net::CompletionCallback
& /*callback*/,
27 RequestHandle
* /*request*/,
28 const BoundNetLog
& /*net_log*/) OVERRIDE
;
29 virtual void CancelRequest(RequestHandle request
) OVERRIDE
;
31 virtual LoadState
GetLoadState(RequestHandle request
) const OVERRIDE
;
33 virtual LoadState
GetLoadStateThreadSafe(
34 RequestHandle request
) const OVERRIDE
;
36 virtual void CancelSetPacScript() OVERRIDE
;
38 virtual int SetPacScript(
39 const scoped_refptr
<ProxyResolverScriptData
>& script_data
,
40 const net::CompletionCallback
& /*callback*/) OVERRIDE
;
43 bool OpenWinHttpSession();
44 void CloseWinHttpSession();
46 // Proxy configuration is cached on the session handle.
47 HINTERNET session_handle_
;
51 DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp
);
56 #endif // NET_PROXY_PROXY_RESOLVER_WINHTTP_H_