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

Side by Side Diff: sync/syncable/directory_backing_store.cc

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort headers, update copyrights Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/syncable/directory_backing_store.h" 5 #include "sync/syncable/directory_backing_store.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 SafeDropTable("models"); 537 SafeDropTable("models");
538 SafeDropTable("temp_models"); 538 SafeDropTable("temp_models");
539 needs_column_refresh_ = false; 539 needs_column_refresh_ = false;
540 } 540 }
541 541
542 // static 542 // static
543 ModelType DirectoryBackingStore::ModelIdToModelTypeEnum( 543 ModelType DirectoryBackingStore::ModelIdToModelTypeEnum(
544 const void* data, int size) { 544 const void* data, int size) {
545 sync_pb::EntitySpecifics specifics; 545 sync_pb::EntitySpecifics specifics;
546 if (!specifics.ParseFromArray(data, size)) 546 if (!specifics.ParseFromArray(data, size))
547 return syncable::UNSPECIFIED; 547 return syncer::UNSPECIFIED;
548 return syncable::GetModelTypeFromSpecifics(specifics); 548 return syncer::GetModelTypeFromSpecifics(specifics);
549 } 549 }
550 550
551 // static 551 // static
552 string DirectoryBackingStore::ModelTypeEnumToModelId(ModelType model_type) { 552 string DirectoryBackingStore::ModelTypeEnumToModelId(ModelType model_type) {
553 sync_pb::EntitySpecifics specifics; 553 sync_pb::EntitySpecifics specifics;
554 syncable::AddDefaultFieldValue(model_type, &specifics); 554 syncer::AddDefaultFieldValue(model_type, &specifics);
555 return specifics.SerializeAsString(); 555 return specifics.SerializeAsString();
556 } 556 }
557 557
558 // static 558 // static
559 std::string DirectoryBackingStore::GenerateCacheGUID() { 559 std::string DirectoryBackingStore::GenerateCacheGUID() {
560 // Generate a GUID with 128 bits of randomness. 560 // Generate a GUID with 128 bits of randomness.
561 const int kGuidBytes = 128 / 8; 561 const int kGuidBytes = 128 / 8;
562 std::string guid; 562 std::string guid;
563 base::Base64Encode(base::RandBytesAsString(kGuidBytes), &guid); 563 base::Base64Encode(base::RandBytesAsString(kGuidBytes), &guid);
564 return guid; 564 return guid;
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 "store_birthday TEXT, " 1078 "store_birthday TEXT, "
1079 "db_create_version TEXT, " 1079 "db_create_version TEXT, "
1080 "db_create_time INT, " 1080 "db_create_time INT, "
1081 "next_id INT default -2, " 1081 "next_id INT default -2, "
1082 "cache_guid TEXT )"); 1082 "cache_guid TEXT )");
1083 return db_->Execute(query.c_str()); 1083 return db_->Execute(query.c_str());
1084 } 1084 }
1085 1085
1086 } // namespace syncable 1086 } // namespace syncable
1087 } // namespace syncer 1087 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/directory_backing_store.h ('k') | sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698