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

Unified Diff: services/preferences/public/cpp/tracked/mock_validation_delegate.cc

Issue 2782803002: Move tracked prefs into services/preferences/tracked. (Closed)
Patch Set: rebase Created 3 years, 9 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
Index: services/preferences/public/cpp/tracked/mock_validation_delegate.cc
diff --git a/components/user_prefs/tracked/mock_validation_delegate.cc b/services/preferences/public/cpp/tracked/mock_validation_delegate.cc
similarity index 61%
rename from components/user_prefs/tracked/mock_validation_delegate.cc
rename to services/preferences/public/cpp/tracked/mock_validation_delegate.cc
index c82deb50a5f3cc981cc69895fb967f10768f7895..f26ff4f001f6998ba540eaacb2a29230d7591936 100644
--- a/components/user_prefs/tracked/mock_validation_delegate.cc
+++ b/services/preferences/public/cpp/tracked/mock_validation_delegate.cc
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/user_prefs/tracked/mock_validation_delegate.h"
+#include "services/preferences/public/cpp/tracked/mock_validation_delegate.h"
MockValidationDelegateRecord::MockValidationDelegateRecord() = default;
MockValidationDelegateRecord::~MockValidationDelegateRecord() = default;
size_t MockValidationDelegateRecord::CountValidationsOfState(
- PrefHashStoreTransaction::ValueState value_state) const {
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState value_state)
+ const {
size_t count = 0;
for (size_t i = 0; i < validations_.size(); ++i) {
if (validations_[i].value_state == value_state)
@@ -19,7 +20,8 @@ size_t MockValidationDelegateRecord::CountValidationsOfState(
}
size_t MockValidationDelegateRecord::CountExternalValidationsOfState(
- PrefHashStoreTransaction::ValueState value_state) const {
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState value_state)
+ const {
size_t count = 0;
for (size_t i = 0; i < validations_.size(); ++i) {
if (validations_[i].external_validation_value_state == value_state)
@@ -40,10 +42,11 @@ MockValidationDelegateRecord::GetEventForPath(
void MockValidationDelegateRecord::RecordValidation(
const std::string& pref_path,
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState
+ external_validation_value_state,
bool is_personal,
- PrefHashFilter::PrefTrackingStrategy strategy) {
+ prefs::mojom::TrackedPreferenceMetadata::PrefTrackingStrategy strategy) {
validations_.push_back(ValidationEvent(pref_path, value_state,
external_validation_value_state,
is_personal, strategy));
@@ -58,22 +61,24 @@ MockValidationDelegate::~MockValidationDelegate() = default;
void MockValidationDelegate::OnAtomicPreferenceValidation(
const std::string& pref_path,
std::unique_ptr<base::Value> value,
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState
+ external_validation_value_state,
bool is_personal) {
- record_->RecordValidation(pref_path, value_state,
- external_validation_value_state, is_personal,
- PrefHashFilter::PrefTrackingStrategy::ATOMIC);
+ record_->RecordValidation(
+ pref_path, value_state, external_validation_value_state, is_personal,
+ prefs::mojom::TrackedPreferenceMetadata::PrefTrackingStrategy::ATOMIC);
}
void MockValidationDelegate::OnSplitPreferenceValidation(
const std::string& pref_path,
const std::vector<std::string>& invalid_keys,
const std::vector<std::string>& external_validation_invalid_keys,
- PrefHashStoreTransaction::ValueState value_state,
- PrefHashStoreTransaction::ValueState external_validation_value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState value_state,
+ prefs::mojom::TrackedPreferenceValidationDelegate::ValueState
+ external_validation_value_state,
bool is_personal) {
- record_->RecordValidation(pref_path, value_state,
- external_validation_value_state, is_personal,
- PrefHashFilter::PrefTrackingStrategy::SPLIT);
+ record_->RecordValidation(
+ pref_path, value_state, external_validation_value_state, is_personal,
+ prefs::mojom::TrackedPreferenceMetadata::PrefTrackingStrategy::SPLIT);
}

Powered by Google App Engine
This is Rietveld 408576698