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

Side by Side Diff: sync/internal_api/model_type_connector_proxy.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
(Empty)
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.
4
5 #ifndef SYNC_INTERNAL_API_MODEL_TYPE_CONNECTOR_PROXY_H_
6 #define SYNC_INTERNAL_API_MODEL_TYPE_CONNECTOR_PROXY_H_
7
8 #include <memory>
9
10 #include "base/memory/weak_ptr.h"
11 #include "base/sequenced_task_runner.h"
12 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h"
14 #include "sync/internal_api/public/model_type_connector.h"
15
16 namespace syncer_v2 {
17
18 // Proxies all ModelTypeConnector calls to another thread. Typically used by
19 // the SyncBackend to call from the UI thread to the real ModelTypeConnector on
20 // the sync thread.
21 class SYNC_EXPORT ModelTypeConnectorProxy : public ModelTypeConnector {
22 public:
23 ModelTypeConnectorProxy(
24 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
25 const base::WeakPtr<ModelTypeConnector>& model_type_connector);
26 ~ModelTypeConnectorProxy() override;
27
28 // ModelTypeConnector implementation
29 void ConnectType(
30 syncer::ModelType type,
31 std::unique_ptr<ActivationContext> activation_context) override;
32 void DisconnectType(syncer::ModelType type) override;
33
34 private:
35 // A SequencedTaskRunner representing the thread where the ModelTypeConnector
36 // lives.
37 scoped_refptr<base::SequencedTaskRunner> task_runner_;
38
39 // The ModelTypeConnector this object is wrapping.
40 base::WeakPtr<ModelTypeConnector> model_type_connector_;
41 };
42
43 } // namespace syncer_v2
44
45 #endif // SYNC_INTERNAL_API_MODEL_TYPE_CONNECTOR_PROXY_H_
OLDNEW
« no previous file with comments | « sync/internal_api/model_type_connector.cc ('k') | sync/internal_api/model_type_connector_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698