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

Unified 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 cronet_test_bundle_data target and use data bundled with net_test_support. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/ios/Resources/README ('k') | components/cronet/ios/cronet_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/cronet_environment.h
diff --git a/components/cronet/ios/cronet_environment.h b/components/cronet/ios/cronet_environment.h
index 30d8564f4ba7bb769b660abb8025943bf13be564..6afde9cb6236346fda0a17db616f6ee6375e1e88 100644
--- a/components/cronet/ios/cronet_environment.h
+++ b/components/cronet/ios/cronet_environment.h
@@ -7,6 +7,7 @@
#include <list>
#include <string>
+#include <vector>
#include "base/files/file_path.h"
#include "base/macros.h"
@@ -17,6 +18,7 @@
#include "net/cert/cert_verifier.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_context_getter.h"
class JsonPrefStore;
@@ -41,8 +43,10 @@ class CronetEnvironment {
// main thread.
static void Initialize();
- // |user_agent_product_name| will be used to generate the user-agent.
- CronetEnvironment(const std::string& user_agent_product_name);
+ // |user_agent| will be used to generate the user-agent if
+ // |user_agent_partial|
+ // is true, or will be used as complete user-agent otherwise.
+ CronetEnvironment(const std::string& user_agent, bool user_agent_partial);
~CronetEnvironment();
// Starts this instance of Cronet environment.
@@ -51,6 +55,9 @@ class CronetEnvironment {
// The full user-agent.
std::string user_agent();
+ // Get global UMA histogram deltas.
+ std::vector<uint8_t> GetHistogramDeltas();
+
// Creates a new net log (overwrites existing file with this name). If
// actively logging, this call is ignored.
void StartNetLog(base::FilePath::StringType file_name, bool log_bytes);
@@ -69,6 +76,10 @@ class CronetEnvironment {
bool http2_enabled() const { return http2_enabled_; }
bool quic_enabled() const { return quic_enabled_; }
+ void set_accept_language(const std::string& accept_language) {
+ accept_language_ = accept_language;
+ }
+
void set_cert_verifier(std::unique_ptr<net::CertVerifier> cert_verifier) {
cert_verifier_ = std::move(cert_verifier);
}
@@ -83,6 +94,8 @@ class CronetEnvironment {
net::URLRequestContext* GetURLRequestContext() const;
+ net::URLRequestContextGetter* GetURLRequestContextGetter() const;
+
bool IsOnNetworkThread();
// Runs a closure on the network thread.
@@ -109,6 +122,7 @@ class CronetEnvironment {
bool http2_enabled_;
bool quic_enabled_;
+ std::string accept_language_;
std::string host_resolver_rules_;
std::string ssl_key_log_file_name_;
@@ -124,7 +138,9 @@ class CronetEnvironment {
std::unique_ptr<net::ProxyConfigService> proxy_config_service_;
std::unique_ptr<net::HttpServerProperties> http_server_properties_;
std::unique_ptr<net::URLRequestContext> main_context_;
- std::string user_agent_product_name_;
+ scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
+ std::string user_agent_;
+ bool user_agent_partial_;
std::unique_ptr<net::NetLog> net_log_;
std::unique_ptr<net::WriteToFileNetLogObserver> net_log_observer_;
« no previous file with comments | « components/cronet/ios/Resources/README ('k') | components/cronet/ios/cronet_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698