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

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

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 years, 5 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/model_association_manager.h" 5 #include "chrome/browser/sync/glue/model_association_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 << " in disabled state."; 304 << " in disabled state.";
305 } 305 }
306 } 306 }
307 } 307 }
308 return found_any; 308 return found_any;
309 } 309 }
310 310
311 void ModelAssociationManager::AppendToFailedDatatypesAndLogError( 311 void ModelAssociationManager::AppendToFailedDatatypesAndLogError(
312 DataTypeController::StartResult result, 312 DataTypeController::StartResult result,
313 const syncer::SyncError& error) { 313 const syncer::SyncError& error) {
314 failed_data_types_info_[error.type()] = error; 314 failed_data_types_info_[error.model_type()] = error;
315 LOG(ERROR) << "Failed to associate models for " 315 LOG(ERROR) << "Failed to associate models for "
316 << syncer::ModelTypeToString(error.type()); 316 << syncer::ModelTypeToString(error.model_type());
317 UMA_HISTOGRAM_ENUMERATION("Sync.ConfigureFailed", 317 UMA_HISTOGRAM_ENUMERATION("Sync.ConfigureFailed",
318 ModelTypeToHistogramInt(error.type()), 318 ModelTypeToHistogramInt(error.model_type()),
319 syncer::MODEL_TYPE_COUNT); 319 syncer::MODEL_TYPE_COUNT);
320 } 320 }
321 321
322 void ModelAssociationManager::TypeStartCallback( 322 void ModelAssociationManager::TypeStartCallback(
323 DataTypeController::StartResult start_result, 323 DataTypeController::StartResult start_result,
324 const syncer::SyncMergeResult& local_merge_result, 324 const syncer::SyncMergeResult& local_merge_result,
325 const syncer::SyncMergeResult& syncer_merge_result) { 325 const syncer::SyncMergeResult& syncer_merge_result) {
326 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 326 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
327 TRACE_EVENT_END0("sync", "ModelAssociation"); 327 TRACE_EVENT_END0("sync", "ModelAssociation");
328 328
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 379
380 DVLOG(1) << "ModelAssociationManager: type start callback returned " 380 DVLOG(1) << "ModelAssociationManager: type start callback returned "
381 << start_result << " so calling LoadModelForNextType"; 381 << start_result << " so calling LoadModelForNextType";
382 LoadModelForNextType(); 382 LoadModelForNextType();
383 return; 383 return;
384 } 384 }
385 385
386 // Any other result requires reconfiguration. Pass it on through the callback. 386 // Any other result requires reconfiguration. Pass it on through the callback.
387 LOG(ERROR) << "Failed to configure " << started_dtc->name(); 387 LOG(ERROR) << "Failed to configure " << started_dtc->name();
388 DCHECK(local_merge_result.error().IsSet()); 388 DCHECK(local_merge_result.error().IsSet());
389 DCHECK_EQ(started_dtc->type(), local_merge_result.error().type()); 389 DCHECK_EQ(started_dtc->type(), local_merge_result.error().model_type());
390 DataTypeManager::ConfigureStatus configure_status = 390 DataTypeManager::ConfigureStatus configure_status =
391 DataTypeManager::ABORTED; 391 DataTypeManager::ABORTED;
392 switch (start_result) { 392 switch (start_result) {
393 case DataTypeController::ABORTED: 393 case DataTypeController::ABORTED:
394 configure_status = DataTypeManager::ABORTED; 394 configure_status = DataTypeManager::ABORTED;
395 break; 395 break;
396 case DataTypeController::UNRECOVERABLE_ERROR: 396 case DataTypeController::UNRECOVERABLE_ERROR:
397 configure_status = DataTypeManager::UNRECOVERABLE_ERROR; 397 configure_status = DataTypeManager::UNRECOVERABLE_ERROR;
398 break; 398 break;
399 default: 399 default:
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 return result; 561 return result;
562 } 562 }
563 563
564 base::OneShotTimer<ModelAssociationManager>* 564 base::OneShotTimer<ModelAssociationManager>*
565 ModelAssociationManager::GetTimerForTesting() { 565 ModelAssociationManager::GetTimerForTesting() {
566 return &timer_; 566 return &timer_;
567 } 567 }
568 568
569 } // namespace browser_sync 569 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/generic_change_processor.cc ('k') | chrome/browser/sync/glue/model_association_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698