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

Unified Diff: mojo/shell/public/cpp/lib/interface_registry.cc

Issue 1877753003: Move mojo\shell to services\shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@62scan
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/shell/public/cpp/lib/interface_factory_binder.h ('k') | mojo/shell/public/cpp/lib/message_loop_ref.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/interface_registry.cc
diff --git a/mojo/shell/public/cpp/lib/interface_registry.cc b/mojo/shell/public/cpp/lib/interface_registry.cc
deleted file mode 100644
index 98a91cefd5cab642aa5304de52a25c18739764fc..0000000000000000000000000000000000000000
--- a/mojo/shell/public/cpp/lib/interface_registry.cc
+++ /dev/null
@@ -1,70 +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/shell/public/cpp/interface_registry.h"
-
-#include "mojo/shell/public/cpp/connection.h"
-
-namespace mojo {
-
-InterfaceRegistry::InterfaceRegistry(Connection* connection)
- : InterfaceRegistry(nullptr, connection) {}
-
-InterfaceRegistry::InterfaceRegistry(
- shell::mojom::InterfaceProviderRequest request,
- Connection* connection)
- : binding_(this),
- connection_(connection),
- default_binder_(nullptr) {
- if (!request.is_pending())
- request = GetProxy(&client_handle_);
- binding_.Bind(std::move(request));
-}
-
-InterfaceRegistry::~InterfaceRegistry() {
- for (auto& i : name_to_binder_)
- delete i.second;
- name_to_binder_.clear();
-}
-
-shell::mojom::InterfaceProviderPtr InterfaceRegistry::TakeClientHandle() {
- return std::move(client_handle_);
-}
-
-// shell::mojom::InterfaceProvider:
-void InterfaceRegistry::GetInterface(const String& interface_name,
- ScopedMessagePipeHandle handle) {
- auto iter = name_to_binder_.find(interface_name);
- InterfaceBinder* binder = iter != name_to_binder_.end() ? iter->second :
- default_binder_;
- if (binder)
- binder->BindInterface(connection_, interface_name, std::move(handle));
-}
-
-bool InterfaceRegistry::SetInterfaceBinderForName(
- InterfaceBinder* binder,
- const std::string& interface_name) {
- if (!connection_ ||
- (connection_ && connection_->AllowsInterface(interface_name))) {
- RemoveInterfaceBinderForName(interface_name);
- name_to_binder_[interface_name] = binder;
- return true;
- }
- LOG(WARNING) << "Connection CapabilityFilter prevented binding to interface: "
- << interface_name << " connection_name:"
- << connection_->GetConnectionName() << " remote_name:"
- << connection_->GetRemoteIdentity().name();
- return false;
-}
-
-void InterfaceRegistry::RemoveInterfaceBinderForName(
- const std::string& interface_name) {
- NameToInterfaceBinderMap::iterator it = name_to_binder_.find(interface_name);
- if (it == name_to_binder_.end())
- return;
- delete it->second;
- name_to_binder_.erase(it);
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/shell/public/cpp/lib/interface_factory_binder.h ('k') | mojo/shell/public/cpp/lib/message_loop_ref.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698