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

Side by Side Diff: mojo/edk/system/node_controller.cc

Issue 1892123002: [mojo-edk] Disable clean shutdown behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/edk/system/node_controller.h" 5 #include "mojo/edk/system/node_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 void NodeController::DestroyOnIOThreadShutdown() { 973 void NodeController::DestroyOnIOThreadShutdown() {
974 destroy_on_io_thread_shutdown_ = true; 974 destroy_on_io_thread_shutdown_ = true;
975 } 975 }
976 976
977 void NodeController::AttemptShutdownIfRequested() { 977 void NodeController::AttemptShutdownIfRequested() {
978 base::Closure callback; 978 base::Closure callback;
979 { 979 {
980 base::AutoLock lock(shutdown_lock_); 980 base::AutoLock lock(shutdown_lock_);
981 if (shutdown_callback_.is_null()) 981 if (shutdown_callback_.is_null())
982 return; 982 return;
983 if (!node_->CanShutdownCleanly(true /* allow_local_ports */)) { 983
984 DVLOG(2) << "Unable to cleanly shut down node " << name_ << "."; 984 // TODO(rockot): We should return here if clean shutdown of |node_| is not
985 return; 985 // yet possible. See http://crbug.com/589864 for why we don't.
986 } 986
987 callback = shutdown_callback_; 987 callback = shutdown_callback_;
988 shutdown_callback_.Reset(); 988 shutdown_callback_.Reset();
989 } 989 }
990 990
991 DCHECK(!callback.is_null()); 991 DCHECK(!callback.is_null());
992 992
993 callback.Run(); 993 callback.Run();
994 } 994 }
995 995
996 } // namespace edk 996 } // namespace edk
997 } // namespace mojo 997 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698