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

Unified Diff: mojo/public/cpp/application/lib/service_provider_impl.cc

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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: mojo/public/cpp/application/lib/service_provider_impl.cc
diff --git a/mojo/public/cpp/application/lib/service_provider_impl.cc b/mojo/public/cpp/application/lib/service_provider_impl.cc
deleted file mode 100644
index 08a06484877cfaa93f9e8c9cf91afa6c0ca37222..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/application/lib/service_provider_impl.cc
+++ /dev/null
@@ -1,69 +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 "mojo/public/cpp/application/service_provider_impl.h"
-
-#include "mojo/public/cpp/application/lib/service_connector.h"
-#include "mojo/public/cpp/application/lib/weak_service_provider.h"
-#include "mojo/public/cpp/environment/logging.h"
-
-namespace mojo {
-
-ServiceProviderImpl::ServiceProviderImpl() : remote_(nullptr) {
-}
-
-ServiceProviderImpl::~ServiceProviderImpl() {
-}
-
-ServiceProvider* ServiceProviderImpl::CreateRemoteServiceProvider() {
- // TODO(beng): it sure would be nice if this method could return a scoped_ptr.
- MOJO_DCHECK(!remote_);
- remote_ = new internal::WeakServiceProvider(this, client());
- return remote_;
-}
-
-void ServiceProviderImpl::ConnectToService(
- const String& service_name,
- ScopedMessagePipeHandle client_handle) {
- if (service_connectors_.find(service_name) == service_connectors_.end()) {
- client_handle.reset();
- return;
- }
-
- internal::ServiceConnectorBase* service_connector =
- service_connectors_[service_name];
- return service_connector->ConnectToService(service_name,
- client_handle.Pass());
-}
-
-void ServiceProviderImpl::OnConnectionError() {
- ClearRemote();
-}
-
-void ServiceProviderImpl::AddServiceConnector(
- internal::ServiceConnectorBase* service_connector) {
- RemoveServiceConnector(service_connector);
- service_connectors_[service_connector->name()] = service_connector;
- // TODO(beng): perhaps take app connection thru ctor??
- service_connector->set_application_connection(nullptr);
-}
-
-void ServiceProviderImpl::RemoveServiceConnector(
- internal::ServiceConnectorBase* service_connector) {
- NameToServiceConnectorMap::iterator it =
- service_connectors_.find(service_connector->name());
- if (it == service_connectors_.end())
- return;
- delete it->second;
- service_connectors_.erase(it);
-}
-
-void ServiceProviderImpl::ClearRemote() {
- if (remote_) {
- remote_->Clear();
- remote_ = nullptr;
- }
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/public/cpp/application/lib/service_connector.cc ('k') | mojo/public/cpp/application/lib/service_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698