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

Side by Side Diff: src/date.cc

Issue 2731463003: [date] Refactor TimezoneCache to be separate from the OS (Closed)
Patch Set: Properly reference windows function Created 3 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/date.h ('k') | src/v8.gyp » ('j') | 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 // 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 #include "src/date.h" 5 #include "src/date.h"
6 6
7 #include "src/objects.h" 7 #include "src/objects.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 DCHECK(stamp_ != Smi::FromInt(kInvalidStamp)); 32 DCHECK(stamp_ != Smi::FromInt(kInvalidStamp));
33 for (int i = 0; i < kDSTSize; ++i) { 33 for (int i = 0; i < kDSTSize; ++i) {
34 ClearSegment(&dst_[i]); 34 ClearSegment(&dst_[i]);
35 } 35 }
36 dst_usage_counter_ = 0; 36 dst_usage_counter_ = 0;
37 before_ = &dst_[0]; 37 before_ = &dst_[0];
38 after_ = &dst_[1]; 38 after_ = &dst_[1];
39 local_offset_ms_ = kInvalidLocalOffsetInMs; 39 local_offset_ms_ = kInvalidLocalOffsetInMs;
40 ymd_valid_ = false; 40 ymd_valid_ = false;
41 base::OS::ClearTimezoneCache(tz_cache_); 41 tz_cache_->Clear();
42 } 42 }
43 43
44 44
45 void DateCache::ClearSegment(DST* segment) { 45 void DateCache::ClearSegment(DST* segment) {
46 segment->start_sec = kMaxEpochTimeInSec; 46 segment->start_sec = kMaxEpochTimeInSec;
47 segment->end_sec = -kMaxEpochTimeInSec; 47 segment->end_sec = -kMaxEpochTimeInSec;
48 segment->offset_ms = 0; 48 segment->offset_ms = 0;
49 segment->last_used = 0; 49 segment->last_used = 0;
50 } 50 }
51 51
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 if (result == NULL || result->last_used > dst_[i].last_used) { 366 if (result == NULL || result->last_used > dst_[i].last_used) {
367 result = &dst_[i]; 367 result = &dst_[i];
368 } 368 }
369 } 369 }
370 ClearSegment(result); 370 ClearSegment(result);
371 return result; 371 return result;
372 } 372 }
373 373
374 } // namespace internal 374 } // namespace internal
375 } // namespace v8 375 } // namespace v8
OLDNEW
« no previous file with comments | « src/date.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698