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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1477353002: Revert of Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 795e85ed341a72c45a70ea1ca0a235b39dd4508a..8b824c9c8f62faa09b5255e84592bd1a9be7932b 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -442,7 +442,7 @@
, m_timeline(AnimationTimeline::create(this))
, m_templateDocumentHost(nullptr)
, m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsTimerFired)
- , m_timers(timerTaskRunner()->adoptClone())
+ , m_timers(Platform::current()->currentThread()->scheduler()->timerTaskRunner()->adoptClone())
, m_hasViewportUnits(false)
, m_styleRecalcElementCounter(0)
, m_parserSyncPolicy(AllowAsynchronousParsing)
@@ -453,6 +453,7 @@
provideContextFeaturesToDocumentFrom(*this, *m_frame->page());
m_fetcher = m_frame->loader().documentLoader()->fetcher();
+ m_timers.setTimerTaskRunner(m_frame->frameScheduler()->timerTaskRunner()->adoptClone());
FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this);
} else if (m_importsController) {
m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr);
@@ -2876,6 +2877,14 @@
return completeURL(url);
}
+double Document::timerAlignmentInterval() const
+{
+ Page* p = page();
+ if (!p)
+ return DOMTimer::visiblePageAlignmentInterval();
+ return p->timerAlignmentInterval();
+}
+
DOMTimerCoordinator* Document::timers()
{
return &m_timers;
@@ -3016,7 +3025,8 @@
void Document::didLoadAllScriptBlockingResources()
{
- loadingTaskRunner()->postTask(BLINK_FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreate());
+ Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postTask(
+ BLINK_FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreate());
if (frame())
frame()->loader().client()->didRemoveAllPendingStylesheet();
@@ -5740,22 +5750,12 @@
{
if (frame())
return frame()->frameScheduler()->loadingTaskRunner();
- if (m_importsController)
- return m_importsController->master()->loadingTaskRunner();
- if (m_contextDocument)
- return m_contextDocument->loadingTaskRunner();
return Platform::current()->currentThread()->scheduler()->loadingTaskRunner();
}
WebTaskRunner* Document::timerTaskRunner() const
{
- if (frame())
- return m_frame->frameScheduler()->timerTaskRunner();
- if (m_importsController)
- return m_importsController->master()->timerTaskRunner();
- if (m_contextDocument)
- return m_contextDocument->timerTaskRunner();
- return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
+ return m_timers.timerTaskRunner();
}
DEFINE_TRACE(Document)
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/ExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698