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

Unified Diff: components/metrics/metrics_state_manager.h

Issue 1906173002: Convert //components/metrics from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/metrics_service_unittest.cc ('k') | components/metrics/metrics_state_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_state_manager.h
diff --git a/components/metrics/metrics_state_manager.h b/components/metrics/metrics_state_manager.h
index cbf5bf71b6b14eb0d03c28c0a8ce3c85c0ee54a0..eafedc7a02c6178a4c9feb3aebc0af3bf1aa52ef 100644
--- a/components/metrics/metrics_state_manager.h
+++ b/components/metrics/metrics_state_manager.h
@@ -5,12 +5,12 @@
#ifndef COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_
#define COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_
+#include <memory>
#include <string>
#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "components/metrics/client_info.h"
@@ -33,7 +33,8 @@ class MetricsStateManager {
// A callback that can be invoked to load client info stored through the
// StoreClientInfoCallback.
- typedef base::Callback<scoped_ptr<ClientInfo>(void)> LoadClientInfoCallback;
+ typedef base::Callback<std::unique_ptr<ClientInfo>(void)>
+ LoadClientInfoCallback;
virtual ~MetricsStateManager();
@@ -61,11 +62,12 @@ class MetricsStateManager {
// that has a high source of entropy, partially based on the client ID.
// Otherwise, it returns an entropy provider that is based on a low entropy
// source.
- scoped_ptr<const base::FieldTrial::EntropyProvider> CreateEntropyProvider();
+ std::unique_ptr<const base::FieldTrial::EntropyProvider>
+ CreateEntropyProvider();
// Creates the MetricsStateManager, enforcing that only a single instance
// of the class exists at a time. Returns NULL if an instance exists already.
- static scoped_ptr<MetricsStateManager> Create(
+ static std::unique_ptr<MetricsStateManager> Create(
PrefService* local_state,
const base::Callback<bool(void)>& is_reporting_enabled_callback,
const StoreClientInfoCallback& store_client_info,
@@ -109,7 +111,7 @@ class MetricsStateManager {
// Loads the client info via |load_client_info_| and potentially migrates it
// before returning it if it comes back in its old form.
- scoped_ptr<ClientInfo> LoadClientInfoAndMaybeMigrate();
+ std::unique_ptr<ClientInfo> LoadClientInfoAndMaybeMigrate();
// Returns the low entropy source for this client. This is a random value
// that is non-identifying amongst browser clients. This method will
@@ -163,7 +165,7 @@ class MetricsStateManager {
// The last entropy source returned by this service, used for testing.
EntropySourceType entropy_source_returned_;
- scoped_ptr<ClonedInstallDetector> cloned_install_detector_;
+ std::unique_ptr<ClonedInstallDetector> cloned_install_detector_;
DISALLOW_COPY_AND_ASSIGN(MetricsStateManager);
};
« no previous file with comments | « components/metrics/metrics_service_unittest.cc ('k') | components/metrics/metrics_state_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698