| 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 "components/arc/arc_bridge_service_impl.h" | 5 #include "components/arc/arc_bridge_service_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void ArcBridgeServiceImpl::SetDetectedAvailability(bool arc_available) { | 77 void ArcBridgeServiceImpl::SetDetectedAvailability(bool arc_available) { |
| 78 DCHECK(CalledOnValidThread()); | 78 DCHECK(CalledOnValidThread()); |
| 79 if (available() == arc_available) | 79 if (available() == arc_available) |
| 80 return; | 80 return; |
| 81 SetAvailable(arc_available); | 81 SetAvailable(arc_available); |
| 82 PrerequisitesChanged(); | 82 PrerequisitesChanged(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void ArcBridgeServiceImpl::OnConnectionEstablished( | 85 void ArcBridgeServiceImpl::OnConnectionEstablished( |
| 86 ArcBridgeInstancePtr instance) { | 86 mojom::ArcBridgeInstancePtr instance) { |
| 87 DCHECK(CalledOnValidThread()); | 87 DCHECK(CalledOnValidThread()); |
| 88 if (state() != State::CONNECTING) { | 88 if (state() != State::CONNECTING) { |
| 89 VLOG(1) << "StopInstance() called while connecting"; | 89 VLOG(1) << "StopInstance() called while connecting"; |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 | 92 |
| 93 instance_ptr_ = std::move(instance); | 93 instance_ptr_ = std::move(instance); |
| 94 instance_ptr_.set_connection_error_handler(base::Bind( | 94 instance_ptr_.set_connection_error_handler(base::Bind( |
| 95 &ArcBridgeServiceImpl::OnChannelClosed, weak_factory_.GetWeakPtr())); | 95 &ArcBridgeServiceImpl::OnChannelClosed, weak_factory_.GetWeakPtr())); |
| 96 | 96 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 116 // This will happen when the instance is shut down. Ignore that case. | 116 // This will happen when the instance is shut down. Ignore that case. |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 VLOG(1) << "Mojo connection lost"; | 119 VLOG(1) << "Mojo connection lost"; |
| 120 CloseAllChannels(); | 120 CloseAllChannels(); |
| 121 reconnect_ = true; | 121 reconnect_ = true; |
| 122 StopInstance(); | 122 StopInstance(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace arc | 125 } // namespace arc |
| OLD | NEW |