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

Side by Side Diff: components/sync_driver/glue/sync_backend_host_core.cc

Issue 1433473007: [NOT FOR REVIEW] Copy of Max's CL with conflicts fixed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pss_strings
Patch Set: Created 5 years, 1 month 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 "chrome/browser/sync/glue/sync_backend_host_core.h" 5 #include "components/sync_driver/glue/sync_backend_host_core.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "components/data_use_measurement/core/data_use_user_data.h" 12 #include "components/data_use_measurement/core/data_use_user_data.h"
13 #include "components/invalidation/public/invalidation_util.h" 13 #include "components/invalidation/public/invalidation_util.h"
14 #include "components/invalidation/public/object_id_invalidation_map.h" 14 #include "components/invalidation/public/object_id_invalidation_map.h"
15 #include "components/sync_driver/glue/sync_backend_registrar.h" 15 #include "components/sync_driver/glue/sync_backend_registrar.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 debug_info_listener_ = debug_info_listener; 187 debug_info_listener_ = debug_info_listener;
188 188
189 // Track whether or not sync DB and preferences were in sync. 189 // Track whether or not sync DB and preferences were in sync.
190 SyncBackendInitState backend_init_state; 190 SyncBackendInitState backend_init_state;
191 if (has_sync_setup_completed_ && !restored_types.Empty()) { 191 if (has_sync_setup_completed_ && !restored_types.Empty()) {
192 backend_init_state = SETUP_COMPLETED_FOUND_RESTORED_TYPES; 192 backend_init_state = SETUP_COMPLETED_FOUND_RESTORED_TYPES;
193 } else if (has_sync_setup_completed_ && restored_types.Empty()) { 193 } else if (has_sync_setup_completed_ && restored_types.Empty()) {
194 backend_init_state = SETUP_COMPLETED_NO_RESTORED_TYPES; 194 backend_init_state = SETUP_COMPLETED_NO_RESTORED_TYPES;
195 } else if (!has_sync_setup_completed_ && restored_types.Empty()) { 195 } else if (!has_sync_setup_completed_ && restored_types.Empty()) {
196 backend_init_state = FIRST_SETUP_NO_RESTORED_TYPES; 196 backend_init_state = FIRST_SETUP_NO_RESTORED_TYPES;
197 } else { // (!has_sync_setup_completed_ && !restored_types.Empty()) 197 } else { // (!has_sync_setup_completed_ && !restored_types.Empty())
198 backend_init_state = FIRST_SETUP_RESTORED_TYPES; 198 backend_init_state = FIRST_SETUP_RESTORED_TYPES;
199 } 199 }
200 200
201 UMA_HISTOGRAM_ENUMERATION("Sync.BackendInitializeRestoreState", 201 UMA_HISTOGRAM_ENUMERATION("Sync.BackendInitializeRestoreState",
202 backend_init_state, 202 backend_init_state,
203 SYNC_BACKEND_INIT_STATE_COUNT); 203 SYNC_BACKEND_INIT_STATE_COUNT);
204 204
205 // Before proceeding any further, we need to download the control types and 205 // Before proceeding any further, we need to download the control types and
206 // purge any partial data (ie. data downloaded for a type that was on its way 206 // purge any partial data (ie. data downloaded for a type that was on its way
207 // to being initially synced, but didn't quite make it.). The following 207 // to being initially synced, but didn't quite make it.). The following
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 782
783 void SyncBackendHostCore::ClearServerDataDone( 783 void SyncBackendHostCore::ClearServerDataDone(
784 const base::Closure& frontend_callback) { 784 const base::Closure& frontend_callback) {
785 DCHECK_EQ(base::MessageLoop::current(), sync_loop_); 785 DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
786 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop, 786 host_.Call(FROM_HERE, &SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop,
787 frontend_callback); 787 frontend_callback);
788 } 788 }
789 789
790 790
791 } // namespace browser_sync 791 } // 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