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

Unified Diff: sync/syncable/syncable_id.cc

Issue 867793003: Remove dependency on server generated type root folders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ScopedKernelLock to Directory::HasEmptyDownloadProgress Created 5 years, 11 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: sync/syncable/syncable_id.cc
diff --git a/sync/syncable/syncable_id.cc b/sync/syncable/syncable_id.cc
index 5cd777ff2eff81f67f70b519eda98417eecd5c60..d50f6cb914043da2f37d4afbb4e9ffcc724b0f1f 100644
--- a/sync/syncable/syncable_id.cc
+++ b/sync/syncable/syncable_id.cc
@@ -35,19 +35,23 @@ string Id::GetServerId() const {
Id Id::CreateFromServerId(const string& server_id) {
Id id;
- if (server_id == "0")
- id.s_ = "r";
- else
- id.s_ = string("s") + server_id;
+ if (!server_id.empty()) {
Nicolas Zea 2015/01/26 23:21:53 This just for testing right? Or was there another
stanisc 2015/01/28 07:30:06 Once the server transition is done, most of parent
+ if (server_id == "0")
+ id.s_ = "r";
+ else
+ id.s_ = string("s") + server_id;
+ }
return id;
}
Id Id::CreateFromClientString(const string& local_id) {
Id id;
- if (local_id == "0")
- id.s_ = "r";
- else
- id.s_ = string("c") + local_id;
+ if (!local_id.empty()) {
+ if (local_id == "0")
+ id.s_ = "r";
+ else
+ id.s_ = string("c") + local_id;
+ }
return id;
}

Powered by Google App Engine
This is Rietveld 408576698