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

Unified Diff: components/cronet/ios/cronet_environment.mm

Issue 2568883002: [cronet] Add member for QUIC user agent ID, with getter and setter. (Closed)
Patch Set: per #6 Created 4 years 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/cronet_environment.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/cronet_environment.mm
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index 62c8407aa863134ef03416e4a4c95733e2582e29..d122171656a92804c5c1fa05f26397e0b79d3468 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -270,8 +270,10 @@ void CronetEnvironment::InitializeOnNetworkThread() {
cache_path = cache_path.Append(FILE_PATH_LITERAL("cronet"));
std::unique_ptr<URLRequestContextConfig> config(new URLRequestContextConfig(
- quic_enabled_, // Enable QUIC.
- "", // QUIC User Agent ID.
+ quic_enabled_, // Enable QUIC.
+ quic_enabled_ && quic_user_agent_id_.empty()
+ ? getDefaultQuicUserAgentId()
+ : quic_user_agent_id_, // QUIC User Agent ID.
http2_enabled_, // Enable SPDY.
false, // Enable SDCH
URLRequestContextConfig::DISK, // Type of http cache.
@@ -358,4 +360,10 @@ void CronetEnvironment::SetHostResolverRulesOnNetworkThread(
event->Signal();
}
+std::string CronetEnvironment::getDefaultQuicUserAgentId() const {
+ return base::SysNSStringToUTF8([[NSBundle mainBundle]
+ objectForInfoDictionaryKey:@"CFBundleDisplayName"]) +
+ " Cronet/" + CRONET_VERSION;
+}
+
} // namespace cronet
« no previous file with comments | « components/cronet/ios/cronet_environment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698