summaryrefslogtreecommitdiffstats
path: root/ash/system
diff options
context:
space:
mode:
authorjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 21:56:38 +0000
committerjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 21:56:38 +0000
commit0ea8334be610a505b3bd502d3c8f1b511a8fccff (patch)
tree2b06f2239963666c5fa80a94da28cfad1fd7e11a /ash/system
parentba1c6ca05c542f4149d2fadbecd5f4a8ab2db236 (diff)
downloadchromium_src-0ea8334be610a505b3bd502d3c8f1b511a8fccff.zip
chromium_src-0ea8334be610a505b3bd502d3c8f1b511a8fccff.tar.gz
chromium_src-0ea8334be610a505b3bd502d3c8f1b511a8fccff.tar.bz2
Try to fix the possible bug in base::Time:Now() that can cause the crashing later in icu code called from ash tray TimeView::UpdateTextInternal() if the call to gettimeofday fails.
BUG=147570 Review URL: https://chromiumcodereview.appspot.com/10907178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r--ash/system/date/date_view.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ash/system/date/date_view.cc b/ash/system/date/date_view.cc
index 0ba1863..1d84a0e 100644
--- a/ash/system/date/date_view.cc
+++ b/ash/system/date/date_view.cc
@@ -181,6 +181,14 @@ void TimeView::UpdateTimeFormat() {
}
void TimeView::UpdateTextInternal(const base::Time& now) {
+ // Just in case |now| is null, do NOT update time; otherwise, it will
+ // crash icu code by calling into base::TimeFormatTimeOfDayWithHourClockType,
+ // see details in crbug.com/147570.
+ if (now.is_null()) {
+ LOG(ERROR) << "Received null value from base::Time |now| in argument";
+ return;
+ }
+
string16 current_time = base::TimeFormatTimeOfDayWithHourClockType(
now, hour_type_, base::kDropAmPm);
label_->SetText(current_time);