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

Side by Side Diff: ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm

Issue 2256193002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client. h" 5 #include "ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client. h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/metrics/enabled_state_provider.h" 10 #include "components/metrics/enabled_state_provider.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 local_state_(local_state) { 50 local_state_(local_state) {
51 DCHECK(local_state); 51 DCHECK(local_state);
52 } 52 }
53 53
54 IOSChromeMetricsServicesManagerClient:: 54 IOSChromeMetricsServicesManagerClient::
55 ~IOSChromeMetricsServicesManagerClient() = default; 55 ~IOSChromeMetricsServicesManagerClient() = default;
56 56
57 std::unique_ptr<rappor::RapporService> 57 std::unique_ptr<rappor::RapporService>
58 IOSChromeMetricsServicesManagerClient::CreateRapporService() { 58 IOSChromeMetricsServicesManagerClient::CreateRapporService() {
59 DCHECK(thread_checker_.CalledOnValidThread()); 59 DCHECK(thread_checker_.CalledOnValidThread());
60 return base::WrapUnique(new rappor::RapporService( 60 return base::MakeUnique<rappor::RapporService>(
61 local_state_, base::Bind(&::IsOffTheRecordSessionActive))); 61 local_state_, base::Bind(&::IsOffTheRecordSessionActive));
62 } 62 }
63 63
64 std::unique_ptr<variations::VariationsService> 64 std::unique_ptr<variations::VariationsService>
65 IOSChromeMetricsServicesManagerClient::CreateVariationsService() { 65 IOSChromeMetricsServicesManagerClient::CreateVariationsService() {
66 DCHECK(thread_checker_.CalledOnValidThread()); 66 DCHECK(thread_checker_.CalledOnValidThread());
67 67
68 // NOTE: On iOS, disabling background networking is not supported, so pass in 68 // NOTE: On iOS, disabling background networking is not supported, so pass in
69 // a dummy value for the name of the switch that disables background 69 // a dummy value for the name of the switch that disables background
70 // networking. 70 // networking.
71 return variations::VariationsService::Create( 71 return variations::VariationsService::Create(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 IOSChromeMetricsServicesManagerClient::GetMetricsStateManager() { 105 IOSChromeMetricsServicesManagerClient::GetMetricsStateManager() {
106 DCHECK(thread_checker_.CalledOnValidThread()); 106 DCHECK(thread_checker_.CalledOnValidThread());
107 if (!metrics_state_manager_) { 107 if (!metrics_state_manager_) {
108 metrics_state_manager_ = metrics::MetricsStateManager::Create( 108 metrics_state_manager_ = metrics::MetricsStateManager::Create(
109 local_state_, enabled_state_provider_.get(), 109 local_state_, enabled_state_provider_.get(),
110 base::Bind(&PostStoreMetricsClientInfo), 110 base::Bind(&PostStoreMetricsClientInfo),
111 base::Bind(&LoadMetricsClientInfo)); 111 base::Bind(&LoadMetricsClientInfo));
112 } 112 }
113 return metrics_state_manager_.get(); 113 return metrics_state_manager_.get();
114 } 114 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ios_chrome_main_parts.mm ('k') | ios/chrome/browser/metrics/ios_chrome_origins_seen_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698