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

Side by Side Diff: sync/test/engine/injectable_sync_core_proxy.h

Issue 351523003: sync: Mass rename of non-blocking sync classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const ref some smart pointers Created 6 years, 6 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 | Annotate | Revision Log
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_TEST_ENGINE_INJECTABLE_SYNC_CORE_PROXY_H_
6 #define SYNC_TEST_ENGINE_INJECTABLE_SYNC_CORE_PROXY_H_
7
8 #include "sync/internal_api/public/base/model_type.h"
9 #include "sync/internal_api/public/sync_core_proxy.h"
10
11 namespace syncer {
12
13 struct DataTypeState;
14 class NonBlockingTypeProcessor;
15 class NonBlockingTypeProcessorCoreInterface;
16
17 // A SyncCoreProxy implementation that, when a connection request is made,
18 // initalizes a connection to a previously injected NonBlockingTypeProcessor.
19 class InjectableSyncCoreProxy : public syncer::SyncCoreProxy {
20 public:
21 explicit InjectableSyncCoreProxy(NonBlockingTypeProcessorCoreInterface* core);
22 virtual ~InjectableSyncCoreProxy();
23
24 virtual void ConnectTypeToCore(
25 syncer::ModelType type,
26 const DataTypeState& data_type_state,
27 base::WeakPtr<syncer::NonBlockingTypeProcessor> type_processor) OVERRIDE;
28 virtual void Disconnect(syncer::ModelType type) OVERRIDE;
29 virtual scoped_ptr<SyncCoreProxy> Clone() const OVERRIDE;
30
31 NonBlockingTypeProcessorCoreInterface* GetProcessorCore();
32
33 private:
34 // A flag to ensure ConnectTypeToCore is called at most once.
35 bool is_core_connected_;
36
37 // The NonBlockingTypeProcessor's contract expects that it gets to own this
38 // object, so we can retain only a non-owned pointer to it.
39 //
40 // This is very unsafe, but we can get away with it since these tests are not
41 // exercising the processor <-> processor_core connection code.
42 NonBlockingTypeProcessorCoreInterface* processor_core_;
43 };
44
45 } // namespace syncer
46
47 #endif // SYNC_TEST_ENGINE_INJECTABLE_SYNC_CORE_PROXY_H_
OLDNEW
« no previous file with comments | « sync/test/engine/injectable_sync_context_proxy.cc ('k') | sync/test/engine/injectable_sync_core_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698