OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Returns a PlatformFileError that corresponds to the GDataFileError provided. | 110 // Returns a PlatformFileError that corresponds to the GDataFileError provided. |
111 base::PlatformFileError GDataFileErrorToPlatformError(GDataFileError error); | 111 base::PlatformFileError GDataFileErrorToPlatformError(GDataFileError error); |
112 | 112 |
113 // Parses an RFC 3339 date/time into a base::Time, returning true on success. | 113 // Parses an RFC 3339 date/time into a base::Time, returning true on success. |
114 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is | 114 // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is |
115 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string). | 115 // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string). |
116 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time); | 116 bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time); |
117 | 117 |
118 // Formats a base::Time as an RFC 3339 date/time (in UTC). | 118 // Formats a base::Time as an RFC 3339 date/time (in UTC). |
119 std::string FormatTimeAsString(const base::Time& time); | 119 std::string FormatTimeAsString(const base::Time& time); |
| 120 // Formats a base::Time as an RFC 3339 date/time (in localtime). |
| 121 std::string FormatTimeAsStringLocaltime(const base::Time& time); |
120 | 122 |
121 // Callback type for PrepareWritableFilePathAndRun. | 123 // Callback type for PrepareWritableFilePathAndRun. |
122 typedef base::Callback<void (GDataFileError, const FilePath& path)> | 124 typedef base::Callback<void (GDataFileError, const FilePath& path)> |
123 OpenFileCallback; | 125 OpenFileCallback; |
124 | 126 |
125 // Invokes |callback| on blocking thread pool, after converting virtual |path| | 127 // Invokes |callback| on blocking thread pool, after converting virtual |path| |
126 // string like "/special/drive/foo.txt" to the concrete local cache file path. | 128 // string like "/special/drive/foo.txt" to the concrete local cache file path. |
127 // After |callback| returns, the written content is synchronized to the server. | 129 // After |callback| returns, the written content is synchronized to the server. |
128 // | 130 // |
129 // If |path| is not a GData path, it is regarded as a local path and no path | 131 // If |path| is not a GData path, it is regarded as a local path and no path |
(...skipping 19 matching lines...) Expand all Loading... |
149 void PostBlockingPoolSequencedTaskAndReply( | 151 void PostBlockingPoolSequencedTaskAndReply( |
150 const tracked_objects::Location& from_here, | 152 const tracked_objects::Location& from_here, |
151 base::SequencedTaskRunner* blocking_task_runner, | 153 base::SequencedTaskRunner* blocking_task_runner, |
152 const base::Closure& request_task, | 154 const base::Closure& request_task, |
153 const base::Closure& reply_task); | 155 const base::Closure& reply_task); |
154 | 156 |
155 } // namespace util | 157 } // namespace util |
156 } // namespace gdata | 158 } // namespace gdata |
157 | 159 |
158 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ | 160 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UTIL_H_ |
OLD | NEW |