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

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

Issue 1878893002: Move //mojo/services tracing & catalog to //services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@63move
Patch Set: . Created 4 years, 8 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/factory.h ('k') | mojo/services/catalog/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/factory.cc
diff --git a/mojo/services/catalog/factory.cc b/mojo/services/catalog/factory.cc
deleted file mode 100644
index bef55df0733726b0614077660ba5a526353a0847..0000000000000000000000000000000000000000
--- a/mojo/services/catalog/factory.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/services/catalog/factory.h"
-
-#include "base/bind.h"
-#include "mojo/services/catalog/catalog.h"
-#include "services/shell/public/cpp/connection.h"
-#include "services/shell/public/cpp/shell_connection.h"
-
-namespace catalog {
-
-Factory::Factory(base::TaskRunner* file_task_runner,
- scoped_ptr<Store> store,
- ManifestProvider* manifest_provider)
- : file_task_runner_(file_task_runner),
- store_(std::move(store)),
- manifest_provider_(manifest_provider),
- weak_factory_(this) {
- mojo::shell::mojom::ShellClientRequest request = GetProxy(&shell_client_);
- shell_connection_.reset(new mojo::ShellConnection(this, std::move(request)));
-}
-
-Factory::~Factory() {}
-
-mojo::shell::mojom::ShellClientPtr Factory::TakeShellClient() {
- return std::move(shell_client_);
-}
-
-bool Factory::AcceptConnection(mojo::Connection* connection) {
- connection->AddInterface<mojom::Catalog>(this);
- connection->AddInterface<mojom::Resolver>(this);
- connection->AddInterface<mojo::shell::mojom::ShellResolver>(this);
- return true;
-}
-
-void Factory::Create(mojo::Connection* connection,
- mojom::ResolverRequest request) {
- Catalog* instance =
- GetCatalogForUserId(connection->GetRemoteIdentity().user_id());
- instance->BindResolver(std::move(request));
-}
-
-void Factory::Create(mojo::Connection* connection,
- mojo::shell::mojom::ShellResolverRequest request) {
- Catalog* instance =
- GetCatalogForUserId(connection->GetRemoteIdentity().user_id());
- instance->BindShellResolver(std::move(request));
-}
-
-void Factory::Create(mojo::Connection* connection,
- mojom::CatalogRequest request) {
- Catalog* instance =
- GetCatalogForUserId(connection->GetRemoteIdentity().user_id());
- instance->BindCatalog(std::move(request));
-}
-
-Catalog* Factory::GetCatalogForUserId(const std::string& user_id) {
- auto it = catalogs_.find(user_id);
- if (it != catalogs_.end())
- return it->second.get();
-
- // TODO(beng): There needs to be a way to load the store from different users.
- Catalog* instance = new Catalog(std::move(store_), file_task_runner_,
- &system_catalog_, manifest_provider_);
- catalogs_[user_id] = make_scoped_ptr(instance);
- return instance;
-}
-
-} // namespace catalog
« no previous file with comments | « mojo/services/catalog/factory.h ('k') | mojo/services/catalog/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698