| Index: components/sync/model_impl/shared_model_type_processor.h
|
| diff --git a/components/sync/model_impl/shared_model_type_processor.h b/components/sync/model_impl/shared_model_type_processor.h
|
| index b0e7de776b37aed8af3892c8c7b9e8e6e27d57c1..68c8bcd80bb5b054dbb87d0fa3c222e6700312da 100644
|
| --- a/components/sync/model_impl/shared_model_type_processor.h
|
| +++ b/components/sync/model_impl/shared_model_type_processor.h
|
| @@ -27,6 +27,7 @@
|
| #include "components/sync/protocol/sync.pb.h"
|
|
|
| namespace syncer {
|
| +
|
| class CommitQueue;
|
| class ProcessorEntityTracker;
|
|
|
| @@ -73,13 +74,8 @@ class SharedModelTypeProcessor : public ModelTypeProcessor,
|
| friend class ModelTypeDebugInfo;
|
| friend class SharedModelTypeProcessorTest;
|
|
|
| - using EntityMap =
|
| - std::map<std::string, std::unique_ptr<ProcessorEntityTracker>>;
|
| - using UpdateMap = std::map<std::string, std::unique_ptr<UpdateResponseData>>;
|
| -
|
| - // Whether the preconditions to connect are met. Note: returns true if we have
|
| - // already connected.
|
| - bool ConnectPreconditionsMet() const;
|
| + // Returns true if the model is ready or encountered an error.
|
| + bool IsModelReadyOrError() const;
|
|
|
| // If preconditions are met, inform sync that we are ready to connect.
|
| void ConnectIfReady();
|
| @@ -146,15 +142,16 @@ class SharedModelTypeProcessor : public ModelTypeProcessor,
|
| // Stores the start callback in between OnSyncStarting() and ReadyToConnect().
|
| StartCallback start_callback_;
|
|
|
| - // A cache for any error that may occur during startup and should be passed
|
| - // into the |start_callback_|.
|
| - base::Optional<ModelError> start_error_;
|
| + // The first model error that occurred, if any. Stored to track model state
|
| + // and so it can be passed to sync if it happened prior to sync being ready.
|
| + base::Optional<ModelError> model_error_;
|
|
|
| - // Indicates whether the metadata has finished loading.
|
| - bool is_metadata_loaded_ = false;
|
| + // Whether we're waiting for the model to provide metadata.
|
| + bool waiting_for_metadata_ = true;
|
|
|
| - // Indicates whether data for any initial pending commits has been loaded.
|
| - bool is_initial_pending_data_loaded_ = false;
|
| + // Whether we're waiting for the model to provide initial commit data. Starts
|
| + // as false but will be set to true if we detect it's necessary to load data.
|
| + bool waiting_for_pending_data_ = false;
|
|
|
| // Reference to the CommitQueue.
|
| //
|
| @@ -166,7 +163,7 @@ class SharedModelTypeProcessor : public ModelTypeProcessor,
|
| // A map of client tag hash to sync entities known to this processor. This
|
| // should contain entries and metadata for most everything, although the
|
| // entities may not always contain model type data/specifics.
|
| - EntityMap entities_;
|
| + std::map<std::string, std::unique_ptr<ProcessorEntityTracker>> entities_;
|
|
|
| // The bridge wants to communicate entirely via storage keys that is free to
|
| // define and can understand more easily. All of the sync machinery wants to
|
|
|