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

Unified Diff: services/shell/public/cpp/lib/connection_impl.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
« no previous file with comments | « services/shell/public/cpp/lib/connection_impl.h ('k') | services/shell/public/cpp/lib/connector_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/lib/connection_impl.cc
diff --git a/services/shell/public/cpp/lib/connection_impl.cc b/services/shell/public/cpp/lib/connection_impl.cc
deleted file mode 100644
index d699af750a52dc69b84dc1bcd0874110ab9535fd..0000000000000000000000000000000000000000
--- a/services/shell/public/cpp/lib/connection_impl.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2014 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/lib/connection_impl.h"
-
-#include <stdint.h>
-
-#include <utility>
-
-#include "base/bind.h"
-#include "base/logging.h"
-#include "services/shell/public/cpp/connection.h"
-#include "services/shell/public/cpp/interface_binder.h"
-
-namespace shell {
-namespace internal {
-
-////////////////////////////////////////////////////////////////////////////////
-// ConnectionImpl, public:
-
-ConnectionImpl::ConnectionImpl()
- : weak_factory_(this) {}
-
-ConnectionImpl::ConnectionImpl(const Identity& remote, State initial_state)
- : remote_(remote),
- state_(initial_state),
- weak_factory_(this) {
-}
-
-ConnectionImpl::~ConnectionImpl() {}
-
-void ConnectionImpl::SetRemoteInterfaces(
- std::unique_ptr<InterfaceProvider> remote_interfaces) {
- remote_interfaces_owner_ = std::move(remote_interfaces);
- set_remote_interfaces(remote_interfaces_owner_.get());
-}
-
-shell::mojom::Connector::ConnectCallback ConnectionImpl::GetConnectCallback() {
- return base::Bind(&ConnectionImpl::OnConnectionCompleted,
- weak_factory_.GetWeakPtr());
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// ConnectionImpl, Connection implementation:
-
-const Identity& ConnectionImpl::GetRemoteIdentity() const {
- return remote_;
-}
-
-void ConnectionImpl::SetConnectionLostClosure(const base::Closure& handler) {
- remote_interfaces_->SetConnectionLostClosure(handler);
-}
-
-shell::mojom::ConnectResult ConnectionImpl::GetResult() const {
- return result_;
-}
-
-bool ConnectionImpl::IsPending() const {
- return state_ == State::PENDING;
-}
-
-void ConnectionImpl::AddConnectionCompletedClosure(
- const base::Closure& callback) {
- if (IsPending())
- connection_completed_callbacks_.push_back(callback);
- else
- callback.Run();
-}
-
-InterfaceProvider* ConnectionImpl::GetRemoteInterfaces() {
- return remote_interfaces_;
-}
-
-base::WeakPtr<Connection> ConnectionImpl::GetWeakPtr() {
- return weak_factory_.GetWeakPtr();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// ConnectionImpl, private:
-
-void ConnectionImpl::OnConnectionCompleted(shell::mojom::ConnectResult result,
- const std::string& target_user_id) {
- DCHECK(State::PENDING == state_);
-
- result_ = result;
- state_ = result_ == shell::mojom::ConnectResult::SUCCEEDED ?
- State::CONNECTED : State::DISCONNECTED;
- remote_.set_user_id(target_user_id);
- std::vector<base::Closure> callbacks;
- callbacks.swap(connection_completed_callbacks_);
- for (auto callback : callbacks)
- callback.Run();
-}
-
-} // namespace internal
-} // namespace shell
« no previous file with comments | « services/shell/public/cpp/lib/connection_impl.h ('k') | services/shell/public/cpp/lib/connector_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698