Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: components/cronet/ios/cronet_environment.h

Issue 2502683003: [Cronet] change InitializeOnNetworkThread to use URLRequestContextBuilder (Closed)
Patch Set: address mmenke's comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 5 #ifndef COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
6 #define COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 6 #define COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/synchronization/waitable_event.h" 15 #include "base/synchronization/waitable_event.h"
16 #include "base/threading/thread.h" 16 #include "base/threading/thread.h"
17 #include "components/cronet/url_request_context_config.h" 17 #include "components/cronet/url_request_context_config.h"
18 #include "net/cert/cert_verifier.h" 18 #include "net/cert/cert_verifier.h"
19 #include "net/url_request/url_request.h" 19 #include "net/url_request/url_request.h"
mmenke 2016/11/23 18:41:33 Not used
lilyhoughton 2016/11/28 16:42:21 Done.
20 #include "net/url_request/url_request_context.h" 20 #include "net/url_request/url_request_context.h"
21 #include "net/url_request/url_request_context_getter.h" 21 #include "net/url_request/url_request_context_getter.h"
22 22
23 class JsonPrefStore; 23 class JsonPrefStore;
24 24
25 namespace base { 25 namespace base {
26 class WaitableEvent; 26 class WaitableEvent;
27 } // namespace base 27 } // namespace base
28 28
29 namespace net { 29 namespace net {
30 class HttpCache; 30 class HttpCache;
mmenke 2016/11/23 18:41:33 Not used.
lilyhoughton 2016/11/28 16:42:21 Done.
31 class NetworkChangeNotifier; 31 class NetworkChangeNotifier;
32 class NetLog; 32 class NetLog;
33 class ProxyConfigService; 33 class ProxyConfigService;
mmenke 2016/11/23 18:41:33 Not used
lilyhoughton 2016/11/28 16:42:21 Done.
34 class WriteToFileNetLogObserver; 34 class WriteToFileNetLogObserver;
35 } // namespace net 35 } // namespace net
36 36
37 namespace cronet { 37 namespace cronet {
38 // CronetEnvironment contains all the network stack configuration 38 // CronetEnvironment contains all the network stack configuration
39 // and initialization. 39 // and initialization.
40 class CronetEnvironment { 40 class CronetEnvironment {
41 public: 41 public:
42 // Initialize Cronet environment globals. Must be called only once on the 42 // Initialize Cronet environment globals. Must be called only once on the
43 // main thread. 43 // main thread.
(...skipping 29 matching lines...) Expand all
73 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; } 73 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; }
74 void set_quic_enabled(bool enabled) { quic_enabled_ = enabled; } 74 void set_quic_enabled(bool enabled) { quic_enabled_ = enabled; }
75 75
76 bool http2_enabled() const { return http2_enabled_; } 76 bool http2_enabled() const { return http2_enabled_; }
77 bool quic_enabled() const { return quic_enabled_; } 77 bool quic_enabled() const { return quic_enabled_; }
78 78
79 void set_accept_language(const std::string& accept_language) { 79 void set_accept_language(const std::string& accept_language) {
80 accept_language_ = accept_language; 80 accept_language_ = accept_language;
81 } 81 }
82 82
83 void set_cert_verifier(std::unique_ptr<net::CertVerifier> cert_verifier) { 83 void set_mock_cert_verifier(
84 cert_verifier_ = std::move(cert_verifier); 84 std::unique_ptr<net::CertVerifier> mock_cert_verifier) {
85 mock_cert_verifier_ = std::move(mock_cert_verifier);
85 } 86 }
86 87
87 void set_host_resolver_rules(const std::string& host_resolver_rules) { 88 void set_host_resolver_rules(const std::string& host_resolver_rules) {
88 host_resolver_rules_ = host_resolver_rules; 89 host_resolver_rules_ = host_resolver_rules;
89 } 90 }
90 91
91 void set_ssl_key_log_file_name(const std::string& ssl_key_log_file_name) { 92 void set_ssl_key_log_file_name(const std::string& ssl_key_log_file_name) {
92 ssl_key_log_file_name_ = ssl_key_log_file_name; 93 ssl_key_log_file_name_ = ssl_key_log_file_name;
93 } 94 }
94 95
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 std::string host_resolver_rules_; 127 std::string host_resolver_rules_;
127 std::string ssl_key_log_file_name_; 128 std::string ssl_key_log_file_name_;
128 129
129 std::list<net::HostPortPair> quic_hints_; 130 std::list<net::HostPortPair> quic_hints_;
130 131
131 std::unique_ptr<base::Thread> network_io_thread_; 132 std::unique_ptr<base::Thread> network_io_thread_;
132 std::unique_ptr<base::Thread> network_cache_thread_; 133 std::unique_ptr<base::Thread> network_cache_thread_;
133 std::unique_ptr<base::Thread> file_thread_; 134 std::unique_ptr<base::Thread> file_thread_;
134 std::unique_ptr<base::Thread> file_user_blocking_thread_; 135 std::unique_ptr<base::Thread> file_user_blocking_thread_;
135 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_; 136 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_;
136 scoped_refptr<JsonPrefStore> net_pref_store_; 137 scoped_refptr<JsonPrefStore> net_pref_store_;
mmenke 2016/11/23 18:41:33 Not used (And wasn't used before this CL, either)
lilyhoughton 2016/11/28 16:42:21 Done.
137 std::unique_ptr<net::CertVerifier> cert_verifier_; 138 std::unique_ptr<net::CertVerifier> mock_cert_verifier_;
138 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; 139 std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
mmenke 2016/11/23 18:41:33 No longer used.
lilyhoughton 2016/11/28 16:42:21 Done.
139 std::unique_ptr<net::HttpServerProperties> http_server_properties_; 140 std::unique_ptr<net::HttpServerProperties> http_server_properties_;
mmenke 2016/11/23 18:41:33 No longer used.
lilyhoughton 2016/11/28 16:42:21 Done.
140 std::unique_ptr<net::URLRequestContext> main_context_; 141 std::unique_ptr<net::URLRequestContext> main_context_;
141 scoped_refptr<net::URLRequestContextGetter> main_context_getter_; 142 scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
142 std::string user_agent_; 143 std::string user_agent_;
143 bool user_agent_partial_; 144 bool user_agent_partial_;
144 std::unique_ptr<net::NetLog> net_log_; 145 std::unique_ptr<net::NetLog> net_log_;
145 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; 146 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_;
146 147
147 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); 148 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment);
148 }; 149 };
149 150
150 } // namespace cronet 151 } // namespace cronet
151 152
152 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 153 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698