| OLD | NEW | 
|   1 // Copyright 2015 The Chromium Authors. All rights reserved. |   1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #include "mojo/shell/package_manager/content_handler_connection.h" |   5 #include "mojo/shell/package_manager/content_handler_connection.h" | 
|   6  |   6  | 
|   7 #include <stdint.h> |   7 #include <stdint.h> | 
|   8  |   8  | 
|   9 #include <utility> |   9 #include <utility> | 
|  10  |  10  | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|  21     ApplicationManager* manager, |  21     ApplicationManager* manager, | 
|  22     const Identity& source, |  22     const Identity& source, | 
|  23     const Identity& content_handler, |  23     const Identity& content_handler, | 
|  24     uint32_t id, |  24     uint32_t id, | 
|  25     const ClosedCallback& connection_closed_callback) |  25     const ClosedCallback& connection_closed_callback) | 
|  26     : connection_closed_callback_(connection_closed_callback), |  26     : connection_closed_callback_(connection_closed_callback), | 
|  27       identity_(content_handler), |  27       identity_(content_handler), | 
|  28       connection_closed_(false), |  28       connection_closed_(false), | 
|  29       id_(id), |  29       id_(id), | 
|  30       ref_count_(0) { |  30       ref_count_(0) { | 
|  31   InterfaceProviderPtr remote_interfaces; |  31   shell::mojom::InterfaceProviderPtr remote_interfaces; | 
|  32  |  32  | 
|  33   scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams); |  33   scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams); | 
|  34   params->set_source(source); |  34   params->set_source(source); | 
|  35   params->SetTarget(identity_); |  35   params->SetTarget(identity_); | 
|  36   params->set_remote_interfaces(GetProxy(&remote_interfaces)); |  36   params->set_remote_interfaces(GetProxy(&remote_interfaces)); | 
|  37   manager->ConnectToApplication(std::move(params)); |  37   manager->ConnectToApplication(std::move(params)); | 
|  38  |  38  | 
|  39   MessagePipe pipe; |  39   MessagePipe pipe; | 
|  40   content_handler_.Bind( |  40   content_handler_.Bind( | 
|  41       InterfacePtrInfo<mojom::ContentHandler>(std::move(pipe.handle0), 0u)); |  41       InterfacePtrInfo<mojom::ContentHandler>(std::move(pipe.handle0), 0u)); | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
|  69   DCHECK(connection_closed_); |  69   DCHECK(connection_closed_); | 
|  70 } |  70 } | 
|  71  |  71  | 
|  72 void ContentHandlerConnection::ApplicationDestructed() { |  72 void ContentHandlerConnection::ApplicationDestructed() { | 
|  73   if (!--ref_count_) |  73   if (!--ref_count_) | 
|  74     CloseConnection(); |  74     CloseConnection(); | 
|  75 } |  75 } | 
|  76  |  76  | 
|  77 }  // namespace shell |  77 }  // namespace shell | 
|  78 }  // namespace mojo |  78 }  // namespace mojo | 
| OLD | NEW |