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

Side by Side Diff: sync/internal_api/sync_rollback_manager.cc

Issue 455023003: Let SyncBackupManager keep backup data in memory until shutdown. Only persist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 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 "sync/internal_api/sync_rollback_manager.h" 5 #include "sync/internal_api/sync_rollback_manager.h"
6 6
7 #include "sync/internal_api/public/base/model_type.h" 7 #include "sync/internal_api/public/base/model_type.h"
8 #include "sync/internal_api/public/read_node.h" 8 #include "sync/internal_api/public/read_node.h"
9 #include "sync/internal_api/public/read_transaction.h" 9 #include "sync/internal_api/public/read_transaction.h"
10 #include "sync/internal_api/public/util/syncer_error.h" 10 #include "sync/internal_api/public/util/syncer_error.h"
(...skipping 24 matching lines...) Expand all
35 const std::string& restored_key_for_bootstrapping, 35 const std::string& restored_key_for_bootstrapping,
36 const std::string& restored_keystore_key_for_bootstrapping, 36 const std::string& restored_keystore_key_for_bootstrapping,
37 InternalComponentsFactory* internal_components_factory, 37 InternalComponentsFactory* internal_components_factory,
38 Encryptor* encryptor, 38 Encryptor* encryptor,
39 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, 39 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler,
40 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, 40 ReportUnrecoverableErrorFunction report_unrecoverable_error_function,
41 CancelationSignal* cancelation_signal) { 41 CancelationSignal* cancelation_signal) {
42 if (SyncRollbackManagerBase::InitInternal( 42 if (SyncRollbackManagerBase::InitInternal(
43 database_location, 43 database_location,
44 internal_components_factory, 44 internal_components_factory,
45 InternalComponentsFactory::STORAGE_ON_DISK,
45 unrecoverable_error_handler.Pass(), 46 unrecoverable_error_handler.Pass(),
46 report_unrecoverable_error_function)) { 47 report_unrecoverable_error_function)) {
47 change_delegate_ = change_delegate; 48 change_delegate_ = change_delegate;
48 49
49 for (size_t i = 0; i < workers.size(); ++i) { 50 for (size_t i = 0; i < workers.size(); ++i) {
50 ModelSafeGroup group = workers[i]->GetModelSafeGroup(); 51 ModelSafeGroup group = workers[i]->GetModelSafeGroup();
51 CHECK(workers_.find(group) == workers_.end()); 52 CHECK(workers_.find(group) == workers_.end());
52 workers_[group] = workers[i]; 53 workers_[group] = workers[i];
53 } 54 }
54 55
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 130 }
130 131
131 void SyncRollbackManager::NotifyRollbackDone() { 132 void SyncRollbackManager::NotifyRollbackDone() {
132 SyncProtocolError error; 133 SyncProtocolError error;
133 error.action = ROLLBACK_DONE; 134 error.action = ROLLBACK_DONE;
134 FOR_EACH_OBSERVER(SyncManager::Observer, *GetObservers(), 135 FOR_EACH_OBSERVER(SyncManager::Observer, *GetObservers(),
135 OnActionableError(error)); 136 OnActionableError(error));
136 } 137 }
137 138
138 } // namespace syncer 139 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698