1 // Copyright (c) 2012 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_SHELL_URL_REQUEST_CONTEXT_GETTER_H_
6 #define CONTENT_SHELL_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/url_request/url_request_context_getter.h"
14 #include "net/url_request/url_request_job_factory.h"
22 class MappedHostResolver
;
23 class NetworkDelegate
;
24 class ProxyConfigService
;
25 class URLRequestContextStorage
;
30 class ShellURLRequestContextGetter
: public net::URLRequestContextGetter
{
32 ShellURLRequestContextGetter(
33 bool ignore_certificate_errors
,
34 const base::FilePath
& base_path
,
35 base::MessageLoop
* io_loop
,
36 base::MessageLoop
* file_loop
,
37 ProtocolHandlerMap
* protocol_handlers
);
39 // net::URLRequestContextGetter implementation.
40 virtual net::URLRequestContext
* GetURLRequestContext() OVERRIDE
;
41 virtual scoped_refptr
<base::SingleThreadTaskRunner
>
42 GetNetworkTaskRunner() const OVERRIDE
;
44 net::HostResolver
* host_resolver();
47 virtual ~ShellURLRequestContextGetter();
50 bool ignore_certificate_errors_
;
51 base::FilePath base_path_
;
52 base::MessageLoop
* io_loop_
;
53 base::MessageLoop
* file_loop_
;
55 scoped_ptr
<net::ProxyConfigService
> proxy_config_service_
;
56 scoped_ptr
<net::NetworkDelegate
> network_delegate_
;
57 scoped_ptr
<net::URLRequestContextStorage
> storage_
;
58 scoped_ptr
<net::URLRequestContext
> url_request_context_
;
59 ProtocolHandlerMap protocol_handlers_
;
61 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter
);
64 } // namespace content
66 #endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_