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

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

Issue 2137623002: Fixes in CrNet and Cronet frameworks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | ios/crnet/crnet_environment.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "components/cronet/ios/cronet_environment.h" 5 #include "components/cronet/ios/cronet_environment.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/feature_list.h"
12 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
13 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
14 #include "base/files/scoped_file.h" 15 #include "base/files/scoped_file.h"
15 #include "base/json/json_writer.h" 16 #include "base/json/json_writer.h"
16 #include "base/mac/bind_objc_block.h" 17 #include "base/mac/bind_objc_block.h"
17 #include "base/mac/foundation_util.h" 18 #include "base/mac/foundation_util.h"
18 #include "base/macros.h" 19 #include "base/macros.h"
19 #include "base/metrics/statistics_recorder.h" 20 #include "base/metrics/statistics_recorder.h"
20 #include "base/path_service.h" 21 #include "base/path_service.h"
21 #include "base/synchronization/waitable_event.h" 22 #include "base/synchronization/waitable_event.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 228
228 CronetEnvironment::~CronetEnvironment() { 229 CronetEnvironment::~CronetEnvironment() {
229 // net::HTTPProtocolHandlerDelegate::SetInstance(nullptr); 230 // net::HTTPProtocolHandlerDelegate::SetInstance(nullptr);
230 #if defined(USE_NSS_CERTS) 231 #if defined(USE_NSS_CERTS)
231 net::SetURLRequestContextForNSSHttpIO(nullptr); 232 net::SetURLRequestContextForNSSHttpIO(nullptr);
232 #endif 233 #endif
233 } 234 }
234 235
235 void CronetEnvironment::InitializeOnNetworkThread() { 236 void CronetEnvironment::InitializeOnNetworkThread() {
236 DCHECK(network_io_thread_->task_runner()->BelongsToCurrentThread()); 237 DCHECK(network_io_thread_->task_runner()->BelongsToCurrentThread());
238 base::FeatureList::InitializeInstance(std::string(), std::string());
237 // TODO(mef): Use net:UrlRequestContextBuilder instead of manual build. 239 // TODO(mef): Use net:UrlRequestContextBuilder instead of manual build.
238 main_context_.reset(new net::URLRequestContext); 240 main_context_.reset(new net::URLRequestContext);
239 main_context_->set_net_log(net_log_.get()); 241 main_context_->set_net_log(net_log_.get());
240 std::string user_agent(user_agent_product_name_ + 242 std::string user_agent(user_agent_product_name_ +
241 " (iOS); Cronet/" CRONET_VERSION); 243 " (iOS); Cronet/" CRONET_VERSION);
242 main_context_->set_http_user_agent_settings( 244 main_context_->set_http_user_agent_settings(
243 new net::StaticHttpUserAgentSettings("en", user_agent)); 245 new net::StaticHttpUserAgentSettings("en", user_agent));
244 246
245 main_context_->set_ssl_config_service(new net::SSLConfigServiceDefaults); 247 main_context_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
246 main_context_->set_transport_security_state( 248 main_context_->set_transport_security_state(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 const net::HttpUserAgentSettings* user_agent_settings = 344 const net::HttpUserAgentSettings* user_agent_settings =
343 main_context_->http_user_agent_settings(); 345 main_context_->http_user_agent_settings();
344 if (!user_agent_settings) { 346 if (!user_agent_settings) {
345 return nullptr; 347 return nullptr;
346 } 348 }
347 349
348 return user_agent_settings->GetUserAgent(); 350 return user_agent_settings->GetUserAgent();
349 } 351 }
350 352
351 } // namespace cronet 353 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | ios/crnet/crnet_environment.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698