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

Unified Diff: src/base/platform/platform-macos.cc

Issue 2731463003: [date] Refactor TimezoneCache to be separate from the OS (Closed)
Patch Set: Properly reference windows function Created 3 years, 10 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 | « src/base/platform/platform-linux.cc ('k') | src/base/platform/platform-openbsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform-macos.cc
diff --git a/src/base/platform/platform-macos.cc b/src/base/platform/platform-macos.cc
index 69c181677787da9ba3760b614892726cb96f53d8..262ac1b37e4a877058300def123ad1c59e749b71 100644
--- a/src/base/platform/platform-macos.cc
+++ b/src/base/platform/platform-macos.cc
@@ -36,6 +36,7 @@
#undef MAP_TYPE
#include "src/base/macros.h"
+#include "src/base/platform/platform-posix.h"
#include "src/base/platform/platform.h"
@@ -98,26 +99,7 @@ std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
void OS::SignalCodeMovingGC() {
}
-
-const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
- if (std::isnan(time)) return "";
- time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
- struct tm tm;
- struct tm* t = localtime_r(&tv, &tm);
- if (NULL == t) return "";
- return t->tm_zone;
-}
-
-
-double OS::LocalTimeOffset(TimezoneCache* cache) {
- time_t tv = time(NULL);
- struct tm tm;
- struct tm* t = localtime_r(&tv, &tm);
- // tm_gmtoff includes any daylight savings offset, so subtract it.
- return static_cast<double>(t->tm_gmtoff * msPerSecond -
- (t->tm_isdst > 0 ? 3600 * msPerSecond : 0));
-}
-
+TimezoneCache* OS::CreateTimezoneCache() { return new PosixTimezoneCache(); }
VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
« no previous file with comments | « src/base/platform/platform-linux.cc ('k') | src/base/platform/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698