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

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

Issue 642023004: Standardize usage of virtual/override/final in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « sync/test/engine/fake_sync_scheduler.h ('k') | sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_ 5 #ifndef SYNC_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_
6 #define SYNC_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_ 6 #define SYNC_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_
7 7
8 #include "sync/internal_api/public/base/model_type.h" 8 #include "sync/internal_api/public/base/model_type.h"
9 #include "sync/internal_api/public/non_blocking_sync_common.h" 9 #include "sync/internal_api/public/non_blocking_sync_common.h"
10 #include "sync/internal_api/public/sync_context_proxy.h" 10 #include "sync/internal_api/public/sync_context_proxy.h"
11 11
12 namespace syncer { 12 namespace syncer {
13 13
14 struct DataTypeState; 14 struct DataTypeState;
15 class ModelTypeSyncProxyImpl; 15 class ModelTypeSyncProxyImpl;
16 class ModelTypeSyncWorker; 16 class ModelTypeSyncWorker;
17 17
18 // A SyncContextProxy implementation that, when a connection request is made, 18 // A SyncContextProxy implementation that, when a connection request is made,
19 // initalizes a connection to a previously injected ModelTypeSyncProxyImpl. 19 // initalizes a connection to a previously injected ModelTypeSyncProxyImpl.
20 class InjectableSyncContextProxy : public syncer::SyncContextProxy { 20 class InjectableSyncContextProxy : public syncer::SyncContextProxy {
21 public: 21 public:
22 explicit InjectableSyncContextProxy(ModelTypeSyncWorker* worker); 22 explicit InjectableSyncContextProxy(ModelTypeSyncWorker* worker);
23 virtual ~InjectableSyncContextProxy(); 23 ~InjectableSyncContextProxy() override;
24 24
25 virtual void ConnectTypeToSync( 25 void ConnectTypeToSync(syncer::ModelType type,
26 syncer::ModelType type, 26 const DataTypeState& data_type_state,
27 const DataTypeState& data_type_state, 27 const UpdateResponseDataList& pending_updates,
28 const UpdateResponseDataList& pending_updates, 28 const base::WeakPtr<syncer::ModelTypeSyncProxyImpl>&
29 const base::WeakPtr<syncer::ModelTypeSyncProxyImpl>& type_sync_proxy) 29 type_sync_proxy) override;
30 override; 30 void Disconnect(syncer::ModelType type) override;
31 virtual void Disconnect(syncer::ModelType type) override; 31 scoped_ptr<SyncContextProxy> Clone() const override;
32 virtual scoped_ptr<SyncContextProxy> Clone() const override;
33 32
34 ModelTypeSyncWorker* GetWorker(); 33 ModelTypeSyncWorker* GetWorker();
35 34
36 private: 35 private:
37 // A flag to ensure ConnectTypeToSync is called at most once. 36 // A flag to ensure ConnectTypeToSync is called at most once.
38 bool is_worker_connected_; 37 bool is_worker_connected_;
39 38
40 // The ModelTypeSyncProxy's contract expects that it gets to own this object, 39 // The ModelTypeSyncProxy's contract expects that it gets to own this object,
41 // so we can retain only a non-owned pointer to it. 40 // so we can retain only a non-owned pointer to it.
42 // 41 //
43 // This is very unsafe, but we can get away with it since these tests are not 42 // This is very unsafe, but we can get away with it since these tests are not
44 // exercising the proxy <-> worker connection code. 43 // exercising the proxy <-> worker connection code.
45 ModelTypeSyncWorker* worker_; 44 ModelTypeSyncWorker* worker_;
46 }; 45 };
47 46
48 } // namespace syncer 47 } // namespace syncer
49 48
50 #endif // SYNC_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_ 49 #endif // SYNC_TEST_ENGINE_INJECTABLE_SYNC_CONTEXT_PROXY_H_
OLDNEW
« no previous file with comments | « sync/test/engine/fake_sync_scheduler.h ('k') | sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698