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

Side by Side Diff: components/arc/arc_bridge_service_impl.cc

Issue 2133653002: arc: Notify ARC instance failures via callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 instance_ptr_->Init(binding_.CreateInterfacePtrAndBind()); 130 instance_ptr_->Init(binding_.CreateInterfacePtrAndBind());
131 131
132 // The container can be considered to have been successfully launched, so 132 // The container can be considered to have been successfully launched, so
133 // restart if the connection goes down without being requested. 133 // restart if the connection goes down without being requested.
134 reconnect_ = true; 134 reconnect_ = true;
135 VLOG(0) << "ARC ready"; 135 VLOG(0) << "ARC ready";
136 SetState(State::READY); 136 SetState(State::READY);
137 } 137 }
138 138
139 void ArcBridgeServiceImpl::OnAborting(ArcBridgeBootstrap::AbortReason reason) {
140 DCHECK(CalledOnValidThread());
141 FOR_EACH_OBSERVER(Observer, observer_list(), OnBridgeAborting(reason));
142 }
143
139 void ArcBridgeServiceImpl::OnStopped() { 144 void ArcBridgeServiceImpl::OnStopped() {
140 DCHECK(CalledOnValidThread()); 145 DCHECK(CalledOnValidThread());
141 SetState(State::STOPPED); 146 SetState(State::STOPPED);
142 VLOG(0) << "ARC stopped"; 147 VLOG(0) << "ARC stopped";
143 if (reconnect_) { 148 if (reconnect_) {
144 // There was a previous invocation and it crashed for some reason. Try 149 // There was a previous invocation and it crashed for some reason. Try
145 // starting the container again. 150 // starting the container again.
146 reconnect_ = false; 151 reconnect_ = false;
147 VLOG(0) << "ARC reconnecting"; 152 VLOG(0) << "ARC reconnecting";
148 if (use_delay_before_reconnecting_) { 153 if (use_delay_before_reconnecting_) {
(...skipping 18 matching lines...) Expand all
167 return; 172 return;
168 } 173 }
169 VLOG(1) << "Mojo connection lost"; 174 VLOG(1) << "Mojo connection lost";
170 instance_ptr_.reset(); 175 instance_ptr_.reset();
171 if (binding_.is_bound()) 176 if (binding_.is_bound())
172 binding_.Close(); 177 binding_.Close();
173 CloseAllChannels(); 178 CloseAllChannels();
174 } 179 }
175 180
176 } // namespace arc 181 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698