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

Side by Side Diff: sync/engine/commit_util.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/engine/commit_util.h" 5 #include "sync/engine/commit_util.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const syncable::Entry& meta_entry, 98 const syncable::Entry& meta_entry,
99 sync_pb::SyncEntity* sync_entry) { 99 sync_pb::SyncEntity* sync_entry) {
100 syncable::Id id = meta_entry.GetId(); 100 syncable::Id id = meta_entry.GetId();
101 sync_entry->set_id_string(SyncableIdToProto(id)); 101 sync_entry->set_id_string(SyncableIdToProto(id));
102 102
103 string name = meta_entry.GetNonUniqueName(); 103 string name = meta_entry.GetNonUniqueName();
104 CHECK(!name.empty()); // Make sure this isn't an update. 104 CHECK(!name.empty()); // Make sure this isn't an update.
105 // Note: Truncation is also performed in WriteNode::SetTitle(..). But this 105 // Note: Truncation is also performed in WriteNode::SetTitle(..). But this
106 // call is still necessary to handle any title changes that might originate 106 // call is still necessary to handle any title changes that might originate
107 // elsewhere, or already be persisted in the directory. 107 // elsewhere, or already be persisted in the directory.
108 TruncateUTF8ToByteSize(name, 255, &name); 108 base::TruncateUTF8ToByteSize(name, 255, &name);
109 sync_entry->set_name(name); 109 sync_entry->set_name(name);
110 110
111 // Set the non_unique_name. If we do, the server ignores 111 // Set the non_unique_name. If we do, the server ignores
112 // the |name| value (using |non_unique_name| instead), and will return 112 // the |name| value (using |non_unique_name| instead), and will return
113 // in the CommitResponse a unique name if one is generated. 113 // in the CommitResponse a unique name if one is generated.
114 // We send both because it may aid in logging. 114 // We send both because it may aid in logging.
115 sync_entry->set_non_unique_name(name); 115 sync_entry->set_non_unique_name(name);
116 116
117 if (!meta_entry.GetUniqueClientTag().empty()) { 117 if (!meta_entry.GetUniqueClientTag().empty()) {
118 sync_entry->set_client_defined_unique_tag( 118 sync_entry->set_client_defined_unique_tag(
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 432
433 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry, 433 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry,
434 local_entry.GetId(), &local_entry, syncing_was_set, deleted_folders); 434 local_entry.GetId(), &local_entry, syncing_was_set, deleted_folders);
435 return response; 435 return response;
436 } 436 }
437 437
438 } // namespace commit_util 438 } // namespace commit_util
439 439
440 } // namespace syncer 440 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698