Diff
Modified: trunk/Source/WebCore/ChangeLog (213518 => 213519)
--- trunk/Source/WebCore/ChangeLog 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/ChangeLog 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1,5 +1,70 @@
2017-03-07 Chris Dumez <[email protected]>
+ Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+ https://bugs.webkit.org/show_bug.cgi?id=169236
+
+ Reviewed by Simon Fraser.
+
+ * dom/Document.cpp:
+ (WebCore::Document::minimumDOMTimerInterval):
+ (WebCore::Document::timerAlignmentInterval):
+ * dom/Document.h:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
+ (WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
+ (WebCore::ScriptExecutionContext::timerAlignmentInterval):
+ * dom/ScriptExecutionContext.h:
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::didInstallTimer):
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::didInstallTimer):
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/TimelineRecordFactory.cpp:
+ (WebCore::TimelineRecordFactory::createTimerInstallData):
+ * inspector/TimelineRecordFactory.h:
+ * page/DOMTimer.cpp:
+ (WebCore::shouldForwardUserGesture):
+ (WebCore::userGestureTokenToForward):
+ (WebCore::DOMTimer::DOMTimer):
+ (WebCore::DOMTimer::install):
+ (WebCore::DOMTimer::intervalClampedToMinimum):
+ (WebCore::DOMTimer::alignedFireTime):
+ * page/DOMTimer.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::setTimeout):
+ (WebCore::DOMWindow::setInterval):
+ * page/Page.cpp:
+ (WebCore::Page::setTimerThrottlingState):
+ (WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
+ (WebCore::Page::updateDOMTimerAlignmentInterval):
+ * page/Page.h:
+ (WebCore::Page::domTimerAlignmentInterval):
+ * page/Settings.cpp:
+ (WebCore::Settings::setMinimumDOMTimerInterval):
+ * page/Settings.h:
+ (WebCore::Settings::minimumDOMTimerInterval):
+ * page/SuspendableTimer.h:
+ (WebCore::SuspendableTimer::startRepeating):
+ (WebCore::SuspendableTimer::startOneShot):
+ (WebCore::SuspendableTimer::augmentFireInterval):
+ (WebCore::SuspendableTimer::augmentRepeatInterval):
+ * platform/Timer.cpp:
+ (WebCore::TimerBase::setNextFireTime):
+ * platform/Timer.h:
+ (WebCore::TimerBase::alignedFireTime):
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::setMinimumTimerInterval):
+ * testing/InternalSettings.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::isTimerThrottled):
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::setTimeout):
+ (WebCore::WorkerGlobalScope::setInterval):
+
+2017-03-07 Chris Dumez <[email protected]>
+
Align initEvent / initCustomEvent / initMessageEvent with the latest specification
https://bugs.webkit.org/show_bug.cgi?id=169176
Modified: trunk/Source/WebCore/dom/Document.cpp (213518 => 213519)
--- trunk/Source/WebCore/dom/Document.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/Document.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -2843,11 +2843,11 @@
write(WTFMove(textWithNewline), ownerDocument);
}
-std::chrono::milliseconds Document::minimumTimerInterval() const
+Seconds Document::minimumDOMTimerInterval() const
{
auto* page = this->page();
if (!page)
- return ScriptExecutionContext::minimumTimerInterval();
+ return ScriptExecutionContext::minimumDOMTimerInterval();
return page->settings().minimumDOMTimerInterval();
}
@@ -2860,9 +2860,9 @@
didChangeTimerAlignmentInterval();
}
-std::chrono::milliseconds Document::timerAlignmentInterval(bool hasReachedMaxNestingLevel) const
+Seconds Document::domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const
{
- auto alignmentInterval = ScriptExecutionContext::timerAlignmentInterval(hasReachedMaxNestingLevel);
+ auto alignmentInterval = ScriptExecutionContext::domTimerAlignmentInterval(hasReachedMaxNestingLevel);
if (!hasReachedMaxNestingLevel)
return alignmentInterval;
Modified: trunk/Source/WebCore/dom/Document.h (213518 => 213519)
--- trunk/Source/WebCore/dom/Document.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/Document.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1327,9 +1327,9 @@
void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, RefPtr<Inspector::ScriptCallStack>&&, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0) final;
- std::chrono::milliseconds minimumTimerInterval() const final;
+ Seconds minimumDOMTimerInterval() const final;
- std::chrono::milliseconds timerAlignmentInterval(bool hasReachedMaxNestingLevel) const final;
+ Seconds domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const final;
void updateTitleFromTitleElement();
void updateTitle(const StringWithDirection&);
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (213518 => 213519)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -427,15 +427,15 @@
return *m_publicURLManager;
}
-void ScriptExecutionContext::adjustMinimumTimerInterval(std::chrono::milliseconds oldMinimumTimerInterval)
+void ScriptExecutionContext::adjustMinimumDOMTimerInterval(Seconds oldMinimumTimerInterval)
{
- if (minimumTimerInterval() != oldMinimumTimerInterval) {
+ if (minimumDOMTimerInterval() != oldMinimumTimerInterval) {
for (auto& timer : m_timeouts.values())
timer->updateTimerIntervalIfNecessary();
}
}
-std::chrono::milliseconds ScriptExecutionContext::minimumTimerInterval() const
+Seconds ScriptExecutionContext::minimumDOMTimerInterval() const
{
// The default implementation returns the DOMTimer's default
// minimum timer interval. FIXME: to make it work with dedicated
@@ -451,7 +451,7 @@
timer->didChangeAlignmentInterval();
}
-std::chrono::milliseconds ScriptExecutionContext::timerAlignmentInterval(bool) const
+Seconds ScriptExecutionContext::domTimerAlignmentInterval(bool) const
{
return DOMTimer::defaultAlignmentInterval();
}
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (213518 => 213519)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -189,12 +189,11 @@
WEBCORE_EXPORT JSC::VM& vm();
- // Interval is in seconds.
- void adjustMinimumTimerInterval(std::chrono::milliseconds oldMinimumTimerInterval);
- virtual std::chrono::milliseconds minimumTimerInterval() const;
+ void adjustMinimumDOMTimerInterval(Seconds oldMinimumTimerInterval);
+ virtual Seconds minimumDOMTimerInterval() const;
void didChangeTimerAlignmentInterval();
- virtual std::chrono::milliseconds timerAlignmentInterval(bool hasReachedMaxNestingLevel) const;
+ virtual Seconds domTimerAlignmentInterval(bool hasReachedMaxNestingLevel) const;
virtual EventQueue& eventQueue() const = 0;
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (213518 => 213519)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -336,7 +336,7 @@
domDebuggerAgent->willSendXMLHttpRequest(url);
}
-void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext& context)
+void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, Seconds timeout, bool singleShot, ScriptExecutionContext& context)
{
pauseOnNativeEventIfNeeded(instrumentingAgents, false, setTimerEventName, true);
didScheduleAsyncCall(instrumentingAgents, AsyncCallTypeTimer, timerId, context, singleShot);
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (213518 => 213519)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -123,7 +123,7 @@
static bool forcePseudoState(const Element&, CSSSelector::PseudoClassType);
static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
- static void didInstallTimer(ScriptExecutionContext&, int timerId, std::chrono::milliseconds timeout, bool singleShot);
+ static void didInstallTimer(ScriptExecutionContext&, int timerId, Seconds timeout, bool singleShot);
static void didRemoveTimer(ScriptExecutionContext&, int timerId);
static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
@@ -293,7 +293,7 @@
static bool forcePseudoStateImpl(InstrumentingAgents&, const Element&, CSSSelector::PseudoClassType);
static void willSendXMLHttpRequestImpl(InstrumentingAgents&, const String& url);
- static void didInstallTimerImpl(InstrumentingAgents&, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext&);
+ static void didInstallTimerImpl(InstrumentingAgents&, int timerId, Seconds timeout, bool singleShot, ScriptExecutionContext&);
static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
@@ -642,7 +642,7 @@
willSendXMLHttpRequestImpl(*instrumentingAgents, url);
}
-inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext& context, int timerId, std::chrono::milliseconds timeout, bool singleShot)
+inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext& context, int timerId, Seconds timeout, bool singleShot)
{
FAST_RETURN_IF_NO_FRONTENDS(void());
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (213518 => 213519)
--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -384,7 +384,7 @@
didCompleteCurrentRecord(TimelineRecordType::Paint);
}
-void InspectorTimelineAgent::didInstallTimer(int timerId, std::chrono::milliseconds timeout, bool singleShot, Frame* frame)
+void InspectorTimelineAgent::didInstallTimer(int timerId, Seconds timeout, bool singleShot, Frame* frame)
{
appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall, true, frame);
}
Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (213518 => 213519)
--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -112,7 +112,7 @@
void stopFromConsole(JSC::ExecState*, const String& title);
// InspectorInstrumentation
- void didInstallTimer(int timerId, std::chrono::milliseconds timeout, bool singleShot, Frame*);
+ void didInstallTimer(int timerId, Seconds timeout, bool singleShot, Frame*);
void didRemoveTimer(int timerId, Frame*);
void willFireTimer(int timerId, Frame*);
void didFireTimer();
Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (213518 => 213519)
--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -94,11 +94,11 @@
return data;
}
-Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, std::chrono::milliseconds timeout, bool singleShot)
+Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, Seconds timeout, bool singleShot)
{
Ref<InspectorObject> data = ""
data->setInteger(ASCIILiteral("timerId"), timerId);
- data->setInteger(ASCIILiteral("timeout"), (int)timeout.count());
+ data->setInteger(ASCIILiteral("timeout"), (int)timeout.milliseconds());
data->setBoolean(ASCIILiteral("singleShot"), singleShot);
return data;
}
Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.h (213518 => 213519)
--- trunk/Source/WebCore/inspector/TimelineRecordFactory.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -53,7 +53,7 @@
static Ref<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
static Ref<Inspector::InspectorObject> createEventDispatchData(const Event&);
static Ref<Inspector::InspectorObject> createGenericTimerData(int timerId);
- static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, std::chrono::milliseconds timeout, bool singleShot);
+ static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, Seconds timeout, bool singleShot);
static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
Modified: trunk/Source/WebCore/page/DOMTimer.cpp (213518 => 213519)
--- trunk/Source/WebCore/page/DOMTimer.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMTimer.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -52,8 +52,8 @@
namespace WebCore {
-static const auto maxIntervalForUserGestureForwarding = 1000ms; // One second matches Gecko.
-static const auto minIntervalForNonUserObservableChangeTimers = 1000ms; // Empirically determined to maximize battery life.
+static const Seconds maxIntervalForUserGestureForwarding { 1_s }; // One second matches Gecko.
+static const Seconds minIntervalForNonUserObservableChangeTimers { 1_s }; // Empirically determined to maximize battery life.
static const int maxTimerNestingLevel = 5;
class DOMTimerFireState {
@@ -161,7 +161,7 @@
bool NestedTimersMap::isTrackingNestedTimers = false;
-static inline bool shouldForwardUserGesture(std::chrono::milliseconds interval, int nestingLevel)
+static inline bool shouldForwardUserGesture(Seconds interval, int nestingLevel)
{
return UserGestureIndicator::processingUserGesture()
&& interval <= maxIntervalForUserGestureForwarding
@@ -168,7 +168,7 @@
&& !nestingLevel; // Gestures should not be forwarded to nested timers.
}
-static inline RefPtr<UserGestureToken> userGestureTokenToForward(std::chrono::milliseconds interval, int nestingLevel)
+static inline RefPtr<UserGestureToken> userGestureTokenToForward(Seconds interval, int nestingLevel)
{
if (!shouldForwardUserGesture(interval, nestingLevel))
return nullptr;
@@ -176,7 +176,7 @@
return UserGestureIndicator::currentUserGesture();
}
-DOMTimer::DOMTimer(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, std::chrono::milliseconds interval, bool singleShot)
+DOMTimer::DOMTimer(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, Seconds interval, bool singleShot)
: SuspendableTimer(context)
, m_nestingLevel(context.timerNestingLevel())
, m_action(WTFMove(action))
@@ -202,7 +202,7 @@
{
}
-int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, std::chrono::milliseconds timeout, bool singleShot)
+int DOMTimer::install(ScriptExecutionContext& context, std::unique_ptr<ScheduledAction> action, Seconds timeout, bool singleShot)
{
// DOMTimer constructor passes ownership of the initial ref on the object to the constructor.
// This reference will be released automatically when a one-shot timer fires, when the context
@@ -211,7 +211,7 @@
#if PLATFORM(IOS)
if (is<Document>(context)) {
bool didDeferTimeout = context.activeDOMObjectsAreSuspended();
- if (!didDeferTimeout && timeout.count() <= 100 && singleShot) {
+ if (!didDeferTimeout && timeout <= 100_ms && singleShot) {
WKSetObservedContentChange(WKContentIndeterminateChange);
WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
}
@@ -400,21 +400,21 @@
return;
if (repeatInterval()) {
- ASSERT(repeatIntervalMS() == previousInterval);
- LOG(DOMTimers, "%p - Updating DOMTimer's repeat interval from %" PRId64 " ms to %" PRId64 " ms due to throttling.", this, previousInterval.count(), m_currentTimerInterval.count());
+ ASSERT(repeatIntervalSeconds() == previousInterval);
+ LOG(DOMTimers, "%p - Updating DOMTimer's repeat interval from %.2f ms to %.2f ms due to throttling.", this, previousInterval.milliseconds(), m_currentTimerInterval.milliseconds());
augmentRepeatInterval(m_currentTimerInterval - previousInterval);
} else {
- LOG(DOMTimers, "%p - Updating DOMTimer's fire interval from %" PRId64 " ms to %" PRId64 " ms due to throttling.", this, previousInterval.count(), m_currentTimerInterval.count());
+ LOG(DOMTimers, "%p - Updating DOMTimer's fire interval from %.2f ms to %.2f ms due to throttling.", this, previousInterval.milliseconds(), m_currentTimerInterval.milliseconds());
augmentFireInterval(m_currentTimerInterval - previousInterval);
}
}
-std::chrono::milliseconds DOMTimer::intervalClampedToMinimum() const
+Seconds DOMTimer::intervalClampedToMinimum() const
{
ASSERT(scriptExecutionContext());
ASSERT(m_nestingLevel <= maxTimerNestingLevel);
- auto interval = std::max(1ms, m_originalInterval);
+ Seconds interval = std::max(1_ms, m_originalInterval);
// Only apply throttling to repeating timers.
if (m_nestingLevel < maxTimerNestingLevel)
@@ -421,24 +421,24 @@
return interval;
// Apply two throttles - the global (per Page) minimum, and also a per-timer throttle.
- interval = std::max(interval, scriptExecutionContext()->minimumTimerInterval());
+ interval = std::max(interval, scriptExecutionContext()->minimumDOMTimerInterval());
if (m_throttleState == ShouldThrottle)
interval = std::max(interval, minIntervalForNonUserObservableChangeTimers);
return interval;
}
-std::optional<std::chrono::milliseconds> DOMTimer::alignedFireTime(std::chrono::milliseconds fireTime) const
+std::optional<Seconds> DOMTimer::alignedFireTime(Seconds fireTime) const
{
- auto alignmentInterval = scriptExecutionContext()->timerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel);
- if (alignmentInterval == 0ms)
+ Seconds alignmentInterval = scriptExecutionContext()->domTimerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel);
+ if (!alignmentInterval)
return std::nullopt;
static const double randomizedProportion = randomNumber();
// Force alignment to randomizedAlignment fraction of the way between alignemntIntervals, e.g.
- // if alignmentInterval is 10 and randomizedAlignment is 0.3 this will align to 3, 13, 23, ...
- auto randomizedOffset = std::chrono::duration_cast<std::chrono::milliseconds>(alignmentInterval * randomizedProportion);
- auto adjustedFireTime = fireTime - randomizedOffset;
+ // if alignmentInterval is 10_ms and randomizedAlignment is 0.3 this will align to 3, 13, 23, ...
+ Seconds randomizedOffset = alignmentInterval * randomizedProportion;
+ Seconds adjustedFireTime = fireTime - randomizedOffset;
return adjustedFireTime - (adjustedFireTime % alignmentInterval) + alignmentInterval + randomizedOffset;
}
Modified: trunk/Source/WebCore/page/DOMTimer.h (213518 => 213519)
--- trunk/Source/WebCore/page/DOMTimer.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMTimer.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -30,6 +30,7 @@
#include "UserGestureIndicator.h"
#include <memory>
#include <wtf/RefCounted.h>
+#include <wtf/Seconds.h>
namespace WebCore {
@@ -44,13 +45,13 @@
public:
virtual ~DOMTimer();
- static std::chrono::milliseconds defaultMinimumInterval() { return 4ms; }
- static std::chrono::milliseconds defaultAlignmentInterval() { return 0ms; }
- static std::chrono::milliseconds hiddenPageAlignmentInterval() { return 1000ms; }
+ static Seconds defaultMinimumInterval() { return 4_ms; }
+ static Seconds defaultAlignmentInterval() { return 0_s; }
+ static Seconds hiddenPageAlignmentInterval() { return 1_s; }
// Creates a new timer owned by specified ScriptExecutionContext, starts it
// and returns its Id.
- static int install(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, std::chrono::milliseconds timeout, bool singleShot);
+ static int install(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, Seconds timeout, bool singleShot);
static void removeById(ScriptExecutionContext&, int timeoutId);
// Notify that the interval may need updating (e.g. because the minimum interval
@@ -60,10 +61,10 @@
static void scriptDidInteractWithPlugin(HTMLPlugInElement&);
private:
- DOMTimer(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, std::chrono::milliseconds interval, bool singleShot);
+ DOMTimer(ScriptExecutionContext&, std::unique_ptr<ScheduledAction>, Seconds interval, bool singleShot);
friend class Internals;
- WEBCORE_EXPORT std::chrono::milliseconds intervalClampedToMinimum() const;
+ WEBCORE_EXPORT Seconds intervalClampedToMinimum() const;
bool isDOMTimersThrottlingEnabled(Document&) const;
void updateThrottlingStateIfNecessary(const DOMTimerFireState&);
@@ -71,7 +72,7 @@
// SuspendableTimer
void fired() override;
void didStop() override;
- WEBCORE_EXPORT std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const override;
+ WEBCORE_EXPORT std::optional<Seconds> alignedFireTime(Seconds) const override;
// ActiveDOMObject API.
const char* activeDOMObjectName() const override;
@@ -85,9 +86,9 @@
int m_timeoutId;
int m_nestingLevel;
std::unique_ptr<ScheduledAction> m_action;
- std::chrono::milliseconds m_originalInterval;
+ Seconds m_originalInterval;
TimerThrottleState m_throttleState;
- std::chrono::milliseconds m_currentTimerInterval;
+ Seconds m_currentTimerInterval;
RefPtr<UserGestureToken> m_userGestureTokenToForward;
};
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (213518 => 213519)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1663,7 +1663,7 @@
auto* context = scriptExecutionContext();
if (!context)
return Exception { INVALID_ACCESS_ERR };
- return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), true);
+ return DOMTimer::install(*context, WTFMove(action), Seconds::fromMilliseconds(timeout), true);
}
void DOMWindow::clearTimeout(int timeoutId)
@@ -1695,7 +1695,7 @@
auto* context = scriptExecutionContext();
if (!context)
return Exception { INVALID_ACCESS_ERR };
- return DOMTimer::install(*context, WTFMove(action), std::chrono::milliseconds(timeout), false);
+ return DOMTimer::install(*context, WTFMove(action), Seconds::fromMilliseconds(timeout), false);
}
void DOMWindow::clearInterval(int timeoutId)
Modified: trunk/Source/WebCore/page/Page.cpp (213518 => 213519)
--- trunk/Source/WebCore/page/Page.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Page.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -234,8 +234,8 @@
#if ENABLE(VIEW_MODE_CSS_MEDIA)
, m_viewMode(ViewModeWindowed)
#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
- , m_timerAlignmentInterval(DOMTimer::defaultAlignmentInterval())
- , m_timerAlignmentIntervalIncreaseTimer(*this, &Page::timerAlignmentIntervalIncreaseTimerFired)
+ , m_domTimerAlignmentInterval(DOMTimer::defaultAlignmentInterval())
+ , m_domTimerAlignmentIntervalIncreaseTimer(*this, &Page::domTimerAlignmentIntervalIncreaseTimerFired)
, m_isEditable(false)
, m_isPrerender(false)
, m_activityState(PageInitialActivityState)
@@ -1320,7 +1320,7 @@
return;
m_timerThrottlingState = state;
- m_timerThrottlingStateLastChangedTime = std::chrono::steady_clock::now();
+ m_timerThrottlingStateLastChangedTime = MonotonicTime::now();
updateDOMTimerAlignmentInterval();
@@ -1333,12 +1333,12 @@
}
}
-void Page::setTimerAlignmentIntervalIncreaseLimit(std::chrono::milliseconds limit)
+void Page::setDOMTimerAlignmentIntervalIncreaseLimit(Seconds limit)
{
- m_timerAlignmentIntervalIncreaseLimit = limit;
+ m_domTimerAlignmentIntervalIncreaseLimit = limit;
- // If (m_timerAlignmentIntervalIncreaseLimit < m_timerAlignmentInterval) then we need
- // to update m_timerAlignmentInterval, if greater then need to restart the increase timer.
+ // If (m_domTimerAlignmentIntervalIncreaseLimit < m_domTimerAlignmentInterval) then we need
+ // to update m_domTimerAlignmentInterval, if greater then need to restart the increase timer.
if (m_timerThrottlingState == TimerThrottlingState::EnabledIncreasing)
updateDOMTimerAlignmentInterval();
}
@@ -1349,28 +1349,28 @@
switch (m_timerThrottlingState) {
case TimerThrottlingState::Disabled:
- m_timerAlignmentInterval = DOMTimer::defaultAlignmentInterval();
+ m_domTimerAlignmentInterval = DOMTimer::defaultAlignmentInterval();
break;
case TimerThrottlingState::Enabled:
- m_timerAlignmentInterval = DOMTimer::hiddenPageAlignmentInterval();
+ m_domTimerAlignmentInterval = DOMTimer::hiddenPageAlignmentInterval();
break;
case TimerThrottlingState::EnabledIncreasing:
// For pages in prerender state maximum throttling kicks in immediately.
if (m_isPrerender)
- m_timerAlignmentInterval = m_timerAlignmentIntervalIncreaseLimit;
+ m_domTimerAlignmentInterval = m_domTimerAlignmentIntervalIncreaseLimit;
else {
- ASSERT(m_timerThrottlingStateLastChangedTime.time_since_epoch() != std::chrono::steady_clock::duration::zero());
- m_timerAlignmentInterval = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - m_timerThrottlingStateLastChangedTime);
+ ASSERT(!!m_timerThrottlingStateLastChangedTime);
+ m_domTimerAlignmentInterval = MonotonicTime::now() - m_timerThrottlingStateLastChangedTime;
// If we're below the limit, set the timer. If above, clamp to limit.
- if (m_timerAlignmentInterval < m_timerAlignmentIntervalIncreaseLimit)
+ if (m_domTimerAlignmentInterval < m_domTimerAlignmentIntervalIncreaseLimit)
needsIncreaseTimer = true;
else
- m_timerAlignmentInterval = m_timerAlignmentIntervalIncreaseLimit;
+ m_domTimerAlignmentInterval = m_domTimerAlignmentIntervalIncreaseLimit;
}
// Alignment interval should not be less than DOMTimer::hiddenPageAlignmentInterval().
- m_timerAlignmentInterval = std::max(m_timerAlignmentInterval, DOMTimer::hiddenPageAlignmentInterval());
+ m_domTimerAlignmentInterval = std::max(m_domTimerAlignmentInterval, DOMTimer::hiddenPageAlignmentInterval());
}
// If throttling is enabled, auto-increasing of throttling is enabled, and the auto-increase
@@ -1378,16 +1378,16 @@
// between increases is equal to the current throttle time. Since alinment interval increases
// exponentially, time between steps is exponential too.
if (!needsIncreaseTimer)
- m_timerAlignmentIntervalIncreaseTimer.stop();
- else if (!m_timerAlignmentIntervalIncreaseTimer.isActive())
- m_timerAlignmentIntervalIncreaseTimer.startOneShot(m_timerAlignmentInterval);
+ m_domTimerAlignmentIntervalIncreaseTimer.stop();
+ else if (!m_domTimerAlignmentIntervalIncreaseTimer.isActive())
+ m_domTimerAlignmentIntervalIncreaseTimer.startOneShot(m_domTimerAlignmentInterval);
}
-void Page::timerAlignmentIntervalIncreaseTimerFired()
+void Page::domTimerAlignmentIntervalIncreaseTimerFired()
{
ASSERT(m_settings->hiddenPageDOMTimerThrottlingAutoIncreases());
ASSERT(m_timerThrottlingState == TimerThrottlingState::EnabledIncreasing);
- ASSERT(m_timerAlignmentInterval < m_timerAlignmentIntervalIncreaseLimit);
+ ASSERT(m_domTimerAlignmentInterval < m_domTimerAlignmentIntervalIncreaseLimit);
// Alignment interval is increased to equal the time the page has been throttled, to a limit.
updateDOMTimerAlignmentInterval();
Modified: trunk/Source/WebCore/page/Page.h (213518 => 213519)
--- trunk/Source/WebCore/page/Page.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Page.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -240,7 +240,7 @@
ProgressTracker& progress() const { return *m_progress; }
BackForwardController& backForward() const { return *m_backForwardController; }
- std::chrono::milliseconds domTimerAlignmentInterval() const { return m_timerAlignmentInterval; }
+ Seconds domTimerAlignmentInterval() const { return m_domTimerAlignmentInterval; }
#if ENABLE(VIEW_MODE_CSS_MEDIA)
enum ViewMode {
@@ -552,7 +552,7 @@
void setShowAllPlugins(bool showAll) { m_showAllPlugins = showAll; }
bool showAllPlugins() const;
- WEBCORE_EXPORT void setTimerAlignmentIntervalIncreaseLimit(std::chrono::milliseconds);
+ WEBCORE_EXPORT void setDOMTimerAlignmentIntervalIncreaseLimit(Seconds);
bool isControlledByAutomation() const { return m_controlledByAutomation; }
void setControlledByAutomation(bool controlled) { m_controlledByAutomation = controlled; }
@@ -609,7 +609,7 @@
void setTimerThrottlingState(TimerThrottlingState);
void updateTimerThrottlingState();
void updateDOMTimerAlignmentInterval();
- void timerAlignmentIntervalIncreaseTimerFired();
+ void domTimerAlignmentIntervalIncreaseTimerFired();
const std::unique_ptr<Chrome> m_chrome;
const std::unique_ptr<DragCaretController> m_dragCaretController;
@@ -712,10 +712,10 @@
#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
TimerThrottlingState m_timerThrottlingState { TimerThrottlingState::Disabled };
- std::chrono::steady_clock::time_point m_timerThrottlingStateLastChangedTime { std::chrono::steady_clock::duration::zero() };
- std::chrono::milliseconds m_timerAlignmentInterval;
- Timer m_timerAlignmentIntervalIncreaseTimer;
- std::chrono::milliseconds m_timerAlignmentIntervalIncreaseLimit { 0 };
+ MonotonicTime m_timerThrottlingStateLastChangedTime;
+ Seconds m_domTimerAlignmentInterval;
+ Timer m_domTimerAlignmentIntervalIncreaseTimer;
+ Seconds m_domTimerAlignmentIntervalIncreaseLimit;
bool m_isEditable;
bool m_isPrerender;
Modified: trunk/Source/WebCore/page/Settings.cpp (213518 => 213519)
--- trunk/Source/WebCore/page/Settings.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Settings.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -449,10 +449,9 @@
m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
}
-void Settings::setMinimumDOMTimerInterval(std::chrono::milliseconds interval)
+void Settings::setMinimumDOMTimerInterval(Seconds interval)
{
- auto oldTimerInterval = m_minimumDOMTimerInterval;
- m_minimumDOMTimerInterval = interval;
+ auto oldTimerInterval = std::exchange(m_minimumDOMTimerInterval, interval);
if (!m_page)
return;
@@ -459,7 +458,7 @@
for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
if (frame->document())
- frame->document()->adjustMinimumTimerInterval(oldTimerInterval);
+ frame->document()->adjustMinimumDOMTimerInterval(oldTimerInterval);
}
}
Modified: trunk/Source/WebCore/page/Settings.h (213518 => 213519)
--- trunk/Source/WebCore/page/Settings.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/Settings.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -169,8 +169,8 @@
WEBCORE_EXPORT void setNeedsAdobeFrameReloadingQuirk(bool);
bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
- WEBCORE_EXPORT void setMinimumDOMTimerInterval(std::chrono::milliseconds); // Initialized to DOMTimer::defaultMinimumInterval().
- std::chrono::milliseconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
+ WEBCORE_EXPORT void setMinimumDOMTimerInterval(Seconds); // Initialized to DOMTimer::defaultMinimumInterval().
+ Seconds minimumDOMTimerInterval() const { return m_minimumDOMTimerInterval; }
WEBCORE_EXPORT void setLayoutInterval(Seconds);
Seconds layoutInterval() const { return m_layoutInterval; }
@@ -338,7 +338,7 @@
const std::unique_ptr<FontGenericFamilies> m_fontGenericFamilies;
SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
Seconds m_layoutInterval;
- std::chrono::milliseconds m_minimumDOMTimerInterval;
+ Seconds m_minimumDOMTimerInterval;
SETTINGS_MEMBER_VARIABLES
Modified: trunk/Source/WebCore/page/SuspendableTimer.h (213518 => 213519)
--- trunk/Source/WebCore/page/SuspendableTimer.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/page/SuspendableTimer.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -29,6 +29,8 @@
#include "ActiveDOMObject.h"
#include "Timer.h"
+#include <wtf/Seconds.h>
+
namespace WebCore {
class SuspendableTimer : private TimerBase, public ActiveDOMObject {
@@ -49,9 +51,20 @@
void augmentFireInterval(double delta);
void augmentRepeatInterval(double delta);
+ void startRepeating(Seconds repeatInterval) { startRepeating(repeatInterval.value()); }
+ void startOneShot(Seconds interval) { startOneShot(interval.value()); }
+
+ // FIXME: Use the overloads taking Seconds instead and drop these.
void startRepeating(std::chrono::milliseconds repeatInterval) { startRepeating(msToSeconds(repeatInterval)); }
void startOneShot(std::chrono::milliseconds interval) { startOneShot(msToSeconds(interval)); }
+
std::chrono::milliseconds repeatIntervalMS() const { return secondsToMS(repeatInterval()); }
+ Seconds repeatIntervalSeconds() const { return Seconds { repeatInterval() }; }
+
+ void augmentFireInterval(Seconds delta) { augmentFireInterval(delta.value()); }
+ void augmentRepeatInterval(Seconds delta) { augmentRepeatInterval(delta.value()); }
+
+ // FIXME: Use the overloads taking Seconds instead and drop these.
void augmentFireInterval(std::chrono::milliseconds delta) { augmentFireInterval(msToSeconds(delta)); }
void augmentRepeatInterval(std::chrono::milliseconds delta) { augmentRepeatInterval(msToSeconds(delta)); }
Modified: trunk/Source/WebCore/platform/Timer.cpp (213518 => 213519)
--- trunk/Source/WebCore/platform/Timer.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/platform/Timer.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -382,8 +382,8 @@
double oldTime = m_nextFireTime;
// Don't realign zero-delay timers.
if (newTime) {
- if (auto newAlignedTime = alignedFireTime(secondsToMS(newTime)))
- newTime = msToSeconds(newAlignedTime.value());
+ if (auto newAlignedTime = alignedFireTime(Seconds { newTime }))
+ newTime = newAlignedTime.value().seconds();
}
if (oldTime != newTime) {
Modified: trunk/Source/WebCore/platform/Timer.h (213518 => 213519)
--- trunk/Source/WebCore/platform/Timer.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/platform/Timer.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -88,7 +88,7 @@
private:
virtual void fired() = 0;
- virtual std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const { return std::nullopt; }
+ virtual std::optional<Seconds> alignedFireTime(Seconds) const { return std::nullopt; }
void checkConsistency() const;
void checkHeapIndex() const;
Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (213518 => 213519)
--- trunk/Source/WebCore/testing/InternalSettings.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -62,7 +62,7 @@
, m_originalMockScrollbarsEnabled(settings.mockScrollbarsEnabled())
, m_imagesEnabled(settings.areImagesEnabled())
, m_preferMIMETypeForImages(settings.preferMIMETypeForImages())
- , m_minimumTimerInterval(settings.minimumDOMTimerInterval())
+ , m_minimumDOMTimerInterval(settings.minimumDOMTimerInterval())
#if ENABLE(VIDEO_TRACK)
, m_shouldDisplaySubtitles(settings.shouldDisplaySubtitles())
, m_shouldDisplayCaptions(settings.shouldDisplayCaptions())
@@ -151,7 +151,7 @@
settings.setCanvasUsesAcceleratedDrawing(m_originalCanvasUsesAcceleratedDrawing);
settings.setImagesEnabled(m_imagesEnabled);
settings.setPreferMIMETypeForImages(m_preferMIMETypeForImages);
- settings.setMinimumDOMTimerInterval(m_minimumTimerInterval);
+ settings.setMinimumDOMTimerInterval(m_minimumDOMTimerInterval);
#if ENABLE(VIDEO_TRACK)
settings.setShouldDisplaySubtitles(m_shouldDisplaySubtitles);
settings.setShouldDisplayCaptions(m_shouldDisplayCaptions);
@@ -544,7 +544,7 @@
{
if (!m_page)
return Exception { INVALID_ACCESS_ERR };
- settings().setMinimumDOMTimerInterval(std::chrono::milliseconds((std::chrono::milliseconds::rep)(intervalInSeconds * 1000)));
+ settings().setMinimumDOMTimerInterval(Seconds { intervalInSeconds });
return { };
}
Modified: trunk/Source/WebCore/testing/InternalSettings.h (213518 => 213519)
--- trunk/Source/WebCore/testing/InternalSettings.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/InternalSettings.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -148,7 +148,7 @@
bool m_originalUsesOverlayScrollbars;
bool m_imagesEnabled;
bool m_preferMIMETypeForImages;
- std::chrono::milliseconds m_minimumTimerInterval;
+ Seconds m_minimumDOMTimerInterval;
#if ENABLE(VIDEO_TRACK)
bool m_shouldDisplaySubtitles;
bool m_shouldDisplayCaptions;
Modified: trunk/Source/WebCore/testing/Internals.cpp (213518 => 213519)
--- trunk/Source/WebCore/testing/Internals.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/testing/Internals.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1045,7 +1045,7 @@
if (timer->intervalClampedToMinimum() > timer->m_originalInterval)
return true;
- return !!timer->alignedFireTime(0ms);
+ return !!timer->alignedFireTime(0_s);
}
bool Internals::isRequestAnimationFrameThrottled() const
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (213518 => 213519)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -207,7 +207,7 @@
int WorkerGlobalScope::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(*this, WTFMove(action), std::chrono::milliseconds(timeout), true);
+ return DOMTimer::install(*this, WTFMove(action), Seconds::fromMilliseconds(timeout), true);
}
void WorkerGlobalScope::clearTimeout(int timeoutId)
@@ -217,7 +217,7 @@
int WorkerGlobalScope::setInterval(std::unique_ptr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(*this, WTFMove(action), std::chrono::milliseconds(timeout), false);
+ return DOMTimer::install(*this, WTFMove(action), Seconds::fromMilliseconds(timeout), false);
}
void WorkerGlobalScope::clearInterval(int timeoutId)
Modified: trunk/Source/WebKit/win/WebView.cpp (213518 => 213519)
--- trunk/Source/WebKit/win/WebView.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit/win/WebView.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -7467,7 +7467,7 @@
{
if (!interval)
return E_POINTER;
- *interval = DOMTimer::defaultMinimumInterval().count() / 1000.;
+ *interval = DOMTimer::defaultMinimumInterval().seconds();
return S_OK;
}
@@ -7476,8 +7476,7 @@
if (!m_page)
return E_FAIL;
- auto intervalMS = std::chrono::milliseconds((std::chrono::milliseconds::rep)(interval * 1000));
- page()->settings().setMinimumDOMTimerInterval(intervalMS);
+ page()->settings().setMinimumDOMTimerInterval(Seconds { interval });
return S_OK;
}
Modified: trunk/Source/WebKit2/ChangeLog (213518 => 213519)
--- trunk/Source/WebKit2/ChangeLog 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/ChangeLog 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1,3 +1,19 @@
+2017-03-07 Chris Dumez <[email protected]>
+
+ Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+ https://bugs.webkit.org/show_bug.cgi?id=169236
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
2017-03-06 Aakash Jain <[email protected]>
Enable SUPPORTS_TEXT_BASED_API in WebKit2 for iOS
Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (213518 => 213519)
--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1465,7 +1465,7 @@
static int maximumTimerThrottlePerPageInMS = 200 * 100;
int limitInMilliseconds = maximumTimerThrottlePerPageInMS * m_hiddenPageThrottlingAutoIncreasesCounter.value();
- sendToAllProcesses(Messages::WebProcess::SetHiddenPageTimerThrottlingIncreaseLimit(limitInMilliseconds));
+ sendToAllProcesses(Messages::WebProcess::SetHiddenPageDOMTimerThrottlingIncreaseLimit(limitInMilliseconds));
}
void WebProcessPool::reportWebContentCPUTime(int64_t cpuTime, uint64_t activityState)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (213518 => 213519)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -303,9 +303,9 @@
bool isAlwaysOnLoggingAllowed() const;
void setActivePopupMenu(WebPopupMenu*);
- void setHiddenPageTimerThrottlingIncreaseLimit(std::chrono::milliseconds limit)
+ void setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds limit)
{
- m_page->setTimerAlignmentIntervalIncreaseLimit(limit);
+ m_page->setDOMTimerAlignmentIntervalIncreaseLimit(limit);
}
#if ENABLE(INPUT_TYPE_COLOR)
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (213518 => 213519)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2017-03-07 17:11:06 UTC (rev 213519)
@@ -1235,10 +1235,10 @@
}
}
-void WebProcess::setHiddenPageTimerThrottlingIncreaseLimit(int milliseconds)
+void WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds)
{
for (auto& page : m_pageMap.values())
- page->setHiddenPageTimerThrottlingIncreaseLimit(std::chrono::milliseconds(milliseconds));
+ page->setHiddenPageDOMTimerThrottlingIncreaseLimit(Seconds::fromMilliseconds(milliseconds));
}
#if !PLATFORM(COCOA)
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (213518 => 213519)
--- trunk/Source/WebKit2/WebProcess/WebProcess.h 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h 2017-03-07 17:11:06 UTC (rev 213519)
@@ -195,7 +195,7 @@
void updateActivePages();
- void setHiddenPageTimerThrottlingIncreaseLimit(int milliseconds);
+ void setHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds);
void processWillSuspendImminently(bool& handled);
void prepareToSuspend();
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (213518 => 213519)
--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2017-03-07 17:08:57 UTC (rev 213518)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2017-03-07 17:11:06 UTC (rev 213519)
@@ -79,7 +79,7 @@
DeleteWebsiteData(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, std::chrono::system_clock::time_point modifiedSince) -> ()
DeleteWebsiteDataForOrigins(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins) -> ()
- SetHiddenPageTimerThrottlingIncreaseLimit(int milliseconds)
+ SetHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds)
SetProcessSuppressionEnabled(bool flag)
#if PLATFORM(COCOA)
SetQOS(int latencyQOS, int throughputQOS)