| OLD | NEW |
| 1 /* Portions are Copyright (C) 2011 Google Inc */ | 1 /* Portions are Copyright (C) 2011 Google Inc */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 * All types and macros are defined in the base/third_party/prtime.h file. | 58 * All types and macros are defined in the base/third_party/prtime.h file. |
| 59 * These have been copied from the following nspr files. We have only copied | 59 * These have been copied from the following nspr files. We have only copied |
| 60 * over the types we need. | 60 * over the types we need. |
| 61 * 1. prtime.h | 61 * 1. prtime.h |
| 62 * 2. prtypes.h | 62 * 2. prtypes.h |
| 63 * 3. prlong.h | 63 * 3. prlong.h |
| 64 * | 64 * |
| 65 * Unit tests are in base/time/pr_time_unittest.cc. | 65 * Unit tests are in base/time/pr_time_unittest.cc. |
| 66 */ | 66 */ |
| 67 | 67 |
| 68 #include <limits.h> |
| 69 |
| 68 #include "base/logging.h" | 70 #include "base/logging.h" |
| 69 #include "base/third_party/nspr/prtime.h" | 71 #include "base/third_party/nspr/prtime.h" |
| 70 #include "build/build_config.h" | 72 #include "build/build_config.h" |
| 71 | 73 |
| 72 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 73 #include <windows.h> | 75 #include <windows.h> |
| 74 #elif defined(OS_MACOSX) | 76 #elif defined(OS_MACOSX) |
| 75 #include <CoreFoundation/CoreFoundation.h> | 77 #include <CoreFoundation/CoreFoundation.h> |
| 76 #elif defined(OS_ANDROID) | 78 #elif defined(OS_ANDROID) |
| 77 #include <ctype.h> | 79 #include <ctype.h> |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 + 60 * localTime.tm_hour | 1245 + 60 * localTime.tm_hour |
| 1244 + 1440 * (localTime.tm_mday - 2); | 1246 + 1440 * (localTime.tm_mday - 2); |
| 1245 } | 1247 } |
| 1246 | 1248 |
| 1247 result->tm_params.tp_gmt_offset = zone_offset * 60; | 1249 result->tm_params.tp_gmt_offset = zone_offset * 60; |
| 1248 result->tm_params.tp_dst_offset = dst_offset * 60; | 1250 result->tm_params.tp_dst_offset = dst_offset * 60; |
| 1249 | 1251 |
| 1250 *result_imploded = PR_ImplodeTime(result); | 1252 *result_imploded = PR_ImplodeTime(result); |
| 1251 return PR_SUCCESS; | 1253 return PR_SUCCESS; |
| 1252 } | 1254 } |
| OLD | NEW |