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

Side by Side Diff: chrome/browser/sync/api/fake_syncable_service.h

Issue 9749012: [Sync] Have SyncableService's take ownership of their SyncChangeProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict Created 8 years, 9 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/api/syncable_service.h" 9 #include "chrome/browser/sync/api/syncable_service.h"
10 10
11 // A fake SyncableService that can return arbitrary values and maintains the 11 // A fake SyncableService that can return arbitrary values and maintains the
12 // syncing status. 12 // syncing status.
13 class FakeSyncableService : public SyncableService { 13 class FakeSyncableService : public SyncableService {
14 public: 14 public:
15 FakeSyncableService(); 15 FakeSyncableService();
16 virtual ~FakeSyncableService(); 16 virtual ~FakeSyncableService();
17 17
18 // Setters for SyncableService implementation results. 18 // Setters for SyncableService implementation results.
19 void set_merge_data_and_start_syncing_error(const SyncError& error); 19 void set_merge_data_and_start_syncing_error(const SyncError& error);
20 void set_process_sync_changes_error(const SyncError& error); 20 void set_process_sync_changes_error(const SyncError& error);
21 21
22 // Whether we're syncing or not. Set on a successful MergeDataAndStartSyncing, 22 // Whether we're syncing or not. Set on a successful MergeDataAndStartSyncing,
23 // unset on StopSyncing. False by default. 23 // unset on StopSyncing. False by default.
24 bool syncing() const; 24 bool syncing() const;
25 25
26 // SyncableService implementation. 26 // SyncableService implementation.
27 virtual SyncError MergeDataAndStartSyncing( 27 virtual SyncError MergeDataAndStartSyncing(
28 syncable::ModelType type, 28 syncable::ModelType type,
29 const SyncDataList& initial_sync_data, 29 const SyncDataList& initial_sync_data,
30 SyncChangeProcessor* sync_processor) OVERRIDE; 30 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE;
31 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; 31 virtual void StopSyncing(syncable::ModelType type) OVERRIDE;
32 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; 32 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE;
33 virtual SyncError ProcessSyncChanges( 33 virtual SyncError ProcessSyncChanges(
34 const tracked_objects::Location& from_here, 34 const tracked_objects::Location& from_here,
35 const SyncChangeList& change_list) OVERRIDE; 35 const SyncChangeList& change_list) OVERRIDE;
36 36
37 private: 37 private:
38 scoped_ptr<SyncChangeProcessor> sync_processor_; 38 scoped_ptr<SyncChangeProcessor> sync_processor_;
39 SyncError merge_data_and_start_syncing_error_; 39 SyncError merge_data_and_start_syncing_error_;
40 SyncError process_sync_changes_error_; 40 SyncError process_sync_changes_error_;
41 bool syncing_; 41 bool syncing_;
42 syncable::ModelType type_; 42 syncable::ModelType type_;
43 }; 43 };
44 44
45 #endif // CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_ 45 #endif // CHROME_BROWSER_SYNC_API_FAKE_SYNCABLE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_service_test_util.cc ('k') | chrome/browser/sync/api/fake_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698