model_type_store_service.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2018 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_MODEL_MODEL_TYPE_STORE_SERVICE_H_
  5. #define COMPONENTS_SYNC_MODEL_MODEL_TYPE_STORE_SERVICE_H_
  6. #include "base/files/file_path.h"
  7. #include "base/memory/scoped_refptr.h"
  8. #include "base/task/sequenced_task_runner.h"
  9. #include "components/keyed_service/core/keyed_service.h"
  10. #include "components/sync/model/model_type_store.h"
  11. namespace syncer {
  12. // Handles the shared resources for ModelTypeStore and related classes,
  13. // including a shared background sequence runner.
  14. class ModelTypeStoreService : public KeyedService {
  15. public:
  16. // Returns the root directory under which sync stores data.
  17. // This doesn't belong here strictly speaking, but it is convenient to
  18. // centralize all storage-related paths in one class.
  19. virtual const base::FilePath& GetSyncDataPath() const = 0;
  20. // Returns a factory to create instances of ModelTypeStore. May be used from
  21. // any thread and independently of the lifetime of this object.
  22. virtual RepeatingModelTypeStoreFactory GetStoreFactory() = 0;
  23. virtual scoped_refptr<base::SequencedTaskRunner> GetBackendTaskRunner() = 0;
  24. };
  25. } // namespace syncer
  26. #endif // COMPONENTS_SYNC_MODEL_MODEL_TYPE_STORE_SERVICE_H_