Add ICU message format support
[chromium-blink-merge.git] / sync / internal_api / public / sync_context.h
blob98740e19b9dc88310c5a43345e204526747d02a2
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
3 // found in the LICENSE file.
5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_H_
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_H_
8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/sequenced_task_runner.h"
11 #include "sync/base/sync_export.h"
12 #include "sync/internal_api/public/base/model_type.h"
13 #include "sync/internal_api/public/non_blocking_sync_common.h"
15 namespace syncer {
16 class ModelTypeSyncProxyImpl;
19 namespace syncer_v2 {
20 // An interface of the core parts of sync.
22 // In theory, this is the component that provides off-thread sync types with
23 // functionality to schedule and execute communication with the sync server. In
24 // practice, this class delegates most of the responsibilty of implemeting this
25 // functionality to other classes, and most of the interface is exposed not
26 // directly here but instead through a per-ModelType class that this class helps
27 // instantiate.
28 class SYNC_EXPORT_PRIVATE SyncContext {
29 public:
30 SyncContext();
31 virtual ~SyncContext();
33 // Initializes the connection between the sync context on the sync thread and
34 // a proxy for the specified non-blocking sync type that lives on the data
35 // type's thread.
36 virtual void ConnectSyncTypeToWorker(
37 syncer::ModelType type,
38 const DataTypeState& data_type_state,
39 const UpdateResponseDataList& saved_pending_updates,
40 const scoped_refptr<base::SequencedTaskRunner>& datatype_task_runner,
41 const base::WeakPtr<syncer::ModelTypeSyncProxyImpl>& type_sync_proxy) = 0;
43 // Disconnects the syncer from the model and stops syncing the type.
45 // By the time this is called, the model thread should have already
46 // invalidated the WeakPtr it sent to us in the connect request. Any
47 // messages sent to that ModelTypeSyncProxy will not be recived.
49 // This is the sync thread's chance to clear state associated with the type.
50 // It also causes the syncer to stop requesting updates for this type, and to
51 // abort any in-progress commit requests.
52 virtual void DisconnectSyncWorker(syncer::ModelType type) = 0;
55 } // namespace syncer
57 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_H_