| 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_READER_H_ | 5 #ifndef SERVICES_CATALOG_READER_H_ |
| 6 #define SERVICES_CATALOG_READER_H_ | 6 #define SERVICES_CATALOG_READER_H_ |
| 7 | 7 |
| 8 #include <map> |
| 8 #include <memory> | 9 #include <memory> |
| 10 #include <string> |
| 9 | 11 |
| 10 #include "base/callback.h" | 12 #include "base/callback.h" |
| 11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 14 #include "services/catalog/types.h" | 16 #include "services/catalog/types.h" |
| 15 #include "services/shell/public/interfaces/resolver.mojom.h" | 17 #include "services/shell/public/interfaces/resolver.mojom.h" |
| 16 | 18 |
| 17 namespace base { | 19 namespace base { |
| 18 class SequencedWorkerPool; | 20 class SequencedWorkerPool; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 43 EntryCache* cache, | 45 EntryCache* cache, |
| 44 const base::Closure& read_complete_closure); | 46 const base::Closure& read_complete_closure); |
| 45 | 47 |
| 46 // Returns an Entry for |mojo_name| via |callback|, assuming a manifest file | 48 // Returns an Entry for |mojo_name| via |callback|, assuming a manifest file |
| 47 // in the canonical location | 49 // in the canonical location |
| 48 void CreateEntryForName( | 50 void CreateEntryForName( |
| 49 const std::string& mojo_name, | 51 const std::string& mojo_name, |
| 50 EntryCache* cache, | 52 EntryCache* cache, |
| 51 const CreateEntryForNameCallback& entry_created_callback); | 53 const CreateEntryForNameCallback& entry_created_callback); |
| 52 | 54 |
| 55 // Overrides the manifest path used for a specific service name. |
| 56 void OverrideManifestPath(const std::string& service_name, |
| 57 const base::FilePath& path); |
| 58 |
| 53 private: | 59 private: |
| 54 explicit Reader(ManifestProvider* manifest_provider); | 60 explicit Reader(ManifestProvider* manifest_provider); |
| 55 | 61 |
| 56 void OnReadManifest(EntryCache* cache, | 62 void OnReadManifest(EntryCache* cache, |
| 57 const CreateEntryForNameCallback& entry_created_callback, | 63 const CreateEntryForNameCallback& entry_created_callback, |
| 58 std::unique_ptr<Entry> entry); | 64 std::unique_ptr<Entry> entry); |
| 59 | 65 |
| 60 base::FilePath system_package_dir_; | 66 base::FilePath system_package_dir_; |
| 61 scoped_refptr<base::TaskRunner> file_task_runner_; | 67 scoped_refptr<base::TaskRunner> file_task_runner_; |
| 62 ManifestProvider* const manifest_provider_; | 68 ManifestProvider* const manifest_provider_; |
| 69 std::map<std::string, base::FilePath> manifest_path_overrides_; |
| 63 base::WeakPtrFactory<Reader> weak_factory_; | 70 base::WeakPtrFactory<Reader> weak_factory_; |
| 64 | 71 |
| 65 DISALLOW_COPY_AND_ASSIGN(Reader); | 72 DISALLOW_COPY_AND_ASSIGN(Reader); |
| 66 }; | 73 }; |
| 67 | 74 |
| 68 } // namespace catalog | 75 } // namespace catalog |
| 69 | 76 |
| 70 #endif // SERVICES_CATALOG_READER_H_ | 77 #endif // SERVICES_CATALOG_READER_H_ |
| OLD | NEW |