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

Side by Side Diff: sync/api/model_type_service.h

Issue 1458013003: [Sync] USS: Add EntityChange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uss-data
Patch Set: s/client_tag/client_key/ etc Created 5 years, 1 month 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/api/entity_change.cc ('k') | sync/sync.gyp » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_API_MODEL_TYPE_SERVICE_H_ 5 #ifndef SYNC_API_MODEL_TYPE_SERVICE_H_
6 #define SYNC_API_MODEL_TYPE_SERVICE_H_ 6 #define SYNC_API_MODEL_TYPE_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "sync/api/entity_change.h"
13 #include "sync/api/entity_data.h" 14 #include "sync/api/entity_data.h"
14 #include "sync/api/model_type_change_processor.h" 15 #include "sync/api/model_type_change_processor.h"
15 #include "sync/base/sync_export.h" 16 #include "sync/base/sync_export.h"
16 17
17 namespace syncer { 18 namespace syncer {
18 class SyncError; 19 class SyncError;
19 } // namespace syncer 20 } // namespace syncer
20 21
21 namespace syncer_v2 { 22 namespace syncer_v2 {
22 23
(...skipping 19 matching lines...) Expand all
42 // Creates an object used to communicate changes in the sync metadata to the 43 // Creates an object used to communicate changes in the sync metadata to the
43 // model type store. 44 // model type store.
44 virtual MetadataChanges* CreateMetadataChanges() = 0; 45 virtual MetadataChanges* CreateMetadataChanges() = 0;
45 46
46 // Perform the initial merge of data from the sync server. Should only need 47 // Perform the initial merge of data from the sync server. Should only need
47 // to be called when sync is first turned on, not on every restart. 48 // to be called when sync is first turned on, not on every restart.
48 virtual syncer::SyncError MergeSyncData(MetadataChanges* metadata_changes, 49 virtual syncer::SyncError MergeSyncData(MetadataChanges* metadata_changes,
49 EntityDataList entity_data_list) = 0; 50 EntityDataList entity_data_list) = 0;
50 51
51 // Apply changes from the sync server locally. 52 // Apply changes from the sync server locally.
52 // TODO(skym): The change type should be in here somehow.
53 virtual syncer::SyncError ApplySyncChanges( 53 virtual syncer::SyncError ApplySyncChanges(
54 MetadataChanges* metadata_changes, 54 MetadataChanges* metadata_changes,
55 EntityDataList entity_data_list) = 0; 55 EntityChangeList entity_changes) = 0;
56 56
57 // Asynchronously retrieve the sync metadata. 57 // Asynchronously retrieve the sync metadata.
58 virtual void LoadMetadata(MetadataCallback callback) = 0; 58 virtual void LoadMetadata(MetadataCallback callback) = 0;
59 59
60 // Asynchronously retrieve the corresponding sync data for |client_keys|. 60 // Asynchronously retrieve the corresponding sync data for |client_keys|.
61 virtual void GetData(ClientKeyList client_keys, DataCallback callback) = 0; 61 virtual void GetData(ClientKeyList client_keys, DataCallback callback) = 0;
62 62
63 // Asynchronously retrieve all of the local sync data. 63 // Asynchronously retrieve all of the local sync data.
64 virtual void GetAllData(DataCallback callback) = 0; 64 virtual void GetAllData(DataCallback callback) = 0;
65 65
66 // Get or generate a client tag for |entity_data|. 66 // Get or generate a client tag for |entity_data|.
67 virtual std::string GetClientTag(const EntityData* entity_data) = 0; 67 virtual std::string GetClientTag(const EntityData* entity_data) = 0;
68 68
69 // TODO(skym): See crbug/547087, do we need all these accessors? 69 // TODO(skym): See crbug/547087, do we need all these accessors?
70 syncer_v2::ModelTypeChangeProcessor* change_processor(); 70 syncer_v2::ModelTypeChangeProcessor* change_processor();
71 71
72 void set_change_processor( 72 void set_change_processor(
73 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor); 73 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor);
74 74
75 void clear_change_processor(); 75 void clear_change_processor();
76 76
77 private: 77 private:
78 // Recieves ownership in set_change_processor(...). 78 // Recieves ownership in set_change_processor(...).
79 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor_; 79 scoped_ptr<syncer_v2::ModelTypeChangeProcessor> change_processor_;
80 }; 80 };
81 81
82 } // namespace syncer_v2 82 } // namespace syncer_v2
83 83
84 #endif // SYNC_API_MODEL_TYPE_SERVICE_H_ 84 #endif // SYNC_API_MODEL_TYPE_SERVICE_H_
OLDNEW
« no previous file with comments | « sync/api/entity_change.cc ('k') | sync/sync.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698