OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync_driver/model_association_manager.h" | 5 #include "components/sync_driver/model_association_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 controllers_->find(type)->second.get(), | 357 controllers_->find(type)->second.get(), |
358 "DataType", | 358 "DataType", |
359 ModelTypeToString(type)); | 359 ModelTypeToString(type)); |
360 | 360 |
361 // Track the merge results if we succeeded or an association failure | 361 // Track the merge results if we succeeded or an association failure |
362 // occurred. | 362 // occurred. |
363 if (syncer::ProtocolTypes().Has(type)) { | 363 if (syncer::ProtocolTypes().Has(type)) { |
364 base::TimeDelta association_wait_time = | 364 base::TimeDelta association_wait_time = |
365 std::max(base::TimeDelta(), type_start_time - association_start_time_); | 365 std::max(base::TimeDelta(), type_start_time - association_start_time_); |
366 base::TimeDelta association_time = | 366 base::TimeDelta association_time = |
367 base::TimeTicks::Now() - type_start_time;; | 367 base::TimeTicks::Now() - type_start_time; |
368 syncer::DataTypeAssociationStats stats = | 368 syncer::DataTypeAssociationStats stats = |
369 BuildAssociationStatsFromMergeResults(local_merge_result, | 369 BuildAssociationStatsFromMergeResults(local_merge_result, |
370 syncer_merge_result, | 370 syncer_merge_result, |
371 association_wait_time, | 371 association_wait_time, |
372 association_time); | 372 association_time); |
373 delegate_->OnSingleDataTypeAssociationDone(type, stats); | 373 delegate_->OnSingleDataTypeAssociationDone(type, stats); |
374 } | 374 } |
375 | 375 |
376 associating_types_.Remove(type); | 376 associating_types_.Remove(type); |
377 | 377 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 state_ = new_state; | 421 state_ = new_state; |
422 | 422 |
423 delegate_->OnModelAssociationDone(result); | 423 delegate_->OnModelAssociationDone(result); |
424 } | 424 } |
425 | 425 |
426 base::OneShotTimer* ModelAssociationManager::GetTimerForTesting() { | 426 base::OneShotTimer* ModelAssociationManager::GetTimerForTesting() { |
427 return &timer_; | 427 return &timer_; |
428 } | 428 } |
429 | 429 |
430 } // namespace sync_driver | 430 } // namespace sync_driver |
OLD | NEW |