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

Unified Diff: chrome/browser/sync/engine/build_commit_command.cc

Issue 340055: String cleanup in sync code (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/build_commit_command.cc
===================================================================
--- chrome/browser/sync/engine/build_commit_command.cc (revision 30948)
+++ chrome/browser/sync/engine/build_commit_command.cc (working copy)
@@ -14,7 +14,6 @@
#include "chrome/browser/sync/engine/syncproto.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/syncable/syncable_changes_version.h"
-#include "chrome/browser/sync/util/character_set_converters.h"
#include "chrome/browser/sync/util/sync_types.h"
using std::set;
@@ -46,7 +45,7 @@
void BuildCommitCommand::ExecuteImpl(SyncerSession* session) {
ClientToServerMessage message;
- message.set_share(ToUTF8(session->account_name()).get_string());
+ message.set_share(session->account_name());
message.set_message_contents(ClientToServerMessage::COMMIT);
CommitMessage* commit_message = message.mutable_commit();
@@ -69,15 +68,14 @@
Name name = meta_entry.GetName();
CHECK(!name.value().empty()); // Make sure this isn't an update.
- sync_entry->set_name(ToUTF8(name.value()).get_string());
+ sync_entry->set_name(name.value());
// Set the non_unique_name if we have one. If we do, the server ignores
// the |name| value (using |non_unique_name| instead), and will return
// in the CommitResponse a unique name if one is generated. Even though
// we could get away with only sending |name|, we send both because it
// may aid in logging.
if (name.value() != name.non_unique_value()) {
- sync_entry->set_non_unique_name(
- ToUTF8(name.non_unique_value()).get_string());
+ sync_entry->set_non_unique_name(name.non_unique_value());
}
// Deleted items with negative parent ids can be a problem so we set the
// parent to 0. (TODO(sync): Still true in protocol?).
@@ -126,7 +124,7 @@
++iter) {
sync_pb::ExtendedAttributes_ExtendedAttribute *extended_attribute =
mutable_extended_attributes->add_extendedattribute();
- extended_attribute->set_key(ToUTF8(iter->key()).get_string());
+ extended_attribute->set_key(iter->key());
SyncerProtoUtil::CopyBlobIntoProtoBytes(iter->value(),
extended_attribute->mutable_value());
}
@@ -143,7 +141,7 @@
sync_entry->set_insert_after_item_id(prev_string);
if (!meta_entry.Get(syncable::IS_DIR)) {
- string bookmark_url = ToUTF8(meta_entry.Get(syncable::BOOKMARK_URL));
+ string bookmark_url = meta_entry.Get(syncable::BOOKMARK_URL);
bookmark->set_bookmark_url(bookmark_url);
SyncerProtoUtil::CopyBlobIntoProtoBytes(
meta_entry.Get(syncable::BOOKMARK_FAVICON),
« no previous file with comments | « chrome/browser/sync/engine/auth_watcher_unittest.cc ('k') | chrome/browser/sync/engine/download_updates_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698