OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "content/public/browser/content_browser_client.h" | 14 #include "content/public/browser/content_browser_client.h" |
14 #include "headless/public/headless_browser.h" | 15 #include "headless/public/headless_browser.h" |
15 #include "net/proxy/proxy_config_service.h" | 16 #include "net/proxy/proxy_config_service.h" |
16 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
17 #include "net/url_request/url_request_job_factory.h" | 18 #include "net/url_request/url_request_job_factory.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class MessageLoop; | 21 class MessageLoop; |
21 } | 22 } |
22 | 23 |
(...skipping 24 matching lines...) Expand all Loading... |
47 // net::URLRequestContextGetter implementation: | 48 // net::URLRequestContextGetter implementation: |
48 net::URLRequestContext* GetURLRequestContext() override; | 49 net::URLRequestContext* GetURLRequestContext() override; |
49 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | 50 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
50 const override; | 51 const override; |
51 | 52 |
52 net::HostResolver* host_resolver() const; | 53 net::HostResolver* host_resolver() const; |
53 | 54 |
54 protected: | 55 protected: |
55 ~HeadlessURLRequestContextGetter() override; | 56 ~HeadlessURLRequestContextGetter() override; |
56 | 57 |
57 scoped_ptr<net::NetworkDelegate> CreateNetworkDelegate(); | 58 std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate(); |
58 scoped_ptr<net::ProxyConfigService> GetProxyConfigService(); | 59 std::unique_ptr<net::ProxyConfigService> GetProxyConfigService(); |
59 scoped_ptr<net::ProxyService> GetProxyService(); | 60 std::unique_ptr<net::ProxyService> GetProxyService(); |
60 | 61 |
61 private: | 62 private: |
62 bool ignore_certificate_errors_; | 63 bool ignore_certificate_errors_; |
63 base::FilePath base_path_; | 64 base::FilePath base_path_; |
64 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 65 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
65 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | 66 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
66 net::NetLog* net_log_; | 67 net::NetLog* net_log_; |
67 HeadlessBrowser::Options options_; | 68 HeadlessBrowser::Options options_; |
68 | 69 |
69 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 70 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; |
70 scoped_ptr<net::NetworkDelegate> network_delegate_; | 71 std::unique_ptr<net::NetworkDelegate> network_delegate_; |
71 scoped_ptr<net::URLRequestContextStorage> storage_; | 72 std::unique_ptr<net::URLRequestContextStorage> storage_; |
72 scoped_ptr<net::URLRequestContext> url_request_context_; | 73 std::unique_ptr<net::URLRequestContext> url_request_context_; |
73 content::ProtocolHandlerMap protocol_handlers_; | 74 content::ProtocolHandlerMap protocol_handlers_; |
74 content::URLRequestInterceptorScopedVector request_interceptors_; | 75 content::URLRequestInterceptorScopedVector request_interceptors_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(HeadlessURLRequestContextGetter); | 77 DISALLOW_COPY_AND_ASSIGN(HeadlessURLRequestContextGetter); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace headless | 80 } // namespace headless |
80 | 81 |
81 #endif // HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ | 82 #endif // HEADLESS_LIB_BROWSER_HEADLESS_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |