| OLD | NEW |
| 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/api/sync_data.h" | 5 #include "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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 immutable_entity_(entity) {} | 52 immutable_entity_(entity) {} |
| 53 | 53 |
| 54 SyncData::~SyncData() {} | 54 SyncData::~SyncData() {} |
| 55 | 55 |
| 56 // Static. | 56 // Static. |
| 57 SyncData SyncData::CreateLocalDelete( | 57 SyncData SyncData::CreateLocalDelete( |
| 58 const std::string& sync_tag, | 58 const std::string& sync_tag, |
| 59 ModelType datatype) { | 59 ModelType datatype) { |
| 60 sync_pb::EntitySpecifics specifics; | 60 sync_pb::EntitySpecifics specifics; |
| 61 AddDefaultFieldValue(datatype, &specifics); | 61 AddDefaultFieldValue(datatype, &specifics); |
| 62 return CreateLocalData(sync_tag, "", specifics); | 62 return CreateLocalData(sync_tag, std::string(), specifics); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Static. | 65 // Static. |
| 66 SyncData SyncData::CreateLocalData( | 66 SyncData SyncData::CreateLocalData( |
| 67 const std::string& sync_tag, | 67 const std::string& sync_tag, |
| 68 const std::string& non_unique_title, | 68 const std::string& non_unique_title, |
| 69 const sync_pb::EntitySpecifics& specifics) { | 69 const sync_pb::EntitySpecifics& specifics) { |
| 70 sync_pb::SyncEntity entity; | 70 sync_pb::SyncEntity entity; |
| 71 entity.set_client_defined_unique_tag(sync_tag); | 71 entity.set_client_defined_unique_tag(sync_tag); |
| 72 entity.set_non_unique_name(non_unique_title); | 72 entity.set_non_unique_name(non_unique_title); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::string id = base::Int64ToString(GetRemoteId()); | 134 std::string id = base::Int64ToString(GetRemoteId()); |
| 135 return "{ isLocal: false, type: " + type + ", specifics: " + specifics + | 135 return "{ isLocal: false, type: " + type + ", specifics: " + specifics + |
| 136 ", id: " + id + "}"; | 136 ", id: " + id + "}"; |
| 137 } | 137 } |
| 138 | 138 |
| 139 void PrintTo(const SyncData& sync_data, std::ostream* os) { | 139 void PrintTo(const SyncData& sync_data, std::ostream* os) { |
| 140 *os << sync_data.ToString(); | 140 *os << sync_data.ToString(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace syncer | 143 } // namespace syncer |
| OLD | NEW |