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

Unified Diff: chrome/browser/ui/browser_list.cc

Issue 686803003: Null checks to prevent occasional crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to CHECKs instead of DCHECKs and conditionals Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_list.cc
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index 851a9f8ca791e33639009faadca239dc3ef2017c..cd2a36b45c6308e8e1949f62530898526a4540ea 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -151,6 +151,9 @@ void BrowserList::TryToCloseBrowserList(const BrowserVector& browsers_to_close,
const base::FilePath& profile_path) {
for (BrowserVector::const_iterator it = browsers_to_close.begin();
it != browsers_to_close.end(); ++it) {
+ // TODO(mlerman): crbug.com/423229, if we can determine why window() is
+ // false we can better solve the underlying issue here.
+ CHECK((*it)->window());
if ((*it)->CallBeforeUnloadHandlers(
base::Bind(&BrowserList::PostBeforeUnloadHandlers,
browsers_to_close,
@@ -163,8 +166,12 @@ void BrowserList::TryToCloseBrowserList(const BrowserVector& browsers_to_close,
on_close_success.Run(profile_path);
for (BrowserVector::const_iterator it = browsers_to_close.begin();
- it != browsers_to_close.end(); ++it)
+ it != browsers_to_close.end(); ++it) {
+ // TODO(mlerman): If reproducible, determine cause if window() being null.
+ CHECK((*it));
+ CHECK((*it)->window());
(*it)->window()->Close();
+ }
}
// static
« 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