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

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

Issue 2146643002: [Cronet] Integrate CrNet functionality into Cronet on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove prototype CronetEngine from this CL. Created 4 years, 4 months 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 <vector>
9 10
10 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
13 #include "base/synchronization/waitable_event.h" 14 #include "base/synchronization/waitable_event.h"
14 #include "base/threading/thread.h" 15 #include "base/threading/thread.h"
15 #include "components/cronet/url_request_context_config.h" 16 #include "components/cronet/url_request_context_config.h"
16 #include "net/cert/cert_verifier.h" 17 #include "net/cert/cert_verifier.h"
17 #include "net/url_request/url_request.h" 18 #include "net/url_request/url_request.h"
18 #include "net/url_request/url_request_context.h" 19 #include "net/url_request/url_request_context.h"
20 #include "net/url_request/url_request_context_getter.h"
19 21
20 class JsonPrefStore; 22 class JsonPrefStore;
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 {
27 class HttpCache; 29 class HttpCache;
28 class NetworkChangeNotifier; 30 class NetworkChangeNotifier;
(...skipping 14 matching lines...) Expand all
43 // |user_agent_product_name| will be used to generate the user-agent. 45 // |user_agent_product_name| will be used to generate the user-agent.
44 CronetEnvironment(const std::string& user_agent_product_name); 46 CronetEnvironment(const std::string& user_agent_product_name);
45 ~CronetEnvironment(); 47 ~CronetEnvironment();
46 48
47 // Starts this instance of Cronet environment. 49 // Starts this instance of Cronet environment.
48 void Start(); 50 void Start();
49 51
50 // The full user-agent. 52 // The full user-agent.
51 std::string user_agent(); 53 std::string user_agent();
52 54
55 // Get global UMA histogram deltas.
56 std::vector<uint8_t> GetHistogramDeltas();
57
53 // Creates a new net log (overwrites existing file with this name). If 58 // Creates a new net log (overwrites existing file with this name). If
54 // actively logging, this call is ignored. 59 // actively logging, this call is ignored.
55 void StartNetLog(base::FilePath::StringType file_name, bool log_bytes); 60 void StartNetLog(base::FilePath::StringType file_name, bool log_bytes);
56 // Stops logging and flushes file. If not currently logging this call is 61 // Stops logging and flushes file. If not currently logging this call is
57 // ignored. 62 // ignored.
58 void StopNetLog(); 63 void StopNetLog();
59 64
60 void AddQuicHint(const std::string& host, int port, int alternate_port); 65 void AddQuicHint(const std::string& host, int port, int alternate_port);
61 66
62 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and 67 // Setters and getters for |http2_enabled_|, |quic_enabled_|, and
(...skipping 12 matching lines...) Expand all
75 void set_host_resolver_rules(const std::string& host_resolver_rules) { 80 void set_host_resolver_rules(const std::string& host_resolver_rules) {
76 host_resolver_rules_ = host_resolver_rules; 81 host_resolver_rules_ = host_resolver_rules;
77 } 82 }
78 83
79 void set_ssl_key_log_file_name(const std::string& ssl_key_log_file_name) { 84 void set_ssl_key_log_file_name(const std::string& ssl_key_log_file_name) {
80 ssl_key_log_file_name_ = ssl_key_log_file_name; 85 ssl_key_log_file_name_ = ssl_key_log_file_name;
81 } 86 }
82 87
83 net::URLRequestContext* GetURLRequestContext() const; 88 net::URLRequestContext* GetURLRequestContext() const;
84 89
90 net::URLRequestContextGetter* GetURLRequestContextGetter() const;
91
85 bool IsOnNetworkThread(); 92 bool IsOnNetworkThread();
86 93
87 // Runs a closure on the network thread. 94 // Runs a closure on the network thread.
88 void PostToNetworkThread(const tracked_objects::Location& from_here, 95 void PostToNetworkThread(const tracked_objects::Location& from_here,
89 const base::Closure& task); 96 const base::Closure& task);
90 97
91 private: 98 private:
92 // Performs initialization tasks that must happen on the network thread. 99 // Performs initialization tasks that must happen on the network thread.
93 void InitializeOnNetworkThread(); 100 void InitializeOnNetworkThread();
94 101
(...skipping 21 matching lines...) Expand all
116 std::unique_ptr<base::Thread> network_io_thread_; 123 std::unique_ptr<base::Thread> network_io_thread_;
117 std::unique_ptr<base::Thread> network_cache_thread_; 124 std::unique_ptr<base::Thread> network_cache_thread_;
118 std::unique_ptr<base::Thread> file_thread_; 125 std::unique_ptr<base::Thread> file_thread_;
119 std::unique_ptr<base::Thread> file_user_blocking_thread_; 126 std::unique_ptr<base::Thread> file_user_blocking_thread_;
120 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_; 127 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_;
121 scoped_refptr<JsonPrefStore> net_pref_store_; 128 scoped_refptr<JsonPrefStore> net_pref_store_;
122 std::unique_ptr<net::CertVerifier> cert_verifier_; 129 std::unique_ptr<net::CertVerifier> cert_verifier_;
123 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; 130 std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
124 std::unique_ptr<net::HttpServerProperties> http_server_properties_; 131 std::unique_ptr<net::HttpServerProperties> http_server_properties_;
125 std::unique_ptr<net::URLRequestContext> main_context_; 132 std::unique_ptr<net::URLRequestContext> main_context_;
133 scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
126 std::string user_agent_product_name_; 134 std::string user_agent_product_name_;
127 std::unique_ptr<net::NetLog> net_log_; 135 std::unique_ptr<net::NetLog> net_log_;
128 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; 136 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_;
129 137
130 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); 138 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment);
131 }; 139 };
132 140
133 } // namespace cronet 141 } // namespace cronet
134 142
135 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 143 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698