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"
23 class MappedHostResolver
;
24 class NetworkDelegate
;
26 class ProxyConfigService
;
28 class URLRequestContextStorage
;
33 class ShellURLRequestContextGetter
: public net::URLRequestContextGetter
{
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()
49 net::HostResolver
* host_resolver();
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();
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_