OLD | NEW |
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 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "sync/internal_api/public/base/model_type.h" | 9 #include "sync/internal_api/public/base/model_type.h" |
10 #include "sync/internal_api/public/non_blocking_sync_common.h" | |
11 | 10 |
12 namespace syncer_v2 { | 11 namespace syncer_v2 { |
13 class ModelTypeProcessor; | 12 struct ActivationContext; |
14 | 13 |
15 // Interface for the datatype integration logic from non-sync threads. | 14 // Interface for the datatype integration logic from non-sync threads. |
16 // | 15 // |
17 // See SyncContextProxyImpl for an actual implementation. | 16 // See SyncContextProxyImpl for an actual implementation. |
18 class SYNC_EXPORT_PRIVATE SyncContextProxy { | 17 class SYNC_EXPORT_PRIVATE SyncContextProxy { |
19 public: | 18 public: |
20 SyncContextProxy(); | 19 SyncContextProxy(); |
21 virtual ~SyncContextProxy(); | 20 virtual ~SyncContextProxy(); |
22 | 21 |
23 // Attempts to connect a non-blocking type to the sync context. | 22 // Attempts to connect a non-blocking type to the sync context. |
24 // | |
25 // Must be called from the thread where the data type lives. | |
26 virtual void ConnectTypeToSync( | 23 virtual void ConnectTypeToSync( |
27 syncer::ModelType type, | 24 syncer::ModelType type, |
28 const DataTypeState& data_type_state, | 25 scoped_ptr<ActivationContext> activation_context) = 0; |
29 const UpdateResponseDataList& saved_pending_updates, | |
30 const base::WeakPtr<ModelTypeProcessor>& type_processor) = 0; | |
31 | 26 |
32 // Tells the syncer that we're no longer interested in syncing this type. | 27 // Tells the syncer that we're no longer interested in syncing this type. |
33 // | 28 // |
34 // Once this takes effect, the syncer can assume that it will no longer | 29 // Once this takes effect, the syncer can assume that it will no longer |
35 // receive commit requests for this type. It should also stop requesting | 30 // receive commit requests for this type. It should also stop requesting |
36 // and applying updates for this type, too. | 31 // and applying updates for this type, too. |
37 virtual void Disconnect(syncer::ModelType type) = 0; | 32 virtual void Disconnect(syncer::ModelType type) = 0; |
38 | 33 |
39 // Creates a clone of this SyncContextProxy. | 34 // Creates a clone of this SyncContextProxy. |
40 virtual scoped_ptr<SyncContextProxy> Clone() const = 0; | 35 virtual scoped_ptr<SyncContextProxy> Clone() const = 0; |
41 }; | 36 }; |
42 | 37 |
43 } // namespace syncer | 38 } // namespace syncer |
44 | 39 |
45 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ | 40 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_CONTEXT_PROXY_H_ |
OLD | NEW |