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

Unified Diff: mojo/shell/content_handler_connection.cc

Issue 1358533004: Move more of ContentHandler handling into PackageManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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/content_handler_connection.h ('k') | mojo/shell/package_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/content_handler_connection.cc
diff --git a/mojo/shell/content_handler_connection.cc b/mojo/shell/content_handler_connection.cc
deleted file mode 100644
index 34ae9a9ba1f50a739898997dae6891e75cf3384b..0000000000000000000000000000000000000000
--- a/mojo/shell/content_handler_connection.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015 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/content_handler_connection.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "mojo/shell/application_manager.h"
-#include "mojo/shell/connect_to_application_params.h"
-#include "mojo/shell/identity.h"
-
-namespace mojo {
-namespace shell {
-
-ContentHandlerConnection::ContentHandlerConnection(
- ApplicationManager* manager,
- const Identity& source,
- const Identity& content_handler,
- uint32_t id)
- : manager_(manager),
- identity_(content_handler),
- connection_closed_(false),
- id_(id) {
- ServiceProviderPtr services;
-
- scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams);
- params->set_source(source);
- params->SetTarget(identity_);
- params->set_services(GetProxy(&services));
- manager->ConnectToApplication(params.Pass());
-
- MessagePipe pipe;
- content_handler_.Bind(
- InterfacePtrInfo<ContentHandler>(pipe.handle0.Pass(), 0u));
- services->ConnectToService(ContentHandler::Name_, pipe.handle1.Pass());
- content_handler_.set_connection_error_handler(
- [this]() { CloseConnection(); });
-}
-
-void ContentHandlerConnection::CloseConnection() {
- if (connection_closed_)
- return;
- connection_closed_ = true;
- manager_->OnContentHandlerConnectionClosed(this);
- delete this;
-}
-
-ContentHandlerConnection::~ContentHandlerConnection() {
- // If this DCHECK fails then something has tried to delete this object without
- // calling CloseConnection.
- DCHECK(connection_closed_);
-}
-
-} // namespace shell
-} // namespace mojo
« no previous file with comments | « mojo/shell/content_handler_connection.h ('k') | mojo/shell/package_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698