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

Unified Diff: services/shell/public/cpp/lib/interface_provider.cc

Issue 2419723002: Move services/shell to services/service_manager (Closed)
Patch Set: rebase Created 4 years, 2 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/shell/public/cpp/lib/interface_provider.cc
diff --git a/services/shell/public/cpp/lib/interface_provider.cc b/services/shell/public/cpp/lib/interface_provider.cc
deleted file mode 100644
index 0934ee15ce2803570448310547e73216da6a4a18..0000000000000000000000000000000000000000
--- a/services/shell/public/cpp/lib/interface_provider.cc
+++ /dev/null
@@ -1,65 +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/shell/public/cpp/interface_provider.h"
-
-#include "base/macros.h"
-#include "mojo/public/cpp/bindings/strong_binding.h"
-
-namespace shell {
-
-InterfaceProvider::InterfaceProvider() : weak_factory_(this) {
- pending_request_ = GetProxy(&interface_provider_);
-}
-
-InterfaceProvider::~InterfaceProvider() {}
-
-void InterfaceProvider::Bind(mojom::InterfaceProviderPtr interface_provider) {
- DCHECK(pending_request_.is_pending());
- DCHECK(forward_callback_.is_null());
- mojo::FuseInterface(std::move(pending_request_),
- interface_provider.PassInterface());
-}
-
-void InterfaceProvider::Forward(const ForwardCallback& callback) {
- DCHECK(pending_request_.is_pending());
- DCHECK(forward_callback_.is_null());
- interface_provider_.reset();
- pending_request_.PassMessagePipe().reset();
- forward_callback_ = callback;
-}
-
-void InterfaceProvider::SetConnectionLostClosure(
- const base::Closure& connection_lost_closure) {
- interface_provider_.set_connection_error_handler(connection_lost_closure);
-}
-
-base::WeakPtr<InterfaceProvider> InterfaceProvider::GetWeakPtr() {
- return weak_factory_.GetWeakPtr();
-}
-
-void InterfaceProvider::GetInterface(
- const std::string& name,
- mojo::ScopedMessagePipeHandle request_handle) {
- // Local binders can be registered via TestApi.
- auto it = binders_.find(name);
- if (it != binders_.end()) {
- it->second.Run(std::move(request_handle));
- return;
- }
-
- if (!forward_callback_.is_null()) {
- DCHECK(!interface_provider_.is_bound());
- forward_callback_.Run(name, std::move(request_handle));
- } else {
- DCHECK(interface_provider_.is_bound());
- interface_provider_->GetInterface(name, std::move(request_handle));
- }
-}
-
-void InterfaceProvider::ClearBinders() {
- binders_.clear();
-}
-
-} // namespace shell
« no previous file with comments | « services/shell/public/cpp/lib/interface_factory_binder.h ('k') | services/shell/public/cpp/lib/interface_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698