| 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 "mojo/shell/public/cpp/capabilities.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 incoming_connections_.push_back(std::move(registry)); | 79 incoming_connections_.push_back(std::move(registry)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 //////////////////////////////////////////////////////////////////////////////// | 82 //////////////////////////////////////////////////////////////////////////////// |
| 83 // ShellConnection, private: | 83 // ShellConnection, private: |
| 84 | 84 |
| 85 void ShellConnection::OnConnectionError() { | 85 void ShellConnection::OnConnectionError() { |
| 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 client_->ShellConnectionLost(); |
| 90 connection_lost_closure_.Run(); | |
| 91 // We don't reset the connector as clients may have taken a raw pointer to it. | 90 // 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. | 91 // Connect() will return nullptr if they try to connect to anything. |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace mojo | 94 } // namespace mojo |
| OLD | NEW |