summaryrefslogtreecommitdiffstats
path: root/base/time.cc
diff options
context:
space:
mode:
authorshinyak@google.com <shinyak@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 05:28:10 +0000
committershinyak@google.com <shinyak@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 05:28:10 +0000
commit46470aab29e72565ff358331094402b68d053e30 (patch)
tree4f70762af8aadd3673aa2cb61adc433721900388 /base/time.cc
parent4e7c71a026ec06c9a4210e84680fc368e1b2f168 (diff)
downloadchromium_src-46470aab29e72565ff358331094402b68d053e30.zip
chromium_src-46470aab29e72565ff358331094402b68d053e30.tar.gz
chromium_src-46470aab29e72565ff358331094402b68d053e30.tar.bz2
Removed wchat_t from Time::FromString.
Also, some of the test case are moved for pr_time_unittests to time_unittests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7492063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time.cc')
-rw-r--r--base/time.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/base/time.cc b/base/time.cc
index 766f599..859810e 100644
--- a/base/time.cc
+++ b/base/time.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -98,16 +98,18 @@ Time Time::LocalMidnight() const {
}
// static
-bool Time::FromString(const wchar_t* time_string, Time* parsed_time) {
+bool Time::FromString(const char* time_string, Time* parsed_time) {
DCHECK((time_string != NULL) && (parsed_time != NULL));
- std::string ascii_time_string = SysWideToUTF8(time_string);
- if (ascii_time_string.length() == 0)
+
+ if (time_string[0] == '\0')
return false;
+
PRTime result_time = 0;
- PRStatus result = PR_ParseTimeString(ascii_time_string.c_str(), PR_FALSE,
+ PRStatus result = PR_ParseTimeString(time_string, PR_FALSE,
&result_time);
if (PR_SUCCESS != result)
return false;
+
result_time += kTimeTToMicrosecondsOffset;
*parsed_time = Time(result_time);
return true;