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

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

Issue 2644373003: Revert of [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: 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
« no previous file with comments | « components/sync/engine/sync_engine.h ('k') | components/sync/engine_impl/cycle/sync_cycle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(base::Time last_poll_time) = 0; 307 virtual void StartSyncingNormally(const ModelSafeRoutingInfo& routing_info,
308 308 base::Time last_poll_time) = 0;
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;
312 309
313 // Switches the mode of operation to CONFIGURATION_MODE and performs 310 // Switches the mode of operation to CONFIGURATION_MODE and performs
314 // any configuration tasks needed as determined by the params. Once complete, 311 // any configuration tasks needed as determined by the params. Once complete,
315 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is 312 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is
316 // called. 313 // called.
317 // |ready_task| is invoked when the configuration completes. 314 // |ready_task| is invoked when the configuration completes.
318 // |retry_task| is invoked if the configuration job could not immediately 315 // |retry_task| is invoked if the configuration job could not immediately
319 // execute. |ready_task| will still be called when it eventually 316 // execute. |ready_task| will still be called when it eventually
320 // does finish. 317 // does finish.
321 virtual void ConfigureSyncer(ConfigureReason reason, 318 virtual void ConfigureSyncer(ConfigureReason reason,
322 ModelTypeSet to_download, 319 ModelTypeSet to_download,
320 const ModelSafeRoutingInfo& new_routing_info,
323 const base::Closure& ready_task, 321 const base::Closure& ready_task,
324 const base::Closure& retry_task) = 0; 322 const base::Closure& retry_task) = 0;
325 323
326 // Inform the syncer of a change in the invalidator's state. 324 // Inform the syncer of a change in the invalidator's state.
327 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0; 325 virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0;
328 326
329 // Inform the syncer that its cached information about a type is obsolete. 327 // Inform the syncer that its cached information about a type is obsolete.
330 virtual void OnIncomingInvalidation( 328 virtual void OnIncomingInvalidation(
331 ModelType type, 329 ModelType type,
332 std::unique_ptr<InvalidationInterface> invalidation) = 0; 330 std::unique_ptr<InvalidationInterface> invalidation) = 0;
(...skipping 14 matching lines...) Expand all
347 // Call periodically from a database-safe thread to persist recent changes 345 // Call periodically from a database-safe thread to persist recent changes
348 // to the syncapi model. 346 // to the syncapi model.
349 virtual void SaveChanges() = 0; 347 virtual void SaveChanges() = 0;
350 348
351 // Issue a final SaveChanges, and close sqlite handles. 349 // Issue a final SaveChanges, and close sqlite handles.
352 virtual void ShutdownOnSyncThread(ShutdownReason reason) = 0; 350 virtual void ShutdownOnSyncThread(ShutdownReason reason) = 0;
353 351
354 // May be called from any thread. 352 // May be called from any thread.
355 virtual UserShare* GetUserShare() = 0; 353 virtual UserShare* GetUserShare() = 0;
356 354
357 // Returns non-owning pointer to ModelTypeConnector. In contrast with 355 // Returns an instance of the main interface for non-blocking sync types.
358 // ModelTypeConnectorProxy all calls are executed synchronously, thus the
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.
364 virtual std::unique_ptr<ModelTypeConnector> GetModelTypeConnectorProxy() = 0; 356 virtual std::unique_ptr<ModelTypeConnector> GetModelTypeConnectorProxy() = 0;
365 357
366 // Returns the cache_guid of the currently open database. 358 // Returns the cache_guid of the currently open database.
367 // Requires that the SyncManager be initialized. 359 // Requires that the SyncManager be initialized.
368 virtual const std::string cache_guid() = 0; 360 virtual const std::string cache_guid() = 0;
369 361
370 // Reads the nigori node to determine if any experimental features should 362 // Reads the nigori node to determine if any experimental features should
371 // be enabled. 363 // be enabled.
372 // Note: opens a transaction. May be called on any thread. 364 // Note: opens a transaction. May be called on any thread.
373 virtual bool ReceivedExperiment(Experiments* experiments) = 0; 365 virtual bool ReceivedExperiment(Experiments* experiments) = 0;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 // Note: this does not trigger a sync cycle. It just updates the sync context. 402 // Note: this does not trigger a sync cycle. It just updates the sync context.
411 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0; 403 virtual void OnCookieJarChanged(bool account_mismatch, bool empty_jar) = 0;
412 404
413 // Adds memory usage statistics to |pmd| for chrome://tracing. 405 // Adds memory usage statistics to |pmd| for chrome://tracing.
414 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0; 406 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) = 0;
415 }; 407 };
416 408
417 } // namespace syncer 409 } // namespace syncer
418 410
419 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_ 411 #endif // COMPONENTS_SYNC_ENGINE_SYNC_MANAGER_H_
OLDNEW
« no previous file with comments | « components/sync/engine/sync_engine.h ('k') | components/sync/engine_impl/cycle/sync_cycle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698