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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_core.cc

Issue 2258873003: [Sync] Move sessions/ to engine/cycle/ and rename things to match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 4 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
OLDNEW
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 "components/sync/driver/glue/sync_backend_host_core.h" 5 #include "components/sync/driver/glue/sync_backend_host_core.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "components/data_use_measurement/core/data_use_user_data.h" 13 #include "components/data_use_measurement/core/data_use_user_data.h"
14 #include "components/invalidation/public/invalidation_util.h" 14 #include "components/invalidation/public/invalidation_util.h"
15 #include "components/invalidation/public/object_id_invalidation_map.h" 15 #include "components/invalidation/public/object_id_invalidation_map.h"
16 #include "components/sync/core/http_post_provider_factory.h" 16 #include "components/sync/core/http_post_provider_factory.h"
17 #include "components/sync/core/internal_components_factory.h" 17 #include "components/sync/core/internal_components_factory.h"
18 #include "components/sync/core/sync_manager.h" 18 #include "components/sync/core/sync_manager.h"
19 #include "components/sync/core/sync_manager_factory.h" 19 #include "components/sync/core/sync_manager_factory.h"
20 #include "components/sync/device_info/local_device_info_provider_impl.h" 20 #include "components/sync/device_info/local_device_info_provider_impl.h"
21 #include "components/sync/driver/glue/sync_backend_registrar.h" 21 #include "components/sync/driver/glue/sync_backend_registrar.h"
22 #include "components/sync/driver/invalidation_adapter.h" 22 #include "components/sync/driver/invalidation_adapter.h"
23 #include "components/sync/engine/cycle/commit_counters.h"
24 #include "components/sync/engine/cycle/status_counters.h"
25 #include "components/sync/engine/cycle/sync_cycle_snapshot.h"
26 #include "components/sync/engine/cycle/update_counters.h"
23 #include "components/sync/engine/events/protocol_event.h" 27 #include "components/sync/engine/events/protocol_event.h"
24 #include "components/sync/sessions/commit_counters.h"
25 #include "components/sync/sessions/status_counters.h"
26 #include "components/sync/sessions/sync_session_snapshot.h"
27 #include "components/sync/sessions/update_counters.h"
28 #include "url/gurl.h" 28 #include "url/gurl.h"
29 29
30 // Helper macros to log with the syncer thread name; useful when there 30 // Helper macros to log with the syncer thread name; useful when there
31 // are multiple syncers involved. 31 // are multiple syncers involved.
32 32
33 #define SLOG(severity) LOG(severity) << name_ << ": " 33 #define SLOG(severity) LOG(severity) << name_ << ": "
34 34
35 #define SDVLOG(verbose_level) DVLOG(verbose_level) << name_ << ": " 35 #define SDVLOG(verbose_level) DVLOG(verbose_level) << name_ << ": "
36 36
37 static const int kSaveChangesIntervalSeconds = 10; 37 static const int kSaveChangesIntervalSeconds = 10;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 forward_type_info_(false), 123 forward_type_info_(false),
124 weak_ptr_factory_(this) { 124 weak_ptr_factory_(this) {
125 DCHECK(backend.get()); 125 DCHECK(backend.get());
126 } 126 }
127 127
128 SyncBackendHostCore::~SyncBackendHostCore() { 128 SyncBackendHostCore::~SyncBackendHostCore() {
129 DCHECK(!sync_manager_.get()); 129 DCHECK(!sync_manager_.get());
130 } 130 }
131 131
132 void SyncBackendHostCore::OnSyncCycleCompleted( 132 void SyncBackendHostCore::OnSyncCycleCompleted(
133 const syncer::sessions::SyncSessionSnapshot& snapshot) { 133 const syncer::SyncCycleSnapshot& snapshot) {
134 if (!sync_loop_) 134 if (!sync_loop_)
135 return; 135 return;
136 DCHECK(sync_loop_->task_runner()->BelongsToCurrentThread()); 136 DCHECK(sync_loop_->task_runner()->BelongsToCurrentThread());
137 137
138 host_.Call(FROM_HERE, 138 host_.Call(FROM_HERE,
139 &SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop, 139 &SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop,
140 snapshot); 140 snapshot);
141 } 141 }
142 142
143 void SyncBackendHostCore::DoRefreshTypes(syncer::ModelTypeSet types) { 143 void SyncBackendHostCore::DoRefreshTypes(syncer::ModelTypeSet types) {
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 724
725 void SyncBackendHostCore::ClearServerDataDone( 725 void SyncBackendHostCore::ClearServerDataDone(
726 const base::Closure& frontend_callback) { 726 const base::Closure& frontend_callback) {
727 DCHECK(sync_loop_->task_runner()->BelongsToCurrentThread()); 727 DCHECK(sync_loop_->task_runner()->BelongsToCurrentThread());
728 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop, 728 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop,
729 frontend_callback); 729 frontend_callback);
730 } 730 }
731 731
732 } // namespace browser_sync 732 } // namespace browser_sync
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_core.h ('k') | components/sync/driver/glue/sync_backend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698