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

Unified Diff: chrome/browser/ui/task_manager/task_manager_table_model.cc

Issue 2734883003: base: Make TimeDurationFormat* report failures. (Closed)
Patch Set: Created 3 years, 9 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
« base/i18n/time_formatting.cc ('K') | « base/i18n/time_formatting_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/task_manager/task_manager_table_model.cc
diff --git a/chrome/browser/ui/task_manager/task_manager_table_model.cc b/chrome/browser/ui/task_manager/task_manager_table_model.cc
index 8123a35f5e43724522213cb284c583e6349e15a8..5c3c772b0666e24c225c892ecc8d25bbbeb49fa7 100644
--- a/chrome/browser/ui/task_manager/task_manager_table_model.cc
+++ b/chrome/browser/ui/task_manager/task_manager_table_model.cc
@@ -141,8 +141,13 @@ class TaskManagerValuesStringifier {
if (cpu_time.is_zero())
return n_a_string_;
- return base::TimeDurationFormatWithSeconds(cpu_time,
- base::DURATION_WIDTH_NARROW);
+ base::string16 str;
Greg Levin 2017/03/06 21:40:07 nit: Maybe something more descriptive, like |durat
Daniel Erat 2017/03/06 23:19:34 Done.
+ if (!base::TimeDurationFormatWithSeconds(
+ cpu_time, base::DURATION_WIDTH_NARROW, &str)) {
+ LOG(ERROR) << "Failed to format duration " << cpu_time.ToInternalValue();
+ return n_a_string_;
+ }
+ return str;
}
base::string16 GetMemoryUsageText(int64_t memory_usage, bool has_duplicates) {
« base/i18n/time_formatting.cc ('K') | « base/i18n/time_formatting_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698