| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "mojo/public/cpp/bindings/interface_ptr.h" | 8 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" | 9 #include "mojo/public/cpp/bindings/interface_request.h" |
| 10 #include "mojo/shell/public/cpp/capabilities.h" | 10 #include "services/shell/public/cpp/capabilities.h" |
| 11 #include "mojo/shell/public/cpp/connector.h" | 11 #include "services/shell/public/cpp/connector.h" |
| 12 #include "mojo/shell/public/cpp/lib/connection_impl.h" | 12 #include "services/shell/public/cpp/lib/connection_impl.h" |
| 13 #include "mojo/shell/public/cpp/lib/connector_impl.h" | 13 #include "services/shell/public/cpp/lib/connector_impl.h" |
| 14 #include "mojo/shell/public/cpp/shell_client.h" | 14 #include "services/shell/public/cpp/shell_client.h" |
| 15 #include "mojo/shell/public/cpp/shell_connection.h" | 15 #include "services/shell/public/cpp/shell_connection.h" |
| 16 | 16 |
| 17 namespace mojo { | 17 namespace mojo { |
| 18 | 18 |
| 19 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 20 // ShellConnection, public: | 20 // ShellConnection, public: |
| 21 | 21 |
| 22 ShellConnection::ShellConnection(mojo::ShellClient* client, | 22 ShellConnection::ShellConnection(mojo::ShellClient* client, |
| 23 shell::mojom::ShellClientRequest request) | 23 shell::mojom::ShellClientRequest request) |
| 24 : client_(client), binding_(this) { | 24 : client_(client), binding_(this) { |
| 25 shell::mojom::ConnectorPtr connector; | 25 shell::mojom::ConnectorPtr connector; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Note that the ShellClient doesn't technically have to quit now, it may live | 86 // Note that the ShellClient doesn't technically have to quit now, it may live |
| 87 // on to service existing connections. All existing Connectors however are | 87 // on to service existing connections. All existing Connectors however are |
| 88 // invalid. | 88 // invalid. |
| 89 if (client_->ShellConnectionLost() && !connection_lost_closure_.is_null()) | 89 if (client_->ShellConnectionLost() && !connection_lost_closure_.is_null()) |
| 90 connection_lost_closure_.Run(); | 90 connection_lost_closure_.Run(); |
| 91 // We don't reset the connector as clients may have taken a raw pointer to it. | 91 // We don't reset the connector as clients may have taken a raw pointer to it. |
| 92 // Connect() will return nullptr if they try to connect to anything. | 92 // Connect() will return nullptr if they try to connect to anything. |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace mojo | 95 } // namespace mojo |
| OLD | NEW |