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

Unified Diff: components/sync/model_impl/processor_entity_tracker.cc

Issue 2915763005: [Sync] Implement support for updating storage key for new entities (Closed)
Patch Set: Rebase. Fix recommit for encryption scenario. Created 3 years, 6 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: components/sync/model_impl/processor_entity_tracker.cc
diff --git a/components/sync/model_impl/processor_entity_tracker.cc b/components/sync/model_impl/processor_entity_tracker.cc
index 7d0b6b331982e95c17beaa33630fefb2932e3165..f6fe203d2d3dff93bd987e064d26ccea71aa91b3 100644
--- a/components/sync/model_impl/processor_entity_tracker.cc
+++ b/components/sync/model_impl/processor_entity_tracker.cc
@@ -45,6 +45,7 @@ std::unique_ptr<ProcessorEntityTracker> ProcessorEntityTracker::CreateNew(
std::unique_ptr<ProcessorEntityTracker>
ProcessorEntityTracker::CreateFromMetadata(const std::string& storage_key,
sync_pb::EntityMetadata* metadata) {
+ DCHECK(!storage_key.empty());
return std::unique_ptr<ProcessorEntityTracker>(
new ProcessorEntityTracker(storage_key, metadata));
}
@@ -61,8 +62,10 @@ ProcessorEntityTracker::ProcessorEntityTracker(
ProcessorEntityTracker::~ProcessorEntityTracker() {}
-void ProcessorEntityTracker::SetStorageKey(const std::string& new_key) {
- storage_key_ = new_key;
+void ProcessorEntityTracker::SetStorageKey(const std::string& storage_key) {
+ DCHECK(storage_key_.empty());
+ DCHECK(!storage_key.empty());
+ storage_key_ = storage_key;
}
void ProcessorEntityTracker::SetCommitData(EntityData* data) {
« no previous file with comments | « components/sync/model_impl/processor_entity_tracker.h ('k') | components/sync/model_impl/processor_entity_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698