net cleanup: Remove unnecessary namespace prefixes.
[chromium-blink-merge.git] / net / proxy / proxy_resolver_winhttp.h
blob3c2004a9571893cf2c47d2f041f352c65b37d0f3
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 "net/proxy/proxy_resolver.h"
10 #include "url/gurl.h"
12 typedef void* HINTERNET; // From winhttp.h
14 namespace net {
16 // An implementation of ProxyResolver that uses WinHTTP and the system
17 // proxy settings.
18 class NET_EXPORT_PRIVATE ProxyResolverWinHttp : public ProxyResolver {
19 public:
20 ProxyResolverWinHttp();
21 ~ProxyResolverWinHttp() override;
23 // ProxyResolver implementation:
24 int GetProxyForURL(const GURL& url,
25 ProxyInfo* results,
26 const CompletionCallback& /*callback*/,
27 RequestHandle* /*request*/,
28 const BoundNetLog& /*net_log*/) override;
29 void CancelRequest(RequestHandle request) override;
31 LoadState GetLoadState(RequestHandle request) const override;
33 void CancelSetPacScript() override;
35 int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data,
36 const CompletionCallback& /*callback*/) override;
38 private:
39 bool OpenWinHttpSession();
40 void CloseWinHttpSession();
42 // Proxy configuration is cached on the session handle.
43 HINTERNET session_handle_;
45 GURL pac_url_;
47 DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp);
50 } // namespace net
52 #endif // NET_PROXY_PROXY_RESOLVER_WINHTTP_H_