Chromium Code Reviews| 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 |