OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync_backend_host_core.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_core.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/sync/glue/device_info.h" | 9 #include "chrome/browser/sync/glue/device_info.h" |
10 #include "chrome/browser/sync/glue/invalidation_adapter.h" | 10 #include "chrome/browser/sync/glue/invalidation_adapter.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 host_.Call( | 359 host_.Call( |
360 FROM_HERE, | 360 FROM_HERE, |
361 &SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop, | 361 &SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop, |
362 event_clone.release()); | 362 event_clone.release()); |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
366 void SyncBackendHostCore::DoOnInvalidatorStateChange( | 366 void SyncBackendHostCore::DoOnInvalidatorStateChange( |
367 syncer::InvalidatorState state) { | 367 syncer::InvalidatorState state) { |
368 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 368 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
369 sync_manager_->OnInvalidatorStateChange(state); | 369 sync_manager_->SetInvalidatorEnabled(state == syncer::INVALIDATIONS_ENABLED); |
370 } | 370 } |
371 | 371 |
372 void SyncBackendHostCore::DoOnIncomingInvalidation( | 372 void SyncBackendHostCore::DoOnIncomingInvalidation( |
373 const syncer::ObjectIdInvalidationMap& invalidation_map) { | 373 const syncer::ObjectIdInvalidationMap& invalidation_map) { |
374 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 374 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
375 | 375 |
376 syncer::ObjectIdSet ids = invalidation_map.GetObjectIds(); | 376 syncer::ObjectIdSet ids = invalidation_map.GetObjectIds(); |
377 for (syncer::ObjectIdSet::const_iterator ids_it = ids.begin(); | 377 for (syncer::ObjectIdSet::const_iterator ids_it = ids.begin(); |
378 ids_it != ids.end(); | 378 ids_it != ids.end(); |
379 ++ids_it) { | 379 ++ids_it) { |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 this, &SyncBackendHostCore::SaveChanges); | 741 this, &SyncBackendHostCore::SaveChanges); |
742 } | 742 } |
743 | 743 |
744 void SyncBackendHostCore::SaveChanges() { | 744 void SyncBackendHostCore::SaveChanges() { |
745 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); | 745 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); |
746 sync_manager_->SaveChanges(); | 746 sync_manager_->SaveChanges(); |
747 } | 747 } |
748 | 748 |
749 } // namespace browser_sync | 749 } // namespace browser_sync |
750 | 750 |
OLD | NEW |