Diff
Modified: trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp (208981 => 208982)
--- trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/_javascript_Core/runtime/AtomicsObject.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -315,7 +315,7 @@
// exec->argument(3) returns undefined if it's not provided and ToNumber(undefined) returns NaN,
// so NaN is the only special case.
if (timeout == timeout)
- timeout = std::max(Seconds(0), timeout);
+ timeout = std::max(0_s, timeout);
else
timeout = Seconds::infinity();
Modified: trunk/Source/WTF/ChangeLog (208981 => 208982)
--- trunk/Source/WTF/ChangeLog 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WTF/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
@@ -1,5 +1,17 @@
2016-11-26 Simon Fraser <[email protected]>
+ Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
+ https://bugs.webkit.org/show_bug.cgi?id=164992
+
+ Reviewed by Darin Adler.
+
+ Add Seconds::zero() as a nicer way to express Seconds(0).
+
+ * wtf/Seconds.h:
+ (WTF::Seconds::zero):
+
+2016-11-26 Simon Fraser <[email protected]>
+
Add literals for various time units
https://bugs.webkit.org/show_bug.cgi?id=165074
Modified: trunk/Source/WTF/wtf/AutomaticThread.cpp (208981 => 208982)
--- trunk/Source/WTF/wtf/AutomaticThread.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WTF/wtf/AutomaticThread.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -181,7 +181,7 @@
RELEASE_ASSERT(result == PollResult::Wait);
// Shut the thread down after one second.
bool awokenByNotify =
- m_condition->m_condition.waitFor(*m_lock, Seconds(1));
+ m_condition->m_condition.waitFor(*m_lock, 1_s);
if (!awokenByNotify) {
if (verbose)
dataLog(RawPointer(this), ": Going to sleep!\n");
Modified: trunk/Source/WTF/wtf/Seconds.h (208981 => 208982)
--- trunk/Source/WTF/wtf/Seconds.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WTF/wtf/Seconds.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -201,6 +201,8 @@
double m_value { 0 };
};
+inline namespace seconds_literals {
+
constexpr Seconds operator"" _min(long double minutes)
{
return Seconds::fromMinutes(minutes);
@@ -251,10 +253,13 @@
return Seconds::fromNanoseconds(nanoseconds);
}
+} // inline seconds_literals
+
WTF_EXPORT_PRIVATE void sleep(Seconds);
-} // namespae WTF
+} // namespace WTF
+using namespace WTF::seconds_literals;
using WTF::Seconds;
#endif // WTF_Seconds_h
Modified: trunk/Source/WebCore/ChangeLog (208981 => 208982)
--- trunk/Source/WebCore/ChangeLog 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
@@ -1,5 +1,43 @@
2016-11-26 Simon Fraser <[email protected]>
+ Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
+ https://bugs.webkit.org/show_bug.cgi?id=164992
+
+ Reviewed by Darin Adler.
+
+ std::chrono::milliseconds -> Seconds.
+
+ Rename Document::elapsedTime() to timeSinceDocumentCreation() which is more explicit.
+
+ Replace INSTRUMENT_LAYOUT_SCHEDULING with LOG(Layout...).
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::implicitClose):
+ (WebCore::Document::isLayoutTimerActive):
+ (WebCore::Document::minimumLayoutDelay):
+ (WebCore::Document::timeSinceDocumentCreation):
+ (WebCore::Document::elapsedTime): Deleted.
+ * dom/Document.h:
+ * page/ChromeClient.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ (WebCore::FrameView::scrollPositionChanged):
+ (WebCore::FrameView::layoutTimerFired):
+ (WebCore::FrameView::scheduleRelayout):
+ (WebCore::FrameView::scheduleRelayoutOfSubtree):
+ (WebCore::FrameView::unscheduleRelayout):
+ * page/Settings.cpp:
+ (WebCore::Settings::setLayoutInterval):
+ * page/Settings.h:
+ (WebCore::Settings::layoutInterval):
+ * style/StyleScope.cpp:
+ (WebCore::Style::Scope::removePendingSheet):
+ * workers/WorkerRunLoop.cpp:
+ (WebCore::WorkerRunLoop::runInMode):
+
+2016-11-26 Simon Fraser <[email protected]>
+
Composited negative z-index elements are hidden behind the body sometimes
https://bugs.webkit.org/show_bug.cgi?id=165080
rdar://problem/22260229
Modified: trunk/Source/WebCore/dom/Document.cpp (208981 => 208982)
--- trunk/Source/WebCore/dom/Document.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -468,7 +468,7 @@
, m_cssTarget(nullptr)
, m_processingLoadEvent(false)
, m_loadEventFinished(false)
- , m_startTime(std::chrono::steady_clock::now())
+ , m_documentCreationTime(MonotonicTime::now())
, m_overMinimumLayoutThreshold(false)
, m_scriptRunner(std::make_unique<ScriptRunner>(*this))
, m_moduleLoader(std::make_unique<ScriptModuleLoader>(*this))
@@ -2696,7 +2696,7 @@
// fires. This will improve onload scores, and other browsers do it.
// If they wanna cheat, we can too. -dwh
- if (frame()->navigationScheduler().locationChangePending() && elapsedTime() < settings()->layoutInterval()) {
+ if (frame()->navigationScheduler().locationChangePending() && timeSinceDocumentCreation() < settings()->layoutInterval()) {
// Just bail out. Before or during the onload we were shifted to another page.
// The old i-Bench suite does this. When this happens don't bother painting or laying out.
m_processingLoadEvent = false;
@@ -2770,26 +2770,24 @@
bool Document::isLayoutTimerActive()
{
- return view() && view()->layoutPending() && !minimumLayoutDelay().count();
+ return view() && view()->layoutPending() && !minimumLayoutDelay();
}
-std::chrono::milliseconds Document::minimumLayoutDelay()
+Seconds Document::minimumLayoutDelay()
{
if (m_overMinimumLayoutThreshold)
- return 0ms;
+ return 0_s;
- auto elapsed = elapsedTime();
+ auto elapsed = timeSinceDocumentCreation();
m_overMinimumLayoutThreshold = elapsed > settings()->layoutInterval();
// We'll want to schedule the timer to fire at the minimum layout threshold.
- return std::max(0ms, settings()->layoutInterval() - elapsed);
+ return std::max(0_s, settings()->layoutInterval() - elapsed);
}
-std::chrono::milliseconds Document::elapsedTime() const
+Seconds Document::timeSinceDocumentCreation() const
{
- auto elapsedTime = std::chrono::steady_clock::now() - m_startTime;
-
- return std::chrono::duration_cast<std::chrono::milliseconds>(elapsedTime);
+ return MonotonicTime::now() - m_documentCreationTime;
}
void Document::write(const SegmentedString& text, Document* ownerDocument)
Modified: trunk/Source/WebCore/dom/Document.h (208981 => 208982)
--- trunk/Source/WebCore/dom/Document.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/dom/Document.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -671,11 +671,11 @@
void setReadyState(ReadyState);
void setParsing(bool);
bool parsing() const { return m_bParsing; }
- std::chrono::milliseconds minimumLayoutDelay();
+ Seconds minimumLayoutDelay();
bool shouldScheduleLayout();
bool isLayoutTimerActive();
- std::chrono::milliseconds elapsedTime() const;
+ Seconds timeSinceDocumentCreation() const;
void setTextColor(const Color& color) { m_textColor = color; }
const Color& textColor() const { return m_textColor; }
@@ -1527,7 +1527,7 @@
bool m_loadEventFinished;
RefPtr<SerializedScriptValue> m_pendingStateObject;
- std::chrono::steady_clock::time_point m_startTime;
+ MonotonicTime m_documentCreationTime;
bool m_overMinimumLayoutThreshold;
std::unique_ptr<ScriptRunner> m_scriptRunner;
Modified: trunk/Source/WebCore/page/ChromeClient.h (208981 => 208982)
--- trunk/Source/WebCore/page/ChromeClient.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/page/ChromeClient.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -233,7 +233,7 @@
virtual void didPreventDefaultForEvent() = 0;
#endif
- virtual Seconds eventThrottlingDelay() { return Seconds(0); };
+ virtual Seconds eventThrottlingDelay() { return 0_s; };
#if PLATFORM(IOS)
virtual void didReceiveMobileDocType(bool) = 0;
Modified: trunk/Source/WebCore/page/FrameView.cpp (208981 => 208982)
--- trunk/Source/WebCore/page/FrameView.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/page/FrameView.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -1398,9 +1398,9 @@
}
}
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+#if !LOG_DISABLED
if (m_firstLayout && !frame().ownerElement())
- printf("Elapsed time before first layout: %lld\n", document.elapsedTime().count());
+ LOG(Layout, "FrameView %p elapsed time before first layout: %.3fs\n", this, document.timeSinceDocumentCreation().value());
#endif
}
@@ -2437,9 +2437,9 @@
void FrameView::scrollPositionChanged(const ScrollPosition& oldPosition, const ScrollPosition& newPosition)
{
Page* page = frame().page();
- Seconds throttlingDelay = page ? page->chrome().client().eventThrottlingDelay() : Seconds(0);
+ Seconds throttlingDelay = page ? page->chrome().client().eventThrottlingDelay() : 0_s;
- if (throttlingDelay == Seconds(0)) {
+ if (throttlingDelay == 0_s) {
m_delayedScrollEventTimer.stop();
sendScrollEvent();
} else if (!m_delayedScrollEventTimer.isActive())
@@ -2874,9 +2874,9 @@
void FrameView::layoutTimerFired()
{
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+#if !LOG_DISABLED
if (!frame().document()->ownerElement())
- printf("Layout timer fired at %lld\n", frame().document()->elapsedTime().count());
+ LOG(Layout, "FrameView %p layout timer fired at %.3fs", this, frame().document()->timeSinceDocumentCreation().value());
#endif
layout();
}
@@ -2901,17 +2901,18 @@
if (frame().ownerRenderer() && isInChildFrameWithFrameFlattening())
frame().ownerRenderer()->setNeedsLayout(MarkContainingBlockChain);
- std::chrono::milliseconds delay = frame().document()->minimumLayoutDelay();
- if (m_layoutTimer.isActive() && m_delayedLayout && !delay.count())
+ Seconds delay = frame().document()->minimumLayoutDelay();
+ if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
unscheduleRelayout();
+
if (m_layoutTimer.isActive())
return;
- m_delayedLayout = delay.count();
+ m_delayedLayout = delay.value();
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+#if !LOG_DISABLED
if (!frame().document()->ownerElement())
- printf("Scheduling layout for %d\n", delay);
+ LOG(Layout, "FrameView %p scheduling layout for %.3fs", this, delay.value());
#endif
m_layoutTimer.startOneShot(delay);
@@ -2944,11 +2945,11 @@
}
if (!layoutPending() && m_layoutSchedulingEnabled) {
- std::chrono::milliseconds delay = renderView.document().minimumLayoutDelay();
+ Seconds delay = renderView.document().minimumLayoutDelay();
ASSERT(!newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout());
m_layoutRoot = &newRelayoutRoot;
InspectorInstrumentation::didInvalidateLayout(frame());
- m_delayedLayout = delay.count();
+ m_delayedLayout = delay.value();
m_layoutTimer.startOneShot(delay);
return;
}
@@ -3041,9 +3042,9 @@
if (!m_layoutTimer.isActive())
return;
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+#if !LOG_DISABLED
if (!frame().document()->ownerElement())
- printf("Layout timer unscheduled at %d\n", frame().document()->elapsedTime());
+ LOG(Layout, "FrameView %p layout timer unscheduled at %.3fs", this, frame().document()->timeSinceDocumentCreation().value());
#endif
m_layoutTimer.stop();
Modified: trunk/Source/WebCore/page/Settings.cpp (208981 => 208982)
--- trunk/Source/WebCore/page/Settings.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/page/Settings.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -184,7 +184,7 @@
// This amount of time must have elapsed before we will even consider scheduling a layout without a delay.
// FIXME: For faster machines this value can really be lowered to 200. 250 is adequate, but a little high
// for dual G5s. :)
-static const auto layoutScheduleThreshold = 250ms;
+static const Seconds layoutScheduleThreshold = 250_ms;
Settings::Settings(Page* page)
: m_page(nullptr)
@@ -461,7 +461,7 @@
}
}
-void Settings::setLayoutInterval(std::chrono::milliseconds layoutInterval)
+void Settings::setLayoutInterval(Seconds layoutInterval)
{
// FIXME: It seems weird that this function may disregard the specified layout interval.
// We should either expose layoutScheduleThreshold or better communicate this invariant.
Modified: trunk/Source/WebCore/page/Settings.h (208981 => 208982)
--- trunk/Source/WebCore/page/Settings.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/page/Settings.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -172,8 +172,8 @@
WEBCORE_EXPORT void setMinimumDOMTimerInterval(std::chrono::milliseconds); // Initialized to DOMTimer::defaultMinimumInterval().
std::chrono::milliseconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
- WEBCORE_EXPORT void setLayoutInterval(std::chrono::milliseconds);
- std::chrono::milliseconds layoutInterval() const { return m_layoutInterval; }
+ WEBCORE_EXPORT void setLayoutInterval(Seconds);
+ Seconds layoutInterval() const { return m_layoutInterval; }
bool hiddenPageDOMTimerThrottlingEnabled() const { return m_hiddenPageDOMTimerThrottlingEnabled; }
WEBCORE_EXPORT void setHiddenPageDOMTimerThrottlingEnabled(bool);
@@ -325,7 +325,7 @@
URL m_userStyleSheetLocation;
const std::unique_ptr<FontGenericFamilies> m_fontGenericFamilies;
SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
- std::chrono::milliseconds m_layoutInterval;
+ Seconds m_layoutInterval;
std::chrono::milliseconds m_minimumDOMTimerInterval;
SETTINGS_MEMBER_VARIABLES
Modified: trunk/Source/WebCore/style/StyleScope.cpp (208981 => 208982)
--- trunk/Source/WebCore/style/StyleScope.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/style/StyleScope.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -149,12 +149,6 @@
ASSERT(m_pendingStyleSheetCount > 0);
m_pendingStyleSheetCount--;
-
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (!ownerElement())
- printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", elapsedTime(), m_pendingStylesheets);
-#endif
-
if (m_pendingStyleSheetCount)
return;
Modified: trunk/Source/WebCore/workers/WorkerRunLoop.cpp (208981 => 208982)
--- trunk/Source/WebCore/workers/WorkerRunLoop.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebCore/workers/WorkerRunLoop.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -163,8 +163,7 @@
#if USE(CF)
CFAbsoluteTime nextCFRunLoopTimerFireDate = CFRunLoopGetNextTimerFireDate(CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
double timeUntilNextCFRunLoopTimerInSeconds = nextCFRunLoopTimerFireDate - CFAbsoluteTimeGetCurrent();
- deadline = WallTime::now() + std::max(
- Seconds(0), Seconds(timeUntilNextCFRunLoopTimerInSeconds));
+ deadline = WallTime::now() + std::max(0_s, Seconds(timeUntilNextCFRunLoopTimerInSeconds));
#endif
WallTime absoluteTime;
Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (208981 => 208982)
--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -339,8 +339,8 @@
- (BOOL)_alwaysRequestGeolocationPermission;
- (void)_setAlwaysUseAcceleratedOverflowScroll:(BOOL)flag;
- (BOOL)_alwaysUseAcceleratedOverflowScroll;
-- (void)_setLayoutInterval:(int)l;
-- (int)_layoutInterval;
+- (void)_setLayoutInterval:(int)milliseconds;
+- (int)_layoutInterval; // Milliseonds.
- (void)_setMaxParseDuration:(float)d;
- (float)_maxParseDuration;
- (void)_setInterpolationQuality:(int)quality;
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (208981 => 208982)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-11-27 02:27:55 UTC (rev 208982)
@@ -2736,7 +2736,7 @@
settings.setStandalone([preferences _standalone]);
settings.setTelephoneNumberParsingEnabled([preferences _telephoneNumberParsingEnabled]);
settings.setAllowMultiElementImplicitSubmission([preferences _allowMultiElementImplicitFormSubmission]);
- settings.setLayoutInterval(std::chrono::milliseconds([preferences _layoutInterval]));
+ settings.setLayoutInterval(Seconds::fromMilliseconds([preferences _layoutInterval]));
settings.setMaxParseDuration([preferences _maxParseDuration]);
settings.setAlwaysUseAcceleratedOverflowScroll([preferences _alwaysUseAcceleratedOverflowScroll]);
settings.setAudioSessionCategoryOverride([preferences audioSessionCategoryOverride]);
Modified: trunk/Source/WebKit2/ChangeLog (208981 => 208982)
--- trunk/Source/WebKit2/ChangeLog 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
@@ -1,3 +1,17 @@
+2016-11-26 Simon Fraser <[email protected]>
+
+ Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
+ https://bugs.webkit.org/show_bug.cgi?id=164992
+
+ Reviewed by Darin Adler.
+
+ No more ugly conversion from seconds to milliseconds.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::eventThrottlingDelay):
+
2016-11-25 Michael Catanzaro <[email protected]>
[GTK] Follow-up fixes to r208974
Modified: trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h (208981 => 208982)
--- trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h 2016-11-27 02:27:55 UTC (rev 208982)
@@ -44,7 +44,7 @@
void terminate();
template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { });
- template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = Seconds(1), OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
+ template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
IPC::Connection* connection() const
{
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (208981 => 208982)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -366,7 +366,7 @@
return;
bool handled = false;
- sendSync(Messages::NetworkProcess::ProcessWillSuspendImminently(), Messages::NetworkProcess::ProcessWillSuspendImminently::Reply(handled), 0, Seconds(1));
+ sendSync(Messages::NetworkProcess::ProcessWillSuspendImminently(), Messages::NetworkProcess::ProcessWillSuspendImminently::Reply(handled), 0, 1_s);
}
void NetworkProcessProxy::sendPrepareToSuspend()
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (208981 => 208982)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -900,7 +900,7 @@
return;
bool handled = false;
- sendSync(Messages::WebProcess::ProcessWillSuspendImminently(), Messages::WebProcess::ProcessWillSuspendImminently::Reply(handled), 0, Seconds(1));
+ sendSync(Messages::WebProcess::ProcessWillSuspendImminently(), Messages::WebProcess::ProcessWillSuspendImminently::Reply(handled), 0, 1_s);
}
void WebProcessProxy::sendPrepareToSuspend()
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (208981 => 208982)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-11-27 02:27:55 UTC (rev 208982)
@@ -313,7 +313,7 @@
double newScale;
FloatPoint newScrollPosition;
uint64_t nextValidLayerTreeTransactionID;
- if (m_process->sendSync(Messages::WebPage::SynchronizeDynamicViewportUpdate(), Messages::WebPage::SynchronizeDynamicViewportUpdate::Reply(newScale, newScrollPosition, nextValidLayerTreeTransactionID), m_pageID, Seconds(2))) {
+ if (m_process->sendSync(Messages::WebPage::SynchronizeDynamicViewportUpdate(), Messages::WebPage::SynchronizeDynamicViewportUpdate::Reply(newScale, newScrollPosition, nextValidLayerTreeTransactionID), m_pageID, 2_s)) {
m_dynamicViewportSizeUpdateWaitingForTarget = false;
m_dynamicViewportSizeUpdateLayerTreeTransactionID = nextValidLayerTreeTransactionID;
m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition, nextValidLayerTreeTransactionID);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (208981 => 208982)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -3112,7 +3112,7 @@
settings.setPasswordEchoEnabled(store.getBoolValueForKey(WebPreferencesKey::passwordEchoEnabledKey()));
settings.setPasswordEchoDurationInSeconds(store.getDoubleValueForKey(WebPreferencesKey::passwordEchoDurationKey()));
- settings.setLayoutInterval(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>(store.getDoubleValueForKey(WebPreferencesKey::layoutIntervalKey()))));
+ settings.setLayoutInterval(Seconds(store.getDoubleValueForKey(WebPreferencesKey::layoutIntervalKey())));
settings.setMaxParseDuration(store.getDoubleValueForKey(WebPreferencesKey::maxParseDurationKey()));
settings.setEnableInheritURIQueryComponent(store.getBoolValueForKey(WebPreferencesKey::enableInheritURIQueryComponentKey()));
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (208981 => 208982)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-11-27 02:27:55 UTC (rev 208982)
@@ -2128,16 +2128,16 @@
if (behaviorOverride) {
switch (behaviorOverride.value()) {
case EventThrottlingBehavior::Responsive:
- return Seconds(0);
+ return 0_s;
case EventThrottlingBehavior::Unresponsive:
- return Seconds(1);
+ return 1_s;
}
}
if (m_isInStableState || m_estimatedLatency <= Seconds(1.0 / 60))
- return Seconds(0);
+ return 0_s;
- return Seconds(std::min<double>(m_estimatedLatency.value() * 2, 1));
+ return std::min(m_estimatedLatency.value() * 2, 1_s);
}
void WebPage::syncApplyAutocorrection(const String& correction, const String& originalText, bool& correctionApplied)
Modified: trunk/Tools/ChangeLog (208981 => 208982)
--- trunk/Tools/ChangeLog 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Tools/ChangeLog 2016-11-27 02:27:55 UTC (rev 208982)
@@ -1,5 +1,16 @@
2016-11-26 Simon Fraser <[email protected]>
+ Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
+ https://bugs.webkit.org/show_bug.cgi?id=164992
+
+ Reviewed by Darin Adler.
+
+ Use Seconds::zero().
+
+ * TestWebKitAPI/Tests/WTF/Condition.cpp:
+
+2016-11-26 Simon Fraser <[email protected]>
+
Add literals for various time units
https://bugs.webkit.org/show_bug.cgi?id=165074
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp (208981 => 208982)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp 2016-11-27 02:06:59 UTC (rev 208981)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Condition.cpp 2016-11-27 02:27:55 UTC (rev 208982)
@@ -81,7 +81,7 @@
unsigned numMessagesPerProducer,
NotifyStyle notifyStyle,
Seconds timeout = Seconds::infinity(),
- Seconds delay = Seconds(0))
+ Seconds delay = 0_s)
{
Deque<unsigned> queue;
bool shouldContinue = true;