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

Side by Side Diff: chrome/browser/sync/glue/generic_change_processor.cc

Issue 120983002: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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) 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 "chrome/browser/sync/glue/generic_change_processor.h" 5 #include "chrome/browser/sync/glue/generic_change_processor.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 default: { 404 default: {
405 syncer::SyncError error; 405 syncer::SyncError error;
406 error.Reset(FROM_HERE, error_prefix + "unknown error", type); 406 error.Reset(FROM_HERE, error_prefix + "unknown error", type);
407 error_handler()->OnSingleDatatypeUnrecoverableError( 407 error_handler()->OnSingleDatatypeUnrecoverableError(
408 FROM_HERE, error.message()); 408 FROM_HERE, error.message());
409 LOG(ERROR) << "Create: Unknown error."; 409 LOG(ERROR) << "Create: Unknown error.";
410 return error; 410 return error;
411 } 411 }
412 } 412 }
413 } 413 }
414 sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); 414 sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle()));
415 SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node); 415 SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node);
416 if (merge_result_.get()) { 416 if (merge_result_.get()) {
417 merge_result_->set_num_items_added(merge_result_->num_items_added() + 417 merge_result_->set_num_items_added(merge_result_->num_items_added() +
418 1); 418 1);
419 } 419 }
420 } else if (change.change_type() == syncer::SyncChange::ACTION_UPDATE) { 420 } else if (change.change_type() == syncer::SyncChange::ACTION_UPDATE) {
421 // TODO(zea): consider having this logic for all possible changes? 421 // TODO(zea): consider having this logic for all possible changes?
422 syncer::BaseNode::InitByLookupResult result = 422 syncer::BaseNode::InitByLookupResult result =
423 sync_node.InitByClientTagLookup(change.sync_data().GetDataType(), 423 sync_node.InitByClientTagLookup(change.sync_data().GetDataType(),
424 change.sync_data().GetTag()); 424 change.sync_data().GetTag());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 "(?!) and nigori mismatch for " + type_str + ".", 497 "(?!) and nigori mismatch for " + type_str + ".",
498 type); 498 type);
499 error_handler()->OnSingleDatatypeUnrecoverableError( 499 error_handler()->OnSingleDatatypeUnrecoverableError(
500 FROM_HERE, error.message()); 500 FROM_HERE, error.message());
501 LOG(ERROR) << "Update: encr case 4."; 501 LOG(ERROR) << "Update: encr case 4.";
502 return error; 502 return error;
503 } 503 }
504 } 504 }
505 } 505 }
506 506
507 sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); 507 sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle()));
508 SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node); 508 SetNodeSpecifics(change.sync_data().GetSpecifics(), &sync_node);
509 if (merge_result_.get()) { 509 if (merge_result_.get()) {
510 merge_result_->set_num_items_modified( 510 merge_result_->set_num_items_modified(
511 merge_result_->num_items_modified() + 1); 511 merge_result_->num_items_modified() + 1);
512 } 512 }
513 // TODO(sync): Support updating other parts of the sync node (title, 513 // TODO(sync): Support updating other parts of the sync node (title,
514 // successor, parent, etc.). 514 // successor, parent, etc.).
515 } else { 515 } else {
516 syncer::SyncError error( 516 syncer::SyncError error(
517 FROM_HERE, 517 FROM_HERE,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 void GenericChangeProcessor::StartImpl(Profile* profile) { 566 void GenericChangeProcessor::StartImpl(Profile* profile) {
567 DCHECK(CalledOnValidThread()); 567 DCHECK(CalledOnValidThread());
568 } 568 }
569 569
570 syncer::UserShare* GenericChangeProcessor::share_handle() const { 570 syncer::UserShare* GenericChangeProcessor::share_handle() const {
571 DCHECK(CalledOnValidThread()); 571 DCHECK(CalledOnValidThread());
572 return share_handle_; 572 return share_handle_;
573 } 573 }
574 574
575 } // namespace browser_sync 575 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/bookmark_model_associator.cc ('k') | chrome/browser/sync/glue/password_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698