| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/engine/build_commit_command.h" | 5 #include "chrome/browser/sync/engine/build_commit_command.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 id); | 105 id); |
| 106 CHECK(meta_entry.good()); | 106 CHECK(meta_entry.good()); |
| 107 // This is the only change we make to the entry in this function. | 107 // This is the only change we make to the entry in this function. |
| 108 meta_entry.Put(syncable::SYNCING, true); | 108 meta_entry.Put(syncable::SYNCING, true); |
| 109 | 109 |
| 110 DCHECK(0 != session->routing_info().count(meta_entry.GetModelType())) | 110 DCHECK(0 != session->routing_info().count(meta_entry.GetModelType())) |
| 111 << "Committing change to datatype that's not actively enabled."; | 111 << "Committing change to datatype that's not actively enabled."; |
| 112 | 112 |
| 113 string name = meta_entry.Get(syncable::NON_UNIQUE_NAME); | 113 string name = meta_entry.Get(syncable::NON_UNIQUE_NAME); |
| 114 CHECK(!name.empty()); // Make sure this isn't an update. | 114 CHECK(!name.empty()); // Make sure this isn't an update. |
| 115 TruncateUTF8ToByteSize(name, 255, &name); |
| 115 sync_entry->set_name(name); | 116 sync_entry->set_name(name); |
| 116 | 117 |
| 117 // Set the non_unique_name. If we do, the server ignores | 118 // Set the non_unique_name. If we do, the server ignores |
| 118 // the |name| value (using |non_unique_name| instead), and will return | 119 // the |name| value (using |non_unique_name| instead), and will return |
| 119 // in the CommitResponse a unique name if one is generated. | 120 // in the CommitResponse a unique name if one is generated. |
| 120 // We send both because it may aid in logging. | 121 // We send both because it may aid in logging. |
| 121 sync_entry->set_non_unique_name(name); | 122 sync_entry->set_non_unique_name(name); |
| 122 | 123 |
| 123 if (!meta_entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) { | 124 if (!meta_entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) { |
| 124 sync_entry->set_client_defined_unique_tag( | 125 sync_entry->set_client_defined_unique_tag( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // the new-style scheme, we should abandon the old way. | 194 // the new-style scheme, we should abandon the old way. |
| 194 SetOldStyleBookmarkData(&meta_entry, sync_entry); | 195 SetOldStyleBookmarkData(&meta_entry, sync_entry); |
| 195 } | 196 } |
| 196 SetEntrySpecifics(&meta_entry, sync_entry); | 197 SetEntrySpecifics(&meta_entry, sync_entry); |
| 197 } | 198 } |
| 198 } | 199 } |
| 199 session->status_controller()->mutable_commit_message()->CopyFrom(message); | 200 session->status_controller()->mutable_commit_message()->CopyFrom(message); |
| 200 } | 201 } |
| 201 | 202 |
| 202 } // namespace browser_sync | 203 } // namespace browser_sync |
| OLD | NEW |