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

Unified Diff: components/rappor/test_rappor_service.cc

Issue 2510803003: Pass RapporService to content/browser/ (Closed)
Patch Set: Fix more compile errors in JNI files 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/test_rappor_service.cc
diff --git a/components/rappor/test_rappor_service.cc b/components/rappor/test_rappor_service.cc
index edd51c3f2d9a3435f4372162ec148ca0533de64e..8689873d68142b5efc1878755e67f7fde673f8d7 100644
--- a/components/rappor/test_rappor_service.cc
+++ b/components/rappor/test_rappor_service.cc
@@ -10,7 +10,7 @@
#include "base/memory/ptr_util.h"
#include "components/rappor/byte_vector_utils.h"
#include "components/rappor/proto/rappor_metric.pb.h"
-#include "components/rappor/rappor_parameters.h"
+#include "components/rappor/public/rappor_parameters.h"
#include "components/rappor/rappor_prefs.h"
#include "components/rappor/test_log_uploader.h"
@@ -52,8 +52,9 @@ TestSample::Shadow::Shadow(const TestSample::Shadow& other) {
TestSample::Shadow::~Shadow() {}
-TestRapporService::TestRapporService()
- : RapporService(&test_prefs_, base::Bind(&MockIsIncognito, &is_incognito_)),
+TestRapporServiceImpl::TestRapporServiceImpl()
+ : RapporServiceImpl(&test_prefs_,
+ base::Bind(&MockIsIncognito, &is_incognito_)),
next_rotation_(base::TimeDelta()),
is_incognito_(false) {
RegisterPrefs(test_prefs_.registry());
@@ -63,48 +64,48 @@ TestRapporService::TestRapporService()
Update(UMA_RAPPOR_GROUP | SAFEBROWSING_RAPPOR_GROUP, true);
}
-TestRapporService::~TestRapporService() {}
+TestRapporServiceImpl::~TestRapporServiceImpl() {}
-std::unique_ptr<Sample> TestRapporService::CreateSample(RapporType type) {
+std::unique_ptr<Sample> TestRapporServiceImpl::CreateSample(RapporType type) {
std::unique_ptr<TestSample> test_sample(new TestSample(type));
return std::move(test_sample);
}
// Intercepts the sample being recorded and saves it in a test structure.
-void TestRapporService::RecordSampleObj(const std::string& metric_name,
- std::unique_ptr<Sample> sample) {
+void TestRapporServiceImpl::RecordSample(const std::string& metric_name,
+ std::unique_ptr<Sample> sample) {
TestSample* test_sample = static_cast<TestSample*>(sample.get());
// Erase the previous sample if we logged one.
shadows_.erase(metric_name);
shadows_.insert(std::pair<std::string, TestSample::Shadow>(
metric_name, test_sample->GetShadow()));
// Original version is still called.
- RapporService::RecordSampleObj(metric_name, std::move(sample));
+ RapporServiceImpl::RecordSample(metric_name, std::move(sample));
}
-void TestRapporService::RecordSample(const std::string& metric_name,
- RapporType type,
- const std::string& sample) {
+void TestRapporServiceImpl::RecordSampleString(const std::string& metric_name,
+ RapporType type,
+ const std::string& sample) {
// Save the recorded sample to the local structure.
RapporSample rappor_sample;
rappor_sample.type = type;
rappor_sample.value = sample;
samples_[metric_name] = rappor_sample;
// Original version is still called.
- RapporService::RecordSample(metric_name, type, sample);
+ RapporServiceImpl::RecordSampleString(metric_name, type, sample);
}
-int TestRapporService::GetReportsCount() {
+int TestRapporServiceImpl::GetReportsCount() {
RapporReports reports;
ExportMetrics(&reports);
return reports.report_size();
}
-void TestRapporService::GetReports(RapporReports* reports) {
+void TestRapporServiceImpl::GetReports(RapporReports* reports) {
ExportMetrics(reports);
}
-TestSample::Shadow* TestRapporService::GetRecordedSampleForMetric(
+TestSample::Shadow* TestRapporServiceImpl::GetRecordedSampleForMetric(
const std::string& metric_name) {
ShadowMap::iterator it = shadows_.find(metric_name);
if (it == shadows_.end())
@@ -112,7 +113,7 @@ TestSample::Shadow* TestRapporService::GetRecordedSampleForMetric(
return &it->second;
}
-bool TestRapporService::GetRecordedSampleForMetric(
+bool TestRapporServiceImpl::GetRecordedSampleForMetric(
const std::string& metric_name,
std::string* sample,
RapporType* type) {
@@ -125,12 +126,12 @@ bool TestRapporService::GetRecordedSampleForMetric(
}
// Cancel the next call to OnLogInterval.
-void TestRapporService::CancelNextLogRotation() {
+void TestRapporServiceImpl::CancelNextLogRotation() {
next_rotation_ = base::TimeDelta();
}
// Schedule the next call to OnLogInterval.
-void TestRapporService::ScheduleNextLogRotation(base::TimeDelta interval) {
+void TestRapporServiceImpl::ScheduleNextLogRotation(base::TimeDelta interval) {
next_rotation_ = interval;
}

Powered by Google App Engine
This is Rietveld 408576698