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

Unified Diff: base/time.cc

Issue 7520021: Revert 94426 - Removed wchat_t from Time::FromString. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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
« no previous file with comments | « base/time.h ('k') | base/time_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time.cc
===================================================================
--- base/time.cc (revision 94426)
+++ base/time.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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,18 +98,16 @@
}
// static
-bool Time::FromString(const char* time_string, Time* parsed_time) {
+bool Time::FromString(const wchar_t* time_string, Time* parsed_time) {
DCHECK((time_string != NULL) && (parsed_time != NULL));
-
- if (time_string[0] == '\0')
+ std::string ascii_time_string = SysWideToUTF8(time_string);
+ if (ascii_time_string.length() == 0)
return false;
-
PRTime result_time = 0;
- PRStatus result = PR_ParseTimeString(time_string, PR_FALSE,
+ PRStatus result = PR_ParseTimeString(ascii_time_string.c_str(), PR_FALSE,
&result_time);
if (PR_SUCCESS != result)
return false;
-
result_time += kTimeTToMicrosecondsOffset;
*parsed_time = Time(result_time);
return true;
« no previous file with comments | « base/time.h ('k') | base/time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698