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

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

Issue 7669073: [Sync] Add support for enabling session sync remotely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor + address comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 return; 860 return;
861 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); 861 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_);
862 862
863 host_->last_snapshot_.reset(snapshot); 863 host_->last_snapshot_.reset(snapshot);
864 864
865 const syncable::ModelTypeSet& to_migrate = 865 const syncable::ModelTypeSet& to_migrate =
866 snapshot->syncer_status.types_needing_local_migration; 866 snapshot->syncer_status.types_needing_local_migration;
867 if (!to_migrate.empty()) 867 if (!to_migrate.empty())
868 host_->frontend_->OnMigrationNeededForTypes(to_migrate); 868 host_->frontend_->OnMigrationNeededForTypes(to_migrate);
869 869
870 // Process any changes to the datatypes we're syncing.
871 // TODO(sync): add support for removing types.
872 syncable::ModelTypeSet to_add;
873 if (sync_manager()->ReceivedExperimentalTypes(&to_add) &&
874 host_->initialized()) {
875 host_->frontend_->OnDataTypesChanged(to_add);
876 }
877
870 // If we are waiting for a configuration change, check here to see 878 // If we are waiting for a configuration change, check here to see
871 // if this sync cycle has initialized all of the types we've been 879 // if this sync cycle has initialized all of the types we've been
872 // waiting for. 880 // waiting for.
873 if (host_->pending_download_state_.get()) { 881 if (host_->pending_download_state_.get()) {
874 scoped_ptr<PendingConfigureDataTypesState> state( 882 scoped_ptr<PendingConfigureDataTypesState> state(
875 host_->pending_download_state_.release()); 883 host_->pending_download_state_.release());
876 DCHECK( 884 DCHECK(
877 std::includes(state->types_to_add.begin(), state->types_to_add.end(), 885 std::includes(state->types_to_add.begin(), state->types_to_add.end(),
878 state->added_types.begin(), state->added_types.end())); 886 state->added_types.begin(), state->added_types.end()));
879 syncable::ModelTypeBitSet added_types = 887 syncable::ModelTypeBitSet added_types =
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1069 }
1062 1070
1063 void SyncBackendHost::Core::DeleteSyncDataFolder() { 1071 void SyncBackendHost::Core::DeleteSyncDataFolder() {
1064 if (file_util::DirectoryExists(host_->sync_data_folder_path())) { 1072 if (file_util::DirectoryExists(host_->sync_data_folder_path())) {
1065 if (!file_util::Delete(host_->sync_data_folder_path(), true)) 1073 if (!file_util::Delete(host_->sync_data_folder_path(), true))
1066 LOG(DFATAL) << "Could not delete the Sync Data folder."; 1074 LOG(DFATAL) << "Could not delete the Sync Data folder.";
1067 } 1075 }
1068 } 1076 }
1069 1077
1070 } // namespace browser_sync 1078 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698