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

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

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 default: { 345 default: {
346 syncer::SyncError error; 346 syncer::SyncError error;
347 error.Reset(FROM_HERE, error_prefix + "unknown error", type); 347 error.Reset(FROM_HERE, error_prefix + "unknown error", type);
348 error_handler()->OnSingleDatatypeUnrecoverableError( 348 error_handler()->OnSingleDatatypeUnrecoverableError(
349 FROM_HERE, error.message()); 349 FROM_HERE, error.message());
350 LOG(ERROR) << "Create: Unknown error."; 350 LOG(ERROR) << "Create: Unknown error.";
351 return error; 351 return error;
352 } 352 }
353 } 353 }
354 } 354 }
355 sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); 355 sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle()));
356 sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics()); 356 sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics());
357 if (merge_result_.get()) { 357 if (merge_result_.get()) {
358 merge_result_->set_num_items_added( 358 merge_result_->set_num_items_added(
359 merge_result_->num_items_added() + 1); 359 merge_result_->num_items_added() + 1);
360 } 360 }
361 } else if (change.change_type() == syncer::SyncChange::ACTION_UPDATE) { 361 } else if (change.change_type() == syncer::SyncChange::ACTION_UPDATE) {
362 // TODO(zea): consider having this logic for all possible changes? 362 // TODO(zea): consider having this logic for all possible changes?
363 syncer::BaseNode::InitByLookupResult result = 363 syncer::BaseNode::InitByLookupResult result =
364 sync_node.InitByClientTagLookup(change.sync_data().GetDataType(), 364 sync_node.InitByClientTagLookup(change.sync_data().GetDataType(),
365 change.sync_data().GetTag()); 365 change.sync_data().GetTag());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 "(?!) and nigori mismatch for " + type_str + ".", 438 "(?!) and nigori mismatch for " + type_str + ".",
439 type); 439 type);
440 error_handler()->OnSingleDatatypeUnrecoverableError( 440 error_handler()->OnSingleDatatypeUnrecoverableError(
441 FROM_HERE, error.message()); 441 FROM_HERE, error.message());
442 LOG(ERROR) << "Update: encr case 4."; 442 LOG(ERROR) << "Update: encr case 4.";
443 return error; 443 return error;
444 } 444 }
445 } 445 }
446 } 446 }
447 447
448 sync_node.SetTitle(UTF8ToWide(change.sync_data().GetTitle())); 448 sync_node.SetTitle(base::UTF8ToWide(change.sync_data().GetTitle()));
449 sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics()); 449 sync_node.SetEntitySpecifics(change.sync_data().GetSpecifics());
450 if (merge_result_.get()) { 450 if (merge_result_.get()) {
451 merge_result_->set_num_items_modified( 451 merge_result_->set_num_items_modified(
452 merge_result_->num_items_modified() + 1); 452 merge_result_->num_items_modified() + 1);
453 } 453 }
454 // TODO(sync): Support updating other parts of the sync node (title, 454 // TODO(sync): Support updating other parts of the sync node (title,
455 // successor, parent, etc.). 455 // successor, parent, etc.).
456 } else { 456 } else {
457 syncer::SyncError error( 457 syncer::SyncError error(
458 FROM_HERE, 458 FROM_HERE,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 void GenericChangeProcessor::StartImpl(Profile* profile) { 506 void GenericChangeProcessor::StartImpl(Profile* profile) {
507 DCHECK(CalledOnValidThread()); 507 DCHECK(CalledOnValidThread());
508 } 508 }
509 509
510 syncer::UserShare* GenericChangeProcessor::share_handle() const { 510 syncer::UserShare* GenericChangeProcessor::share_handle() const {
511 DCHECK(CalledOnValidThread()); 511 DCHECK(CalledOnValidThread());
512 return share_handle_; 512 return share_handle_;
513 } 513 }
514 514
515 } // namespace browser_sync 515 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/bookmark_change_processor.cc ('k') | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698