Index: chrome/test/webdriver/webdriver_logging.cc |
diff --git a/chrome/test/webdriver/webdriver_logging.cc b/chrome/test/webdriver/webdriver_logging.cc |
index e52d1ec8c519303afc9fdfe9c840c39d3f126bb7..289b896b9d564323bd9b4935b6fbd3e3731c5a9b 100644 |
--- a/chrome/test/webdriver/webdriver_logging.cc |
+++ b/chrome/test/webdriver/webdriver_logging.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -141,17 +141,10 @@ InMemoryLog::~InMemoryLog() { } |
void InMemoryLog::Log(LogLevel level, const base::Time& time, |
const std::string& message) { |
- // base's JSONWriter doesn't obey the spec, and writes |
- // doubles without a fraction with a '.0' postfix. base's Value class |
- // only includes doubles or int types. Instead of returning the timestamp |
- // in unix epoch time, we return it based on the start of chromedriver so |
- // a 32-bit int doesn't overflow. |
- // TODO(kkania): Add int64_t to base Values or fix the JSONWriter/Reader and |
- // use unix epoch time. |
- base::TimeDelta delta(time - base::Time::FromDoubleT(start_time)); |
+ base::TimeDelta delta = time - base::Time::UnixEpoch(); |
DictionaryValue* entry = new DictionaryValue(); |
entry->SetInteger("level", level); |
- entry->SetInteger("timestamp", delta.InMilliseconds()); |
+ entry->SetDouble("timestamp", std::floor(delta.InMilliseconds())); |
entry->SetString("message", message); |
base::AutoLock auto_lock(entries_lock_); |
entries_list_.Append(entry); |