Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: mojo/services/catalog/catalog.h

Issue 1844973002: Implement a system-level entry cache so that packages loaded from the system dir can be visible to … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/catalog/catalog.h
diff --git a/mojo/services/catalog/catalog.h b/mojo/services/catalog/catalog.h
index 8d59b45a2caac240ef87726e317a6ce2b2112bf2..d2dc7bd9e077f71072ddbda802c8c27622a2fe88 100644
--- a/mojo/services/catalog/catalog.h
+++ b/mojo/services/catalog/catalog.h
@@ -14,6 +14,7 @@
#include "mojo/services/catalog/public/interfaces/catalog.mojom.h"
#include "mojo/services/catalog/public/interfaces/resolver.mojom.h"
#include "mojo/services/catalog/store.h"
+#include "mojo/services/catalog/types.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/interfaces/shell_resolver.mojom.h"
@@ -32,7 +33,9 @@ class Catalog : public mojom::Resolver,
public mojo::shell::mojom::ShellResolver,
public mojom::Catalog {
public:
- Catalog(scoped_ptr<Store> store, base::TaskRunner* file_task_runner);
+ Catalog(scoped_ptr<Store> store,
+ base::TaskRunner* file_task_runner,
+ EntryCache* system_catalog);
~Catalog() override;
void BindResolver(mojom::ResolverRequest request);
@@ -76,12 +79,12 @@ class Catalog : public mojom::Resolver,
// Populate the catalog with data from |entry|, and pass it to the client
// via callback.
- void AddEntryToCatalog(scoped_ptr<Entry> entry);
+ void AddEntryToCatalog(scoped_ptr<Entry> entry, bool is_system_catalog);
// Directory that contains packages and executables visible to all users.
base::FilePath system_package_dir_;
-
- // TODO(beng): add user package dir.
+ // Directory that contains packages visible to this Catalog instance's user.
+ base::FilePath user_package_dir_;
// User-specific persistent storage of package manifests and other settings.
scoped_ptr<Store> store_;
@@ -93,8 +96,11 @@ class Catalog : public mojom::Resolver,
mojo::BindingSet<mojo::shell::mojom::ShellResolver> shell_resolver_bindings_;
mojo::BindingSet<mojom::Catalog> catalog_bindings_;
- // Mojo name -> Entry storage, constructed from Store/package manifests.
- std::map<std::string, scoped_ptr<Entry>> catalog_;
+ // The current user's packages, constructed from Store/package manifests.
+ EntryCache user_catalog_;
+ // Same as above, but for system-level (visible to all-users) packages and
+ // executables.
+ EntryCache* system_catalog_;
base::WeakPtrFactory<Catalog> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698