Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/strings/sys_string_conversions.h" | |
| 15 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 16 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "components/cronet/ios/version.h" | |
| 17 #include "components/cronet/url_request_context_config.h" | 19 #include "components/cronet/url_request_context_config.h" |
| 18 #include "net/cert/cert_verifier.h" | 20 #include "net/cert/cert_verifier.h" |
| 19 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
| 20 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
| 21 | 23 |
| 22 namespace base { | 24 namespace base { |
| 23 class WaitableEvent; | 25 class WaitableEvent; |
| 24 } // namespace base | 26 } // namespace base |
| 25 | 27 |
| 26 namespace net { | 28 namespace net { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 66 |
| 65 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and | 67 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and |
| 66 // |forced_quic_origin_|. These only have any effect before Start() is | 68 // |forced_quic_origin_|. These only have any effect before Start() is |
| 67 // called. | 69 // called. |
| 68 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; } | 70 void set_http2_enabled(bool enabled) { http2_enabled_ = enabled; } |
| 69 void set_quic_enabled(bool enabled) { quic_enabled_ = enabled; } | 71 void set_quic_enabled(bool enabled) { quic_enabled_ = enabled; } |
| 70 | 72 |
| 71 bool http2_enabled() const { return http2_enabled_; } | 73 bool http2_enabled() const { return http2_enabled_; } |
| 72 bool quic_enabled() const { return quic_enabled_; } | 74 bool quic_enabled() const { return quic_enabled_; } |
| 73 | 75 |
| 76 void set_quic_user_agent_id(const std::string& quic_user_agent_id) { | |
| 77 quic_user_agent_id_ = quic_user_agent_id; | |
| 78 } | |
| 79 | |
| 74 void set_accept_language(const std::string& accept_language) { | 80 void set_accept_language(const std::string& accept_language) { |
| 75 accept_language_ = accept_language; | 81 accept_language_ = accept_language; |
| 76 } | 82 } |
| 77 | 83 |
| 78 void set_mock_cert_verifier( | 84 void set_mock_cert_verifier( |
| 79 std::unique_ptr<net::CertVerifier> mock_cert_verifier) { | 85 std::unique_ptr<net::CertVerifier> mock_cert_verifier) { |
| 80 mock_cert_verifier_ = std::move(mock_cert_verifier); | 86 mock_cert_verifier_ = std::move(mock_cert_verifier); |
| 81 } | 87 } |
| 82 | 88 |
| 83 void SetHostResolverRules(const std::string& host_resolver_rules); | 89 void SetHostResolverRules(const std::string& host_resolver_rules); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 111 | 117 |
| 112 // Returns the HttpNetworkSession object from the passed in | 118 // Returns the HttpNetworkSession object from the passed in |
| 113 // URLRequestContext or NULL if none exists. | 119 // URLRequestContext or NULL if none exists. |
| 114 net::HttpNetworkSession* GetHttpNetworkSession( | 120 net::HttpNetworkSession* GetHttpNetworkSession( |
| 115 net::URLRequestContext* context); | 121 net::URLRequestContext* context); |
| 116 | 122 |
| 117 // Sets host resolver rules on the network_io_thread_. | 123 // Sets host resolver rules on the network_io_thread_. |
| 118 void SetHostResolverRulesOnNetworkThread(const std::string& rules, | 124 void SetHostResolverRulesOnNetworkThread(const std::string& rules, |
| 119 base::WaitableEvent* event); | 125 base::WaitableEvent* event); |
| 120 | 126 |
| 127 std::string getDefaultQuicUserAgentId(); | |
|
mef
2016/12/13 20:46:43
nit: const;
| |
| 128 | |
| 121 bool http2_enabled_; | 129 bool http2_enabled_; |
| 122 bool quic_enabled_; | 130 bool quic_enabled_; |
| 131 std::string quic_user_agent_id_; | |
| 123 std::string accept_language_; | 132 std::string accept_language_; |
| 124 std::string ssl_key_log_file_name_; | 133 std::string ssl_key_log_file_name_; |
| 125 | 134 |
| 126 std::list<net::HostPortPair> quic_hints_; | 135 std::list<net::HostPortPair> quic_hints_; |
| 127 | 136 |
| 128 std::unique_ptr<base::Thread> network_io_thread_; | 137 std::unique_ptr<base::Thread> network_io_thread_; |
| 129 std::unique_ptr<base::Thread> network_cache_thread_; | 138 std::unique_ptr<base::Thread> network_cache_thread_; |
| 130 std::unique_ptr<base::Thread> file_thread_; | 139 std::unique_ptr<base::Thread> file_thread_; |
| 131 std::unique_ptr<base::Thread> file_user_blocking_thread_; | 140 std::unique_ptr<base::Thread> file_user_blocking_thread_; |
| 132 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_; | 141 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_; |
| 133 std::unique_ptr<net::CertVerifier> mock_cert_verifier_; | 142 std::unique_ptr<net::CertVerifier> mock_cert_verifier_; |
| 134 std::unique_ptr<net::CookieStore> cookie_store_; | 143 std::unique_ptr<net::CookieStore> cookie_store_; |
| 135 std::unique_ptr<net::URLRequestContext> main_context_; | 144 std::unique_ptr<net::URLRequestContext> main_context_; |
| 136 scoped_refptr<net::URLRequestContextGetter> main_context_getter_; | 145 scoped_refptr<net::URLRequestContextGetter> main_context_getter_; |
| 137 std::string user_agent_; | 146 std::string user_agent_; |
| 138 bool user_agent_partial_; | 147 bool user_agent_partial_; |
| 139 std::unique_ptr<net::NetLog> net_log_; | 148 std::unique_ptr<net::NetLog> net_log_; |
| 140 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; | 149 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; |
| 141 | 150 |
| 142 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); | 151 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); |
| 143 }; | 152 }; |
| 144 | 153 |
| 145 } // namespace cronet | 154 } // namespace cronet |
| 146 | 155 |
| 147 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ | 156 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ |
| OLD | NEW |