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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.h

Issue 98043004: [SyncFS] Run ConflictResolver only when it is needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test expectation Created 7 years 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 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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const SyncStatusCallback& callback); 138 const SyncStatusCallback& callback);
139 139
140 void DidInitialize(SyncEngineInitializer* initializer, 140 void DidInitialize(SyncEngineInitializer* initializer,
141 SyncStatusCode status); 141 SyncStatusCode status);
142 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer, 142 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer,
143 const SyncFileCallback& callback, 143 const SyncFileCallback& callback,
144 SyncStatusCode status); 144 SyncStatusCode status);
145 void DidApplyLocalChange(LocalToRemoteSyncer* syncer, 145 void DidApplyLocalChange(LocalToRemoteSyncer* syncer,
146 const SyncStatusCallback& callback, 146 const SyncStatusCallback& callback,
147 SyncStatusCode status); 147 SyncStatusCode status);
148 void DidFetchChangeList(SyncStatusCallback& callback);
149 148
150 void MaybeStartFetchChanges(); 149 void MaybeStartFetchChanges();
150 void DidResolveConflict(SyncStatusCode status);
151 void DidFetchChanges(SyncStatusCode status);
152
151 void UpdateServiceStateFromSyncStatusCode(SyncStatusCode state, 153 void UpdateServiceStateFromSyncStatusCode(SyncStatusCode state,
152 bool used_network); 154 bool used_network);
153 void UpdateServiceState(RemoteServiceState state, 155 void UpdateServiceState(RemoteServiceState state,
154 const std::string& description); 156 const std::string& description);
155 void UpdateRegisteredApps(); 157 void UpdateRegisteredApps();
156 158
157 base::FilePath base_dir_; 159 base::FilePath base_dir_;
158 base::FilePath temporary_file_dir_; 160 base::FilePath temporary_file_dir_;
159 161
160 scoped_refptr<base::SequencedTaskRunner> task_runner_; 162 scoped_refptr<base::SequencedTaskRunner> task_runner_;
161 163
162 scoped_ptr<drive::DriveServiceInterface> drive_service_; 164 scoped_ptr<drive::DriveServiceInterface> drive_service_;
163 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_; 165 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_;
164 scoped_ptr<MetadataDatabase> metadata_database_; 166 scoped_ptr<MetadataDatabase> metadata_database_;
165 167
166 // These external services are not owned by SyncEngine. 168 // These external services are not owned by SyncEngine.
167 // The owner of the SyncEngine is responsible for their lifetime. 169 // The owner of the SyncEngine is responsible for their lifetime.
168 // I.e. the owner should declare the dependency explicitly by calling 170 // I.e. the owner should declare the dependency explicitly by calling
169 // BrowserContextKeyedService::DependsOn(). 171 // BrowserContextKeyedService::DependsOn().
170 drive::DriveNotificationManager* notification_manager_; 172 drive::DriveNotificationManager* notification_manager_;
171 ExtensionServiceInterface* extension_service_; 173 ExtensionServiceInterface* extension_service_;
172 174
173 ObserverList<SyncServiceObserver> service_observers_; 175 ObserverList<SyncServiceObserver> service_observers_;
174 ObserverList<FileStatusObserver> file_status_observers_; 176 ObserverList<FileStatusObserver> file_status_observers_;
175 RemoteChangeProcessor* remote_change_processor_; 177 RemoteChangeProcessor* remote_change_processor_;
176 178
177 RemoteServiceState service_state_; 179 RemoteServiceState service_state_;
178 180
181 bool should_check_conflict_;
179 bool should_check_remote_change_; 182 bool should_check_remote_change_;
180 base::TimeTicks time_to_check_changes_; 183 base::TimeTicks time_to_check_changes_;
181 184
182 bool sync_enabled_; 185 bool sync_enabled_;
183 ConflictResolutionPolicy conflict_resolution_policy_; 186 ConflictResolutionPolicy conflict_resolution_policy_;
184 bool network_available_; 187 bool network_available_;
185 188
186 scoped_ptr<SyncTaskManager> task_manager_; 189 scoped_ptr<SyncTaskManager> task_manager_;
187 190
188 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; 191 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_;
189 192
190 DISALLOW_COPY_AND_ASSIGN(SyncEngine); 193 DISALLOW_COPY_AND_ASSIGN(SyncEngine);
191 }; 194 };
192 195
193 } // namespace drive_backend 196 } // namespace drive_backend
194 } // namespace sync_file_system 197 } // namespace sync_file_system
195 198
196 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 199 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698