| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_CATALOG_CATALOG_H_ | 5 #ifndef SERVICES_CATALOG_CATALOG_H_ |
| 6 #define SERVICES_CATALOG_CATALOG_H_ | 6 #define SERVICES_CATALOG_CATALOG_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "components/filesystem/public/interfaces/directory.mojom.h" | 15 #include "components/filesystem/public/interfaces/directory.mojom.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
| 16 #include "services/catalog/public/interfaces/catalog.mojom.h" | 17 #include "services/catalog/public/interfaces/catalog.mojom.h" |
| 17 #include "services/catalog/types.h" | 18 #include "services/catalog/types.h" |
| 18 #include "services/shell/public/cpp/service.h" | 19 #include "services/shell/public/cpp/service.h" |
| 19 #include "services/shell/public/interfaces/resolver.mojom.h" | 20 #include "services/shell/public/interfaces/resolver.mojom.h" |
| 20 #include "services/shell/public/interfaces/service.mojom.h" | 21 #include "services/shell/public/interfaces/service.mojom.h" |
| 21 | 22 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 Catalog(base::SequencedWorkerPool* worker_pool, | 51 Catalog(base::SequencedWorkerPool* worker_pool, |
| 51 std::unique_ptr<Store> store, | 52 std::unique_ptr<Store> store, |
| 52 ManifestProvider* manifest_provider); | 53 ManifestProvider* manifest_provider); |
| 53 Catalog(base::SingleThreadTaskRunner* task_runner, | 54 Catalog(base::SingleThreadTaskRunner* task_runner, |
| 54 std::unique_ptr<Store> store, | 55 std::unique_ptr<Store> store, |
| 55 ManifestProvider* manifest_provider); | 56 ManifestProvider* manifest_provider); |
| 56 ~Catalog() override; | 57 ~Catalog() override; |
| 57 | 58 |
| 58 shell::mojom::ServicePtr TakeService(); | 59 shell::mojom::ServicePtr TakeService(); |
| 59 | 60 |
| 61 void set_override_resource_path( |
| 62 const base::FilePath::StringType& resource_path) { |
| 63 override_resource_path_ = resource_path; |
| 64 } |
| 65 |
| 60 private: | 66 private: |
| 61 explicit Catalog(std::unique_ptr<Store> store); | 67 explicit Catalog(std::unique_ptr<Store> store); |
| 62 | 68 |
| 63 // Starts a scane for system packages. | 69 // Starts a scane for system packages. |
| 64 void ScanSystemPackageDir(); | 70 void ScanSystemPackageDir(); |
| 65 | 71 |
| 66 // shell::Service: | 72 // shell::Service: |
| 67 bool OnConnect(const shell::Identity& remote_identity, | 73 bool OnConnect(const shell::Identity& remote_identity, |
| 68 shell::InterfaceRegistry* registry) override; | 74 shell::InterfaceRegistry* registry) override; |
| 69 | 75 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 87 | 93 |
| 88 shell::mojom::ServicePtr service_; | 94 shell::mojom::ServicePtr service_; |
| 89 std::unique_ptr<shell::ServiceContext> shell_connection_; | 95 std::unique_ptr<shell::ServiceContext> shell_connection_; |
| 90 | 96 |
| 91 std::map<std::string, std::unique_ptr<Instance>> instances_; | 97 std::map<std::string, std::unique_ptr<Instance>> instances_; |
| 92 | 98 |
| 93 std::unique_ptr<Reader> system_reader_; | 99 std::unique_ptr<Reader> system_reader_; |
| 94 EntryCache system_cache_; | 100 EntryCache system_cache_; |
| 95 bool loaded_ = false; | 101 bool loaded_ = false; |
| 96 | 102 |
| 103 base::FilePath::StringType override_resource_path_; |
| 97 scoped_refptr<filesystem::LockTable> lock_table_; | 104 scoped_refptr<filesystem::LockTable> lock_table_; |
| 98 | 105 |
| 99 base::WeakPtrFactory<Catalog> weak_factory_; | 106 base::WeakPtrFactory<Catalog> weak_factory_; |
| 100 | 107 |
| 101 DISALLOW_COPY_AND_ASSIGN(Catalog); | 108 DISALLOW_COPY_AND_ASSIGN(Catalog); |
| 102 }; | 109 }; |
| 103 | 110 |
| 104 } // namespace catalog | 111 } // namespace catalog |
| 105 | 112 |
| 106 #endif // SERVICES_CATALOG_CATALOG_H_ | 113 #endif // SERVICES_CATALOG_CATALOG_H_ |
| OLD | NEW |