Changeset 202198 in webkit
- Timestamp:
- Jun 18, 2016, 4:46:16 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202197 r202198 1 2016-06-18 Antti Koivisto <antti@apple.com> 2 3 Use time literals in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=158905 5 6 Reviewed by Andreas Kling. 7 8 std::chrono::milliseconds(1) -> 1ms etc. 9 10 * dom/Document.cpp: 11 (WebCore::Document::minimumLayoutDelay): 12 (WebCore::Document::elapsedTime): 13 * fileapi/FileReader.cpp: 14 (WebCore::FileReader::create): 15 * inspector/InspectorOverlay.cpp: 16 (WebCore::InspectorOverlay::showPaintRect): 17 * loader/CrossOriginPreflightResultCache.cpp: 18 (WebCore::CrossOriginPreflightResultCache::CrossOriginPreflightResultCache): 19 * loader/ProgressTracker.cpp: 20 (WebCore::ProgressTracker::progressStarted): 21 * loader/cache/CachedResource.cpp: 22 (WebCore::CachedResource::freshnessLifetime): 23 * page/ChromeClient.h: 24 * page/DOMTimer.cpp: 25 (WebCore::DOMTimer::intervalClampedToMinimum): 26 (WebCore::DOMTimer::alignedFireTime): 27 * page/DOMTimer.h: 28 * page/FrameView.cpp: 29 (WebCore::FrameView::scrollPositionChanged): 30 * page/ResourceUsageThread.cpp: 31 (WebCore::ResourceUsageThread::threadBody): 32 * page/Settings.cpp: 33 (WebCore::Settings::Settings): 34 * page/mac/ServicesOverlayController.mm: 35 (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): 36 * platform/graphics/FontCache.cpp: 37 (WebCore::FontCache::fontForFamily): 38 * platform/network/CacheValidation.cpp: 39 (WebCore::computeCurrentAge): 40 (WebCore::computeFreshnessLifetimeForHTTPFamily): 41 1 42 2016-06-17 Benjamin Poulain <benjamin@webkit.org> 2 43 -
trunk/Source/WebCore/dom/Document.cpp
r202183 r202198 2850 2850 { 2851 2851 if (m_overMinimumLayoutThreshold) 2852 return std::chrono::milliseconds(0);2852 return 0ms; 2853 2853 2854 std::chrono::millisecondselapsed = elapsedTime();2854 auto elapsed = elapsedTime(); 2855 2855 m_overMinimumLayoutThreshold = elapsed > settings()->layoutInterval(); 2856 2856 2857 2857 // We'll want to schedule the timer to fire at the minimum layout threshold. 2858 return std::max( std::chrono::milliseconds(0), settings()->layoutInterval() - elapsed);2858 return std::max(0ms, settings()->layoutInterval() - elapsed); 2859 2859 } 2860 2860 -
trunk/Source/WebCore/fileapi/FileReader.cpp
r202105 r202198 44 44 namespace WebCore { 45 45 46 static const auto progressNotificationInterval = std::chrono::milliseconds(50);46 static const auto progressNotificationInterval = 50ms; 47 47 48 48 Ref<FileReader> FileReader::create(ScriptExecutionContext& context) -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r202005 r202198 506 506 IntRect rootRect = m_page.mainFrame().view()->contentsToRootView(enclosingIntRect(rect)); 507 507 508 const std::chrono::milliseconds removeDelay = std::chrono::milliseconds(250);508 const auto removeDelay = 250ms; 509 509 510 510 std::chrono::steady_clock::time_point removeTime = std::chrono::steady_clock::now() + removeDelay; -
trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp
r194496 r202198 38 38 39 39 // These values are at the discretion of the user agent. 40 static const auto defaultPreflightCacheTimeout = std::chrono::seconds(5);41 static const auto maxPreflightCacheTimeout = std::chrono::seconds(600); // Should be short enough to minimize the risk of using a poisoned cache after switching to a secure network.40 static const auto defaultPreflightCacheTimeout = 5s; 41 static const auto maxPreflightCacheTimeout = 600s; // Should be short enough to minimize the risk of using a poisoned cache after switching to a secure network. 42 42 43 43 CrossOriginPreflightResultCache::CrossOriginPreflightResultCache() -
trunk/Source/WebCore/loader/ProgressTracker.cpp
r186279 r202198 61 61 static const unsigned minumumBytesPerHeartbeatForProgress = 1024; 62 62 63 static const std::chrono::milliseconds progressNotificationTimeInterval = std::chrono::milliseconds(200);63 static const auto progressNotificationTimeInterval = 200ms; 64 64 65 65 struct ProgressItem { … … 138 138 auto elapsedTimeSinceMainLoadComplete = std::chrono::steady_clock::now() - m_mainLoadCompletionTime; 139 139 140 static const auto subframePartOfMainLoadThreshold = std::chrono::seconds(1);140 static const auto subframePartOfMainLoadThreshold = 1s; 141 141 m_isMainLoad = isMainFrame || elapsedTimeSinceMainLoadComplete < subframePartOfMainLoadThreshold; 142 142 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r202005 r202198 393 393 // it caused performance and flakiness issues in our test infrastructure. 394 394 if (m_type == MainResource || SchemeRegistry::shouldAlwaysRevalidateURLScheme(protocol)) 395 return std::chrono::microseconds::zero();395 return 0us; 396 396 } 397 397 -
trunk/Source/WebCore/page/ChromeClient.h
r199593 r202198 240 240 #endif 241 241 242 virtual std::chrono::milliseconds eventThrottlingDelay() { return std::chrono::milliseconds::zero(); };242 virtual std::chrono::milliseconds eventThrottlingDelay() { return 0ms; }; 243 243 244 244 #if PLATFORM(IOS) -
trunk/Source/WebCore/page/DOMTimer.cpp
r198079 r202198 53 53 namespace WebCore { 54 54 55 static const std::chrono::milliseconds maxIntervalForUserGestureForwarding = std::chrono::milliseconds(1000); // One second matches Gecko.56 static const std::chrono::milliseconds minIntervalForNonUserObservableChangeTimers = std::chrono::milliseconds(1000); // Empirically determined to maximize battery life.55 static const auto maxIntervalForUserGestureForwarding = 1000ms; // One second matches Gecko. 56 static const auto minIntervalForNonUserObservableChangeTimers = 1000ms; // Empirically determined to maximize battery life. 57 57 static const int maxTimerNestingLevel = 5; 58 58 … … 407 407 ASSERT(m_nestingLevel <= maxTimerNestingLevel); 408 408 409 auto interval = std::max( std::chrono::milliseconds(1), m_originalInterval);409 auto interval = std::max(1ms, m_originalInterval); 410 410 411 411 // Only apply throttling to repeating timers. … … 423 423 { 424 424 auto alignmentInterval = scriptExecutionContext()->timerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel); 425 if (alignmentInterval == std::chrono::milliseconds::zero())425 if (alignmentInterval == 0ms) 426 426 return Nullopt; 427 427 -
trunk/Source/WebCore/page/DOMTimer.h
r197690 r202198 47 47 virtual ~DOMTimer(); 48 48 49 static std::chrono::milliseconds defaultMinimumInterval() { return std::chrono::milliseconds(4); }50 static std::chrono::milliseconds defaultAlignmentInterval() { return std::chrono::milliseconds::zero(); }51 static std::chrono::milliseconds hiddenPageAlignmentInterval() { return std::chrono::milliseconds(1000); }49 static std::chrono::milliseconds defaultMinimumInterval() { return 4ms; } 50 static std::chrono::milliseconds defaultAlignmentInterval() { return 0ms; } 51 static std::chrono::milliseconds hiddenPageAlignmentInterval() { return 1000ms; } 52 52 53 53 // Creates a new timer owned by specified ScriptExecutionContext, starts it -
trunk/Source/WebCore/page/FrameView.cpp
r202105 r202198 2223 2223 { 2224 2224 Page* page = frame().page(); 2225 auto throttlingDelay = page ? page->chrome().client().eventThrottlingDelay() : std::chrono::milliseconds::zero();2226 2227 if (throttlingDelay == std::chrono::milliseconds::zero()) {2225 auto throttlingDelay = page ? page->chrome().client().eventThrottlingDelay() : 0ms; 2226 2227 if (throttlingDelay == 0ms) { 2228 2228 m_delayedScrollEventTimer.stop(); 2229 2229 sendScrollEvent(); -
trunk/Source/WebCore/page/ResourceUsageThread.cpp
r201482 r202198 120 120 notifyObservers(WTFMove(data)); 121 121 122 auto duration = std::chrono:: duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start);123 auto difference = std::chrono::milliseconds(500)- duration;122 auto duration = std::chrono::system_clock::now() - start; 123 auto difference = 500ms - duration; 124 124 std::this_thread::sleep_for(difference); 125 125 } -
trunk/Source/WebCore/page/Settings.cpp
r202018 r202198 176 176 // FIXME: For faster machines this value can really be lowered to 200. 250 is adequate, but a little high 177 177 // for dual G5s. :) 178 static const auto layoutScheduleThreshold = std::chrono::milliseconds(250);178 static const auto layoutScheduleThreshold = 250ms; 179 179 180 180 Settings::Settings(Page* page) -
trunk/Source/WebCore/page/mac/ServicesOverlayController.mm
r201255 r202198 437 437 { 438 438 if (!highlight) 439 return std::chrono::milliseconds::zero();439 return 0ms; 440 440 441 441 auto minimumTimeUntilHighlightShouldBeShown = 200ms; -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r201982 r202198 328 328 { 329 329 if (!m_purgeTimer.isActive()) 330 m_purgeTimer.startOneShot( std::chrono::milliseconds::zero());330 m_purgeTimer.startOneShot(0ms); 331 331 332 332 FontPlatformData* platformData = getCachedFontPlatformData(fontDescription, family, fontFaceFeatures, fontFaceVariantSettings, checkingAlternateName); -
trunk/Source/WebCore/platform/network/CacheValidation.cpp
r202188 r202198 104 104 // No compensation for latency as that is not terribly important in practice. 105 105 auto dateValue = response.date(); 106 auto apparentAge = dateValue ? std::max( microseconds::zero(), duration_cast<microseconds>(responseTime - dateValue.value())) : microseconds::zero();107 auto ageValue = response.age().valueOr( microseconds::zero());106 auto apparentAge = dateValue ? std::max(0us, duration_cast<microseconds>(responseTime - *dateValue)) : 0us; 107 auto ageValue = response.age().valueOr(0us); 108 108 auto correctedInitialAge = std::max(apparentAge, ageValue); 109 109 auto residentTime = duration_cast<microseconds>(system_clock::now() - responseTime); … … 120 120 auto maxAge = response.cacheControlMaxAge(); 121 121 if (maxAge) 122 return maxAge.value();123 auto expires = response.expires(); 122 return *maxAge; 123 124 124 auto date = response.date(); 125 auto dateValue = date ? date.value() : responseTime;126 if ( expires)127 return duration_cast<microseconds>( expires.value() - dateValue);125 auto effectiveDate = date.valueOr(responseTime); 126 if (auto expires = response.expires()) 127 return duration_cast<microseconds>(*expires - effectiveDate); 128 128 129 129 // Implicit lifetime. … … 132 132 case 410: // Gone 133 133 // These are semantically permanent and so get long implicit lifetime. 134 return hours(365 * 24);134 return 365 * 24h; 135 135 default: 136 136 // Heuristic Freshness: 137 137 // http://tools.ietf.org/html/rfc7234#section-4.2.2 138 auto lastModified = response.lastModified(); 139 if (lastModified) 140 return duration_cast<microseconds>((dateValue - lastModified.value()) * 0.1); 141 return microseconds::zero(); 138 if (auto lastModified = response.lastModified()) 139 return duration_cast<microseconds>((effectiveDate - *lastModified) * 0.1); 140 return 0us; 142 141 } 143 142 }
Note:
See TracChangeset
for help on using the changeset viewer.