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