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

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

Issue 2790063004: [Cronet] Initialize StatisticsRecorder early (Closed)
Patch Set: ios Created 3 years, 8 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
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"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 const net::HttpUserAgentSettings* user_agent_settings = 342 const net::HttpUserAgentSettings* user_agent_settings =
343 main_context_->http_user_agent_settings(); 343 main_context_->http_user_agent_settings();
344 if (!user_agent_settings) { 344 if (!user_agent_settings) {
345 return nullptr; 345 return nullptr;
346 } 346 }
347 347
348 return user_agent_settings->GetUserAgent(); 348 return user_agent_settings->GetUserAgent();
349 } 349 }
350 350
351 std::vector<uint8_t> CronetEnvironment::GetHistogramDeltas() { 351 std::vector<uint8_t> CronetEnvironment::GetHistogramDeltas() {
352 base::StatisticsRecorder::Initialize();
353 std::vector<uint8_t> data; 352 std::vector<uint8_t> data;
354 if (!HistogramManager::GetInstance()->GetDeltas(&data)) 353 if (!HistogramManager::GetInstance()->GetDeltas(&data))
355 return std::vector<uint8_t>(); 354 return std::vector<uint8_t>();
356 return data; 355 return data;
357 } 356 }
358 357
359 void CronetEnvironment::SetHostResolverRules(const std::string& rules) { 358 void CronetEnvironment::SetHostResolverRules(const std::string& rules) {
360 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, 359 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
361 base::WaitableEvent::InitialState::NOT_SIGNALED); 360 base::WaitableEvent::InitialState::NOT_SIGNALED);
362 PostToNetworkThread( 361 PostToNetworkThread(
(...skipping 11 matching lines...) Expand all
374 event->Signal(); 373 event->Signal();
375 } 374 }
376 375
377 std::string CronetEnvironment::getDefaultQuicUserAgentId() const { 376 std::string CronetEnvironment::getDefaultQuicUserAgentId() const {
378 return base::SysNSStringToUTF8([[NSBundle mainBundle] 377 return base::SysNSStringToUTF8([[NSBundle mainBundle]
379 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) + 378 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) +
380 " Cronet/" + CRONET_VERSION; 379 " Cronet/" + CRONET_VERSION;
381 } 380 }
382 381
383 } // namespace cronet 382 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698