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

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

Issue 2273403003: Moving gRPC support interfaces out of cronet and into a new component. (Closed)
Patch Set: Revert rules.gni for testing Created 4 years, 2 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 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "components/cronet/url_request_context_config.h" 15 #include "components/cronet/url_request_context_config.h"
16 #include "net/cert/cert_verifier.h" 16 #include "net/cert/cert_verifier.h"
17 #include "net/url_request/url_request.h" 17 #include "net/url_request/url_request.h"
18 #include "net/url_request/url_request_context.h" 18 #include "net/url_request/url_request_context.h"
19 #include "net/url_request/url_request_context_getter.h"
19 20
20 class JsonPrefStore; 21 class JsonPrefStore;
21 22
22 namespace base { 23 namespace base {
23 class WaitableEvent; 24 class WaitableEvent;
24 } // namespace base 25 } // namespace base
25 26
26 namespace net { 27 namespace net {
27 class HttpCache; 28 class HttpCache;
28 class NetworkChangeNotifier; 29 class NetworkChangeNotifier;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 74 }
74 75
75 void set_host_resolver_rules(const std::string& host_resolver_rules) { 76 void set_host_resolver_rules(const std::string& host_resolver_rules) {
76 host_resolver_rules_ = host_resolver_rules; 77 host_resolver_rules_ = host_resolver_rules;
77 } 78 }
78 79
79 void set_ssl_key_log_file_name(const std::string& ssl_key_log_file_name) { 80 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; 81 ssl_key_log_file_name_ = ssl_key_log_file_name;
81 } 82 }
82 83
83 net::URLRequestContext* GetURLRequestContext() const; 84 // Return the URLRequestContextGetter associated with this object.
85 net::URLRequestContextGetter* GetURLRequestContextGetter();
84 86
85 bool IsOnNetworkThread(); 87 private:
88 // Performs initialization tasks that must happen on the network thread.
89 void InitializeOnNetworkThread();
86 90
87 // Runs a closure on the network thread. 91 // Runs a closure on the network thread.
88 void PostToNetworkThread(const tracked_objects::Location& from_here, 92 void PostToNetworkThread(const tracked_objects::Location& from_here,
89 const base::Closure& task); 93 const base::Closure& task);
90 94
91 private:
92 // Performs initialization tasks that must happen on the network thread.
93 void InitializeOnNetworkThread();
94
95 // Runs a closure on the file user blocking thread. 95 // Runs a closure on the file user blocking thread.
96 void PostToFileUserBlockingThread(const tracked_objects::Location& from_here, 96 void PostToFileUserBlockingThread(const tracked_objects::Location& from_here,
97 const base::Closure& task); 97 const base::Closure& task);
98 98
99 // Helper methods that start/stop net logging on the network thread. 99 // Helper methods that start/stop net logging on the network thread.
100 void StartNetLogOnNetworkThread(const base::FilePath::StringType& file_name, 100 void StartNetLogOnNetworkThread(const base::FilePath::StringType& file_name,
101 bool log_bytes); 101 bool log_bytes);
102 void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event); 102 void StopNetLogOnNetworkThread(base::WaitableEvent* log_stopped_event);
103 103
104 // Returns the HttpNetworkSession object from the passed in 104 // Returns the HttpNetworkSession object from the passed in
(...skipping 11 matching lines...) Expand all
116 std::unique_ptr<base::Thread> network_io_thread_; 116 std::unique_ptr<base::Thread> network_io_thread_;
117 std::unique_ptr<base::Thread> network_cache_thread_; 117 std::unique_ptr<base::Thread> network_cache_thread_;
118 std::unique_ptr<base::Thread> file_thread_; 118 std::unique_ptr<base::Thread> file_thread_;
119 std::unique_ptr<base::Thread> file_user_blocking_thread_; 119 std::unique_ptr<base::Thread> file_user_blocking_thread_;
120 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_; 120 scoped_refptr<base::SequencedTaskRunner> pref_store_worker_pool_;
121 scoped_refptr<JsonPrefStore> net_pref_store_; 121 scoped_refptr<JsonPrefStore> net_pref_store_;
122 std::unique_ptr<net::CertVerifier> cert_verifier_; 122 std::unique_ptr<net::CertVerifier> cert_verifier_;
123 std::unique_ptr<net::ProxyConfigService> proxy_config_service_; 123 std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
124 std::unique_ptr<net::HttpServerProperties> http_server_properties_; 124 std::unique_ptr<net::HttpServerProperties> http_server_properties_;
125 std::unique_ptr<net::URLRequestContext> main_context_; 125 std::unique_ptr<net::URLRequestContext> main_context_;
126 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
126 std::string user_agent_product_name_; 127 std::string user_agent_product_name_;
127 std::unique_ptr<net::NetLog> net_log_; 128 std::unique_ptr<net::NetLog> net_log_;
128 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_; 129 std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_;
129 130
130 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment); 131 DISALLOW_COPY_AND_ASSIGN(CronetEnvironment);
131 }; 132 };
132 133
133 } // namespace cronet 134 } // namespace cronet
134 135
135 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_ 136 #endif // COMPONENTS_CRONET_IOS_CRONET_ENVIRONMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698