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

Unified Diff: chrome/browser/chromeos/boot_times_recorder.cc

Issue 2200703002: chromeos: Try to avoid shutdown crash in BootTimesRecorder. (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 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/chromeos/boot_times_recorder.cc
diff --git a/chrome/browser/chromeos/boot_times_recorder.cc b/chrome/browser/chromeos/boot_times_recorder.cc
index 35bed8f73496c948d11f51b93274c493a181cafe..c6d5064a8a504ba55024a0c64ffc95658c974e55 100644
--- a/chrome/browser/chromeos/boot_times_recorder.cc
+++ b/chrome/browser/chromeos/boot_times_recorder.cc
@@ -356,8 +356,8 @@ void BootTimesRecorder::WriteLogoutTimes() {
// Either we're on the browser thread, or (more likely) Chrome is in the
// process of shutting down and we're on the main thread but the message loop
// has already been terminated.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
- !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
+ DCHECK(!BrowserThread::IsMessageLoopValid(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI));
WriteTimes(kLogoutTimes,
(restart_requested_ ? kUmaRestart : kUmaLogout),
@@ -462,8 +462,8 @@ void BootTimesRecorder::AddMarker(std::vector<TimeMarker>* vector,
// The marker vectors can only be safely manipulated on the main thread.
// If we're late in the process of shutting down (eg. as can be the case at
// logout), then we have to assume we're on the main thread already.
- if (BrowserThread::CurrentlyOn(BrowserThread::UI) ||
- !BrowserThread::IsMessageLoopValid(BrowserThread::UI)) {
+ if (!BrowserThread::IsMessageLoopValid(BrowserThread::UI) ||
+ BrowserThread::CurrentlyOn(BrowserThread::UI)) {
vector->push_back(marker);
} else {
// Add the marker on the UI thread.
« 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