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

Side by Side Diff: chrome/browser/sync/api/sync_data.cc

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fred's review Created 8 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/api/sync_data.h" 5 #include "chrome/browser/sync/api/sync_data.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 id_(id), 49 id_(id),
50 immutable_entity_(entity) {} 50 immutable_entity_(entity) {}
51 51
52 SyncData::~SyncData() {} 52 SyncData::~SyncData() {}
53 53
54 // Static. 54 // Static.
55 SyncData SyncData::CreateLocalDelete( 55 SyncData SyncData::CreateLocalDelete(
56 const std::string& sync_tag, 56 const std::string& sync_tag,
57 syncable::ModelType datatype) { 57 syncable::ModelType datatype) {
58 sync_pb::EntitySpecifics specifics; 58 sync_pb::EntitySpecifics specifics;
59 syncable::AddDefaultExtensionValue(datatype, &specifics); 59 syncable::AddDefaultFieldValue(datatype, &specifics);
60 return CreateLocalData(sync_tag, "", specifics); 60 return CreateLocalData(sync_tag, "", specifics);
61 } 61 }
62 62
63 // Static. 63 // Static.
64 SyncData SyncData::CreateLocalData( 64 SyncData SyncData::CreateLocalData(
65 const std::string& sync_tag, 65 const std::string& sync_tag,
66 const std::string& non_unique_title, 66 const std::string& non_unique_title,
67 const sync_pb::EntitySpecifics& specifics) { 67 const sync_pb::EntitySpecifics& specifics) {
68 sync_pb::SyncEntity entity; 68 sync_pb::SyncEntity entity;
69 entity.set_client_defined_unique_tag(sync_tag); 69 entity.set_client_defined_unique_tag(sync_tag);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 std::string id = base::Int64ToString(GetRemoteId()); 131 std::string id = base::Int64ToString(GetRemoteId());
132 return "{ isLocal: false, type: " + type + ", specifics: " + specifics + 132 return "{ isLocal: false, type: " + type + ", specifics: " + specifics +
133 ", id: " + id + "}"; 133 ", id: " + id + "}";
134 } 134 }
135 135
136 void PrintTo(const SyncData& sync_data, std::ostream* os) { 136 void PrintTo(const SyncData& sync_data, std::ostream* os) {
137 *os << sync_data.ToString(); 137 *os << sync_data.ToString();
138 } 138 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/api/sync_change_unittest.cc ('k') | chrome/browser/sync/engine/apply_updates_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698