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

Unified Diff: sync/engine/model_type_sync_proxy_impl.h

Issue 442053002: sync: Add non-blocking type encryption (retry) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/model_type_sync_proxy.h ('k') | sync/engine/model_type_sync_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/model_type_sync_proxy_impl.h
diff --git a/sync/engine/model_type_sync_proxy_impl.h b/sync/engine/model_type_sync_proxy_impl.h
index 2390eda072e0b8840604c118101b5af0d03b56dc..f160669f19faddf067dd757797d95d5c3b6a45c7 100644
--- a/sync/engine/model_type_sync_proxy_impl.h
+++ b/sync/engine/model_type_sync_proxy_impl.h
@@ -73,7 +73,16 @@ class SYNC_EXPORT_PRIVATE ModelTypeSyncProxyImpl : base::NonThreadSafe {
// Informs this object that there are some incoming updates is should
// handle.
void OnUpdateReceived(const DataTypeState& type_state,
- const UpdateResponseDataList& response_list);
+ const UpdateResponseDataList& response_list,
+ const UpdateResponseDataList& pending_updates);
+
+ // Returns the list of pending updates.
+ //
+ // This is used as a helper function, but it's public mainly for testing.
+ // The current test harness setup doesn't allow us to test the data that the
+ // proxy sends to the worker during initialization, so we use this to inspect
+ // its state instead.
+ UpdateResponseDataList GetPendingUpdates();
// Returns the long-lived WeakPtr that is intended to be registered with the
// ProfileSyncService.
@@ -81,6 +90,7 @@ class SYNC_EXPORT_PRIVATE ModelTypeSyncProxyImpl : base::NonThreadSafe {
private:
typedef std::map<std::string, ModelTypeEntity*> EntityMap;
+ typedef std::map<std::string, UpdateResponseData*> UpdateMap;
// Sends all commit requests that are due to be sent to the sync thread.
void FlushPendingCommitRequests();
@@ -123,6 +133,12 @@ class SYNC_EXPORT_PRIVATE ModelTypeSyncProxyImpl : base::NonThreadSafe {
EntityMap entities_;
STLValueDeleter<EntityMap> entities_deleter_;
+ // A set of updates that can not be applied at this time. These are never
+ // used by the model. They are kept here only so we can save and restore
+ // them across restarts, and keep them in sync with our progress markers.
+ UpdateMap pending_updates_map_;
+ STLValueDeleter<UpdateMap> pending_updates_map_deleter_;
+
// We use two different WeakPtrFactories because we want the pointers they
// issue to have different lifetimes. When asked to disconnect from the sync
// thread, we want to make sure that no tasks generated as part of the
« no previous file with comments | « sync/engine/model_type_sync_proxy.h ('k') | sync/engine/model_type_sync_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698