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

Unified Diff: chrome/browser/sync/glue/generic_change_processor.cc

Issue 23129007: sync: Add GetAllSyncData to sync/api (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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: chrome/browser/sync/glue/generic_change_processor.cc
diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc
index c40fca28db7001fdc6ec56705b0805e586596e1b..61de688ec49b00781b3e77e54a49b86a089cb3c5 100644
--- a/chrome/browser/sync/glue/generic_change_processor.cc
+++ b/chrome/browser/sync/glue/generic_change_processor.cc
@@ -138,7 +138,7 @@ void GenericChangeProcessor::CommitChangesFromSyncModel() {
syncer::SyncError GenericChangeProcessor::GetSyncDataForType(
syncer::ModelType type,
- syncer::SyncDataList* current_sync_data) {
+ syncer::SyncDataList* current_sync_data) const {
DCHECK(CalledOnValidThread());
std::string type_name = syncer::ModelTypeToString(type);
syncer::ReadTransaction trans(FROM_HERE, share_handle());
@@ -303,6 +303,15 @@ syncer::SyncError AttemptDelete(
} // namespace
+syncer::SyncDataList GenericChangeProcessor::GetAllSyncData(
+ syncer::ModelType type) const {
+ // This is slow / memory intensive. Should be used sparingly by datatypes.
+ syncer::SyncDataList data;
+ if (GetSyncDataForType(type, &data).IsSet())
+ return syncer::SyncDataList();
+ return data;
+}
+
// WARNING: this code is sensitive to compiler optimizations. Be careful
// modifying any code around an OnSingleDatatypeUnrecoverableError call, else
// the compiler attempts to merge it with other calls, losing useful information

Powered by Google App Engine
This is Rietveld 408576698