Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / content / shell / browser / shell_url_request_context_getter.h
blob18e4b8d28c29da9641254686ca6a0976c6d8f9e5
1 // Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "content/public/browser/content_browser_client.h"
13 #include "net/proxy/proxy_config_service.h"
14 #include "net/url_request/url_request_context_getter.h"
15 #include "net/url_request/url_request_job_factory.h"
17 namespace base {
18 class MessageLoop;
21 namespace net {
22 class HostResolver;
23 class MappedHostResolver;
24 class NetworkDelegate;
25 class NetLog;
26 class ProxyConfigService;
27 class ProxyService;
28 class URLRequestContextStorage;
31 namespace content {
33 class ShellURLRequestContextGetter : public net::URLRequestContextGetter {
34 public:
35 ShellURLRequestContextGetter(
36 bool ignore_certificate_errors,
37 const base::FilePath& base_path,
38 base::MessageLoop* io_loop,
39 base::MessageLoop* file_loop,
40 ProtocolHandlerMap* protocol_handlers,
41 URLRequestInterceptorScopedVector request_interceptors,
42 net::NetLog* net_log);
44 // net::URLRequestContextGetter implementation.
45 net::URLRequestContext* GetURLRequestContext() override;
46 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
47 const override;
49 net::HostResolver* host_resolver();
51 protected:
52 ~ShellURLRequestContextGetter() override;
54 // Used by subclasses to create their own implementation of NetworkDelegate
55 // and net::ProxyService.
56 virtual scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate();
57 virtual scoped_ptr<net::ProxyConfigService> GetProxyConfigService();
58 virtual scoped_ptr<net::ProxyService> GetProxyService();
60 private:
61 bool ignore_certificate_errors_;
62 base::FilePath base_path_;
63 base::MessageLoop* io_loop_;
64 base::MessageLoop* file_loop_;
65 net::NetLog* net_log_;
67 scoped_ptr<net::ProxyConfigService> proxy_config_service_;
68 scoped_ptr<net::NetworkDelegate> network_delegate_;
69 scoped_ptr<net::URLRequestContextStorage> storage_;
70 scoped_ptr<net::URLRequestContext> url_request_context_;
71 ProtocolHandlerMap protocol_handlers_;
72 URLRequestInterceptorScopedVector request_interceptors_;
74 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter);
77 } // namespace content
79 #endif // CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_