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

Unified Diff: services/service_manager/public/cpp/lib/binder_registry.cc

Issue 2860023002: Eliminate lib directory for service manager client lib. (Closed)
Patch Set: Created 3 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
Index: services/service_manager/public/cpp/lib/binder_registry.cc
diff --git a/services/service_manager/public/cpp/lib/binder_registry.cc b/services/service_manager/public/cpp/lib/binder_registry.cc
deleted file mode 100644
index d45591626694b4833eda0bb15edea48c8a051b34..0000000000000000000000000000000000000000
--- a/services/service_manager/public/cpp/lib/binder_registry.cc
+++ /dev/null
@@ -1,57 +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 "services/service_manager/public/cpp/binder_registry.h"
-
-#include "services/service_manager/public/cpp/identity.h"
-
-namespace service_manager {
-
-BinderRegistry::BinderRegistry() : weak_factory_(this) {}
-BinderRegistry::~BinderRegistry() {}
-
-void BinderRegistry::AddInterface(
- const std::string& interface_name,
- const base::Callback<void(mojo::ScopedMessagePipeHandle)>& callback,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
- SetInterfaceBinder(interface_name, base::MakeUnique<GenericCallbackBinder>(
- callback, task_runner));
-}
-
-void BinderRegistry::RemoveInterface(const std::string& interface_name) {
- auto it = binders_.find(interface_name);
- if (it != binders_.end())
- binders_.erase(it);
-}
-
-bool BinderRegistry::CanBindInterface(const std::string& interface_name) const {
- auto it = binders_.find(interface_name);
- return it != binders_.end();
-}
-
-void BinderRegistry::BindInterface(
- const BindSourceInfo& source_info,
- const std::string& interface_name,
- mojo::ScopedMessagePipeHandle interface_pipe) {
- auto it = binders_.find(interface_name);
- if (it != binders_.end()) {
- it->second->BindInterface(source_info, interface_name,
- std::move(interface_pipe));
- } else {
- LOG(ERROR) << "Failed to locate a binder for interface: " << interface_name;
- }
-}
-
-base::WeakPtr<BinderRegistry> BinderRegistry::GetWeakPtr() {
- return weak_factory_.GetWeakPtr();
-}
-
-void BinderRegistry::SetInterfaceBinder(
- const std::string& interface_name,
- std::unique_ptr<InterfaceBinder> binder) {
- RemoveInterface(interface_name);
- binders_[interface_name] = std::move(binder);
-}
-
-} // namespace service_manager
« no previous file with comments | « services/service_manager/public/cpp/lib/bind_source_info.cc ('k') | services/service_manager/public/cpp/lib/identity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698