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

Side by Side Diff: src/platform-win32.cc

Issue 193873002: Invalidate OS-specific datetime cache on configuration change notification (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #define _TRUNCATE 0 69 #define _TRUNCATE 0
70 #define STRUNCATE 80 70 #define STRUNCATE 80
71 71
72 inline void MemoryBarrier() { 72 inline void MemoryBarrier() {
73 int barrier = 0; 73 int barrier = 0;
74 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); 74 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
75 } 75 }
76 76
77 #endif // __MINGW64_VERSION_MAJOR 77 #endif // __MINGW64_VERSION_MAJOR
78 78
79
80 int localtime_s(tm* out_tm, const time_t* time) { 79 int localtime_s(tm* out_tm, const time_t* time) {
81 tm* posix_local_time_struct = localtime(time); 80 tm* posix_local_time_struct = localtime(time);
82 if (posix_local_time_struct == NULL) return 1; 81 if (posix_local_time_struct == NULL) return 1;
83 *out_tm = *posix_local_time_struct; 82 *out_tm = *posix_local_time_struct;
84 return 0; 83 return 0;
85 } 84 }
86 85
87 86
88 int fopen_s(FILE** pFile, const char* filename, const char* mode) { 87 int fopen_s(FILE** pFile, const char* filename, const char* mode) {
89 *pFile = fopen(filename, mode); 88 *pFile = fopen(filename, mode);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // at the time. 243 // at the time.
245 int64_t LocalOffset(); 244 int64_t LocalOffset();
246 245
247 // Returns the daylight savings time offset for the time in milliseconds. 246 // Returns the daylight savings time offset for the time in milliseconds.
248 int64_t DaylightSavingsOffset(); 247 int64_t DaylightSavingsOffset();
249 248
250 // Returns a string identifying the current timezone for the 249 // Returns a string identifying the current timezone for the
251 // timestamp taking into account daylight saving. 250 // timestamp taking into account daylight saving.
252 char* LocalTimezone(); 251 char* LocalTimezone();
253 252
253 static void TimeZoneChanged() { tz_initialized_ = false; }
254
254 private: 255 private:
255 // Constants for time conversion. 256 // Constants for time conversion.
256 static const int64_t kTimeEpoc = 116444736000000000LL; 257 static const int64_t kTimeEpoc = 116444736000000000LL;
257 static const int64_t kTimeScaler = 10000; 258 static const int64_t kTimeScaler = 10000;
258 static const int64_t kMsPerMinute = 60000; 259 static const int64_t kMsPerMinute = 60000;
259 260
260 // Constants for timezone information. 261 // Constants for timezone information.
261 static const int kTzNameSize = 128; 262 static const int kTzNameSize = 128;
262 static const bool kShortTzNames = false; 263 static const bool kShortTzNames = false;
263 264
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 605
605 606
606 // Returns the daylight savings offset in milliseconds for the given 607 // Returns the daylight savings offset in milliseconds for the given
607 // time. 608 // time.
608 double OS::DaylightSavingsOffset(double time) { 609 double OS::DaylightSavingsOffset(double time) {
609 int64_t offset = Win32Time(time).DaylightSavingsOffset(); 610 int64_t offset = Win32Time(time).DaylightSavingsOffset();
610 return static_cast<double>(offset); 611 return static_cast<double>(offset);
611 } 612 }
612 613
613 614
615 void OS::TimeZoneChanged() {
616 Win32Time::TimeZoneChanged();
617 }
618
619
614 int OS::GetLastError() { 620 int OS::GetLastError() {
615 return ::GetLastError(); 621 return ::GetLastError();
616 } 622 }
617 623
618 624
619 int OS::GetCurrentProcessId() { 625 int OS::GetCurrentProcessId() {
620 return static_cast<int>(::GetCurrentProcessId()); 626 return static_cast<int>(::GetCurrentProcessId());
621 } 627 }
622 628
623 629
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 ASSERT(result); 1510 ASSERT(result);
1505 } 1511 }
1506 1512
1507 1513
1508 1514
1509 void Thread::YieldCPU() { 1515 void Thread::YieldCPU() {
1510 Sleep(0); 1516 Sleep(0);
1511 } 1517 }
1512 1518
1513 } } // namespace v8::internal 1519 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698