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

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

Issue 1791663002: Allow Catalogs to be constructed per-user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@49catalog
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
« no previous file with comments | « mojo/services/catalog/catalog.h ('k') | mojo/services/catalog/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/catalog.cc
diff --git a/mojo/services/catalog/catalog.cc b/mojo/services/catalog/catalog.cc
index ba6bcfeb656fa47d8482393ff88892f08f274cc2..d02e1febda953f58da82c739ce70226e53d03050 100644
--- a/mojo/services/catalog/catalog.cc
+++ b/mojo/services/catalog/catalog.cc
@@ -30,10 +30,12 @@ scoped_ptr<base::Value> ReadManifest(const base::FilePath& manifest_path) {
} // namespace
-Catalog::Catalog(base::TaskRunner* blocking_pool,
- scoped_ptr<Store> catalog)
+////////////////////////////////////////////////////////////////////////////////
+// Catalog, public:
+
+Catalog::Catalog(base::TaskRunner* blocking_pool, scoped_ptr<Store> store)
: blocking_pool_(blocking_pool),
- store_(std::move(catalog)),
+ store_(std::move(store)),
weak_factory_(this) {
base::FilePath shell_dir;
PathService::Get(base::DIR_MODULE, &shell_dir);
@@ -45,31 +47,25 @@ Catalog::Catalog(base::TaskRunner* blocking_pool,
DeserializeCatalog();
}
-Catalog::~Catalog() {}
-bool Catalog::AcceptConnection(mojo::Connection* connection) {
- connection->AddInterface<mojom::Catalog>(this);
- connection->AddInterface<mojom::Resolver>(this);
- if (connection->GetRemoteIdentity().name() == "mojo:shell")
- connection->AddInterface<mojo::shell::mojom::ShellResolver>(this);
- return true;
-}
+Catalog::~Catalog() {}
-void Catalog::Create(mojo::Connection* connection,
- mojom::ResolverRequest request) {
+void Catalog::BindResolver(mojom::ResolverRequest request) {
resolver_bindings_.AddBinding(this, std::move(request));
}
-void Catalog::Create(mojo::Connection* connection,
- mojo::shell::mojom::ShellResolverRequest request) {
+void Catalog::BindShellResolver(
+ mojo::shell::mojom::ShellResolverRequest request) {
shell_resolver_bindings_.AddBinding(this, std::move(request));
}
-void Catalog::Create(mojo::Connection* connection,
- mojom::CatalogRequest request) {
+void Catalog::BindCatalog(mojom::CatalogRequest request) {
catalog_bindings_.AddBinding(this, std::move(request));
}
+////////////////////////////////////////////////////////////////////////////////
+// Catalog, mojom::Resolver:
+
void Catalog::ResolveResponse(mojo::URLResponsePtr response,
const ResolveResponseCallback& callback) {
// TODO(beng): implement.
@@ -91,6 +87,9 @@ void Catalog::ResolveProtocolScheme(
// TODO(beng): implement.
}
+////////////////////////////////////////////////////////////////////////////////
+// Catalog, mojo::shell::mojom::ShellResolver:
+
void Catalog::ResolveMojoName(const mojo::String& mojo_name,
const ResolveMojoNameCallback& callback) {
std::string resolved_name = mojo_name;
@@ -109,6 +108,9 @@ void Catalog::ResolveMojoName(const mojo::String& mojo_name,
AddNameToCatalog(resolved_name, callback);
}
+////////////////////////////////////////////////////////////////////////////////
+// Catalog, mojom::Catalog:
+
void Catalog::GetEntries(mojo::Array<mojo::String> names,
const GetEntriesCallback& callback) {
mojo::Map<mojo::String, mojom::CatalogEntryPtr> entries;
@@ -124,6 +126,9 @@ void Catalog::GetEntries(mojo::Array<mojo::String> names,
callback.Run(std::move(entries));
}
+////////////////////////////////////////////////////////////////////////////////
+// Catalog, private:
+
void Catalog::CompleteResolveMojoName(
const std::string& resolved_name,
const std::string& qualifier,
« no previous file with comments | « mojo/services/catalog/catalog.h ('k') | mojo/services/catalog/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698