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

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

Issue 298003008: Shell / ShellClient -> ServiceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/public/cpp/shell/connect.h ('k') | mojo/public/cpp/shell/lib/service_connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/shell/lib/application.cc
diff --git a/mojo/public/cpp/shell/lib/application.cc b/mojo/public/cpp/shell/lib/application.cc
deleted file mode 100644
index 161e4e0e582bba6d710201677739ccb1f158edde..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/shell/lib/application.cc
+++ /dev/null
@@ -1,54 +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/shell/application.h"
-
-namespace mojo {
-
-Application::Application(ScopedMessagePipeHandle shell_handle)
- : internal::ServiceConnectorBase::Owner(shell_handle.Pass()) {
-}
-
-Application::Application(MojoHandle shell_handle)
- : internal::ServiceConnectorBase::Owner(
- mojo::MakeScopedHandle(MessagePipeHandle(shell_handle)).Pass()) {}
-
-Application::~Application() {
- for (ServiceConnectorList::iterator it = service_connectors_.begin();
- it != service_connectors_.end(); ++it) {
- delete *it;
- }
-}
-
-void Application::AddServiceConnector(
- internal::ServiceConnectorBase* service_connector) {
- service_connectors_.push_back(service_connector);
- set_service_connector_owner(service_connector, this);
-}
-
-void Application::RemoveServiceConnector(
- internal::ServiceConnectorBase* service_connector) {
- for (ServiceConnectorList::iterator it = service_connectors_.begin();
- it != service_connectors_.end(); ++it) {
- if (*it == service_connector) {
- service_connectors_.erase(it);
- delete service_connector;
- break;
- }
- }
- if (service_connectors_.empty())
- shell_.reset();
-}
-
-void Application::AcceptConnection(const mojo::String& url,
- ScopedMessagePipeHandle client_handle) {
- // TODO(davemoore): This method must be overridden by an Application subclass
- // to dispatch to the right ServiceConnector. We need to figure out an
- // approach to registration to make this better.
- assert(1 == service_connectors_.size());
- return service_connectors_.front()->AcceptConnection(url.To<std::string>(),
- client_handle.Pass());
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/public/cpp/shell/connect.h ('k') | mojo/public/cpp/shell/lib/service_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698