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

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 #4 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
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..e471b590209645fd940f3df053ae3fa4f2e53b70 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_.size()
mef 2016/12/13 20:46:43 nit: !quic_user_agent_id_.size() => quic_user_agen
+ ? getDefaultQuicUserAgentId()
+ : quic_user_agent_id_, // QUIC User Agent ID.
mef 2016/12/13 20:46:43 Maybe move it into explicit if (...) construction
lilyhoughton 2016/12/14 18:32:15 It's used for basically the same thing in the andr
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() {
+ return base::SysNSStringToUTF8([[NSBundle mainBundle]
+ objectForInfoDictionaryKey:@"CFBundleDisplayName"]) +
+ " Cronet/" + CRONET_VERSION;
+}
+
} // namespace cronet
« components/cronet/ios/cronet_environment.h ('K') | « components/cronet/ios/cronet_environment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698