OLD | NEW |
| (Empty) |
1 // Copyright 2014 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. | |
4 | |
5 #ifndef IOS_WEB_VIEW_INTERNAL_CRIWV_URL_REQUEST_CONTEXT_GETTER_H_ | |
6 #define IOS_WEB_VIEW_INTERNAL_CRIWV_URL_REQUEST_CONTEXT_GETTER_H_ | |
7 | |
8 #include <memory> | |
9 #include "base/compiler_specific.h" | |
10 #include "base/files/file_path.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/single_thread_task_runner.h" | |
13 #include "net/url_request/url_request_context_getter.h" | |
14 | |
15 namespace net { | |
16 class NetworkDelegate; | |
17 class NetLog; | |
18 class ProxyConfigService; | |
19 class TransportSecurityPersister; | |
20 class URLRequestContext; | |
21 class URLRequestContextStorage; | |
22 } | |
23 | |
24 namespace ios_web_view { | |
25 | |
26 // CWV-specific implementation of URLRequestContextGetter. | |
27 class CRIWVURLRequestContextGetter : public net::URLRequestContextGetter { | |
28 public: | |
29 CRIWVURLRequestContextGetter( | |
30 const base::FilePath& base_path, | |
31 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, | |
32 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner, | |
33 const scoped_refptr<base::SingleThreadTaskRunner>& cache_task_runner); | |
34 | |
35 // net::URLRequestContextGetter implementation. | |
36 net::URLRequestContext* GetURLRequestContext() override; | |
37 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | |
38 const override; | |
39 | |
40 protected: | |
41 ~CRIWVURLRequestContextGetter() override; | |
42 | |
43 private: | |
44 base::FilePath base_path_; | |
45 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | |
46 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | |
47 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner_; | |
48 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; | |
49 std::unique_ptr<net::NetworkDelegate> network_delegate_; | |
50 std::unique_ptr<net::URLRequestContextStorage> storage_; | |
51 std::unique_ptr<net::URLRequestContext> url_request_context_; | |
52 std::unique_ptr<net::NetLog> net_log_; | |
53 std::unique_ptr<net::TransportSecurityPersister> | |
54 transport_security_persister_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(CRIWVURLRequestContextGetter); | |
57 }; | |
58 | |
59 } // namespace ios_web_view | |
60 | |
61 #endif // IOS_WEB_VIEW_INTERNAL_CRIWV_URL_REQUEST_CONTEXT_GETTER_H_ | |
OLD | NEW |