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

Unified Diff: chrome/common/metrics/metrics_log_manager.cc

Issue 10692059: Make metrics state machine more lenient about OLD vs. CURRENT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
Index: chrome/common/metrics/metrics_log_manager.cc
diff --git a/chrome/common/metrics/metrics_log_manager.cc b/chrome/common/metrics/metrics_log_manager.cc
index 6a6907a33b106f92061b3d3d0c56c97ff4e6005e..e958074cc8a7e50940a7f69aa797f9137ba68332 100644
--- a/chrome/common/metrics/metrics_log_manager.cc
+++ b/chrome/common/metrics/metrics_log_manager.cc
@@ -75,7 +75,9 @@ void MetricsLogManager::StageNextLogForUpload() {
: &unsent_initial_logs_;
LogType source_type = (source_list == &unsent_ongoing_logs_) ? ONGOING_LOG
: INITIAL_LOG;
- DCHECK(!source_list->empty());
+ // CHECK, rather than DCHECK, because swap()ing with an empty list causes
+ // hard-to-identify crashes much later.
+ CHECK(!source_list->empty());
DCHECK(staged_log_text_.empty());
DCHECK(staged_log_type_ == NO_LOG);
staged_log_text_.swap(source_list->back());
« chrome/browser/metrics/metrics_service.cc ('K') | « chrome/browser/metrics/metrics_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698