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

Side by Side Diff: components/sync/engine/sync_manager.h

Issue 2641523004: [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: Address comments Created 3 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_
6 #define COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ 6 #define COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // types are saved into the delete journal, while |to_unapply| have only 297 // types are saved into the delete journal, while |to_unapply| have only
298 // their local data deleted, while their server data is preserved. 298 // their local data deleted, while their server data is preserved.
299 virtual void PurgeDisabledTypes(ModelTypeSet to_purge, 299 virtual void PurgeDisabledTypes(ModelTypeSet to_purge,
300 ModelTypeSet to_journal, 300 ModelTypeSet to_journal,
301 ModelTypeSet to_unapply) = 0; 301 ModelTypeSet to_unapply) = 0;
302 302
303 // Update tokens that we're using in Sync. Email must stay the same. 303 // Update tokens that we're using in Sync. Email must stay the same.
304 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; 304 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0;
305 305
306 // Put the syncer in normal mode ready to perform nudges and polls. 306 // Put the syncer in normal mode ready to perform nudges and polls.
307 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info, 307 virtual void StartSyncingNormally(base::Time last_poll_time) = 0;
308 base::Time last_poll_time) = 0; 308
309 // Put syncer in configuration mode. Only configuration sync cycles are
310 // performed. No local changes are committed to the server.
311 virtual void StartConfiguration() = 0;
309 312
310 // Switches the mode of operation to CONFIGURATION_MODE and performs 313 // Switches the mode of operation to CONFIGURATION_MODE and performs
311 // any configuration tasks needed as determined by the params. Once complete, 314 // any configuration tasks needed as determined by the params. Once complete,
312 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is 315 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is
313 // called. 316 // called.
314 // |ready_task| is invoked when the configuration completes. 317 // |ready_task| is invoked when the configuration completes.
315 // |retry_task| is invoked if the configuration job could not immediately 318 // |retry_task| is invoked if the configuration job could not immediately
316 // execute. |ready_task| will still be called when it eventually 319 // execute. |ready_task| will still be called when it eventually
317 // does finish. 320 // does finish.
318 virtual void ConfigureSyncer(ConfigureReason reason, 321 virtual void ConfigureSyncer(ConfigureReason reason,
319 ModelTypeSet to_download, 322 ModelTypeSet to_download,
320 const ModelSafeRoutingInfo& new_routing_info,
321 const base::Closure& ready_task, 323 const base::Closure& ready_task,
322 const base::Closure& retry_task) = 0; 324 const base::Closure& retry_task) = 0;
323 325
324 // Inform the syncer of a change in the invalidator's state. 326 // Inform the syncer of a change in the invalidator's state.
325 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0; 327 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0;
326 328
327 // Inform the syncer that its cached information about a type is obsolete. 329 // Inform the syncer that its cached information about a type is obsolete.
328 virtual void OnIncomingInvalidation( 330 virtual void OnIncomingInvalidation(
329 ModelType type, 331 ModelType type,
330 std::unique_ptr<InvalidationInterface> invalidation) = 0; 332 std::unique_ptr<InvalidationInterface> invalidation) = 0;
(...skipping 14 matching lines...) Expand all
345 // Call periodically from a database-safe thread to persist recent changes 347 // Call periodically from a database-safe thread to persist recent changes
346 // to the syncapi model. 348 // to the syncapi model.
347 virtual void SaveChanges() = 0; 349 virtual void SaveChanges() = 0;
348 350
349 // Issue a final SaveChanges, and close sqlite handles. 351 // Issue a final SaveChanges, and close sqlite handles.
350 virtual void ShutdownOnSyncThread(ShutdownReason reason) = 0; 352 virtual void ShutdownOnSyncThread(ShutdownReason reason) = 0;
351 353
352 // May be called from any thread. 354 // May be called from any thread.
353 virtual UserShare* GetUserShare() = 0; 355 virtual UserShare* GetUserShare() = 0;
354 356
355 // Returns an instance of the main interface for non-blocking sync types. 357 // Returns non-owning pointer to ModelTypeConnector. In contrast with
358 // ModelTypeConnectorproxy all calls are executed synchronously, thus the
maxbogue 2017/01/19 19:19:55 proxy -> Proxy
pavely 2017/01/19 20:27:39 Done.
359 // pointer should be used on sync thread.
360 virtual ModelTypeConnector* GetModelTypeConnector() = 0;
361
362 // Returns an instance of the main interface for registering sync types with
363 // sync engine.
356 virtual std::unique_ptr<ModelTypeConnector> GetModelTypeConnectorProxy() = 0; 364 virtual std::unique_ptr<ModelTypeConnector> GetModelTypeConnectorProxy() = 0;
357 365
358 // Returns the cache_guid of the currently open database. 366 // Returns the cache_guid of the currently open database.
359 // Requires that the SyncManager be initialized. 367 // Requires that the SyncManager be initialized.
360 virtual const std::string cache_guid() = 0; 368 virtual const std::string cache_guid() = 0;
361 369
362 // Reads the nigori node to determine if any experimental features should 370 // Reads the nigori node to determine if any experimental features should
363 // be enabled. 371 // be enabled.
364 // Note: opens a transaction. May be called on any thread. 372 // Note: opens a transaction. May be called on any thread.
365 virtual bool ReceivedExperiment(Experiments* experiments) = 0; 373 virtual bool ReceivedExperiment(Experiments* experiments) = 0;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 // Note: this does not trigger a sync cycle. It just updates the sync context. 410 // Note: this does not trigger a sync cycle. It just updates the sync context.
403 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; 411 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0;
404 412
405 // Adds memory usage statistics to |pmd| for chrome://tracing. 413 // Adds memory usage statistics to |pmd| for chrome://tracing.
406 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; 414 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0;
407 }; 415 };
408 416
409 } // namespace syncer 417 } // namespace syncer
410 418
411 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ 419 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698