Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / sync / api / fake_sync_change_processor.h
blob498aef82c650f771e52ffb3c5da255bf80e2c728
1 // Copyright 2013 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.
5 #ifndef SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_
6 #define SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_
8 #include "sync/api/sync_change_processor.h"
10 namespace syncer {
12 class FakeSyncChangeProcessor : public SyncChangeProcessor {
13 public:
14 FakeSyncChangeProcessor();
15 virtual ~FakeSyncChangeProcessor();
17 // SyncChangeProcessor implementation.
19 // ProcessSyncChanges will accumulate changes in changes() until they are
20 // cleared.
21 virtual syncer::SyncError ProcessSyncChanges(
22 const tracked_objects::Location& from_here,
23 const syncer::SyncChangeList& change_list) override;
25 // SyncChangeProcessor implementation.
27 // Returns data().
28 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type)
29 const override;
31 // SyncChangeProcessor implementation.
33 // Updates context().
34 virtual syncer::SyncError UpdateDataTypeContext(
35 ModelType type,
36 ContextRefreshStatus refresh_status,
37 const std::string& context) override;
39 virtual const syncer::SyncChangeList& changes() const;
40 virtual syncer::SyncChangeList& changes();
42 virtual const syncer::SyncDataList& data() const;
43 virtual syncer::SyncDataList& data();
45 virtual const std::string& context() const;
46 virtual std::string& context();
48 private:
49 syncer::SyncChangeList changes_;
50 syncer::SyncDataList data_;
51 std::string context_;
53 DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor);
56 } // namespace syncer
58 #endif // SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_