data_type_activation_response.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_ENGINE_DATA_TYPE_ACTIVATION_RESPONSE_H_
  5. #define COMPONENTS_SYNC_ENGINE_DATA_TYPE_ACTIVATION_RESPONSE_H_
  6. #include <memory>
  7. #include "base/memory/ref_counted.h"
  8. #include "base/memory/weak_ptr.h"
  9. #include "base/task/sequenced_task_runner.h"
  10. #include "components/sync/engine/commit_and_get_updates_types.h"
  11. #include "components/sync/engine/model_type_processor.h"
  12. #include "components/sync/protocol/model_type_state.pb.h"
  13. namespace syncer {
  14. // The state passed from ModelTypeProcessor to Sync thread during DataType
  15. // activation.
  16. struct DataTypeActivationResponse {
  17. DataTypeActivationResponse();
  18. ~DataTypeActivationResponse();
  19. // Initial ModelTypeState at the moment of activation.
  20. sync_pb::ModelTypeState model_type_state;
  21. // The ModelTypeProcessor for the worker. Note that this is owned because
  22. // it is generally a proxy object to the real processor.
  23. std::unique_ptr<ModelTypeProcessor> type_processor;
  24. // Special flag used in advanced cases where there is actually no need to
  25. // activate/connect a datatype.
  26. bool skip_engine_connection = false;
  27. };
  28. } // namespace syncer
  29. #endif // COMPONENTS_SYNC_ENGINE_DATA_TYPE_ACTIVATION_RESPONSE_H_