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

Side by Side Diff: services/preferences/persistent_pref_store_impl.cc

Issue 2799043003: Revert of Pref service: add support for tracked prefs. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "services/preferences/persistent_pref_store_impl.h" 5 #include "services/preferences/persistent_pref_store_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 // If true then a write is in progress and any update notifications should be 68 // If true then a write is in progress and any update notifications should be
69 // ignored, as those updates would originate from ourselves. 69 // ignored, as those updates would originate from ourselves.
70 bool write_in_progress_ = false; 70 bool write_in_progress_ = false;
71 71
72 DISALLOW_COPY_AND_ASSIGN(Connection); 72 DISALLOW_COPY_AND_ASSIGN(Connection);
73 }; 73 };
74 74
75 PersistentPrefStoreImpl::PersistentPrefStoreImpl( 75 PersistentPrefStoreImpl::PersistentPrefStoreImpl(
76 scoped_refptr<PersistentPrefStore> backing_pref_store, 76 scoped_refptr<PersistentPrefStore> backing_pref_store,
77 mojom::TrackedPreferenceValidationDelegatePtr validation_delegate,
77 base::OnceClosure on_initialized) 78 base::OnceClosure on_initialized)
78 : backing_pref_store_(backing_pref_store) { 79 : backing_pref_store_(backing_pref_store),
80 validation_delegate_(std::move(validation_delegate)) {
79 backing_pref_store_->AddObserver(this); 81 backing_pref_store_->AddObserver(this);
80 if (!backing_pref_store_->IsInitializationComplete()) { 82 if (!backing_pref_store_->IsInitializationComplete()) {
81 on_initialized_ = std::move(on_initialized); 83 on_initialized_ = std::move(on_initialized);
82 initializing_ = true; 84 initializing_ = true;
83 backing_pref_store_->ReadPrefsAsync(nullptr); 85 backing_pref_store_->ReadPrefsAsync(nullptr);
84 } 86 }
85 } 87 }
86 88
87 PersistentPrefStoreImpl::~PersistentPrefStoreImpl() { 89 PersistentPrefStoreImpl::~PersistentPrefStoreImpl() {
88 backing_pref_store_->RemoveObserver(this); 90 backing_pref_store_->RemoveObserver(this);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 153
152 void PersistentPrefStoreImpl::ClearMutableValues() { 154 void PersistentPrefStoreImpl::ClearMutableValues() {
153 backing_pref_store_->ClearMutableValues(); 155 backing_pref_store_->ClearMutableValues();
154 } 156 }
155 157
156 void PersistentPrefStoreImpl::OnConnectionError(Connection* connection) { 158 void PersistentPrefStoreImpl::OnConnectionError(Connection* connection) {
157 connections_.erase(connection); 159 connections_.erase(connection);
158 } 160 }
159 161
160 } // namespace prefs 162 } // namespace prefs
OLDNEW
« no previous file with comments | « services/preferences/persistent_pref_store_impl.h ('k') | services/preferences/persistent_pref_store_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698