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

Unified Diff: components/rappor/rappor_service.h

Issue 2510803003: Pass RapporService to content/browser/ (Closed)
Patch Set: Fix an Android compile error Created 4 years 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
Index: components/rappor/rappor_service.h
diff --git a/components/rappor/rappor_service.h b/components/rappor/rappor_service.h
index 3bafcad7109b6364ec9b66ec90da664da1502f62..4d19753743dfaf9db53d2b79048779dc3d6fa3db 100644
--- a/components/rappor/rappor_service.h
+++ b/components/rappor/rappor_service.h
@@ -13,12 +13,12 @@
#include "base/callback.h"
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "components/metrics/daily_event.h"
-#include "components/rappor/rappor_parameters.h"
-#include "components/rappor/sample.h"
+#include "components/rappor/public/rappor_parameters.h"
+#include "components/rappor/public/rappor_public_service.h"
+#include "components/rappor/public/sample.h"
#include "components/rappor/sampler.h"
class PrefRegistrySimple;
@@ -36,7 +36,7 @@ class RapporReports;
// This class provides an interface for recording samples for rappor metrics,
// and periodically generates and uploads reports based on the collected data.
-class RapporService : public base::SupportsWeakPtr<RapporService> {
+class RapporService : public RapporPublicService {
public:
// Constructs a RapporService.
// Calling code is responsible for ensuring that the lifetime of
@@ -64,13 +64,10 @@ class RapporService : public base::SupportsWeakPtr<RapporService> {
void Update(int recording_groups, bool may_upload);
// Constructs a Sample object for the caller to record fields in.
- virtual std::unique_ptr<Sample> CreateSample(RapporType);
+ std::unique_ptr<Sample> CreateSample(RapporType) override;
// Records a Sample of rappor metric specified by |metric_name|.
//
- // TODO(holte): Rename RecordSample to RecordString and then rename this
- // to RecordSample.
- //
// example:
// std::unique_ptr<Sample> sample =
// rappor_service->CreateSample(MY_METRIC_TYPE);
@@ -81,14 +78,14 @@ class RapporService : public base::SupportsWeakPtr<RapporService> {
// This will result in a report setting two metrics "MyMetric.Field1" and
// "MyMetric.Field2", and they will both be generated from the same sample,
// to allow for correlations to be computed.
- virtual void RecordSampleObj(const std::string& metric_name,
- std::unique_ptr<Sample> sample);
+ void RecordSample(const std::string& metric_name,
+ std::unique_ptr<Sample> sample) override;
// Records a sample of the rappor metric specified by |metric_name|.
// Creates and initializes the metric, if it doesn't yet exist.
- virtual void RecordSample(const std::string& metric_name,
- RapporType type,
- const std::string& sample);
+ void RecordSampleString(const std::string& metric_name,
+ RapporType type,
+ const std::string& sample) override;
// Registers the names of all of the preferences used by RapporService in the
// provided PrefRegistry. This should be called before calling Start().

Powered by Google App Engine
This is Rietveld 408576698