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

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

Issue 2141873002: Add helper functions to get per-frame task runners (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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 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 02cf58affbc36372e98739234da941ad7188d69d..48946d1d7ebb0eb8b6839ae7d5c32feb87097ba5 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -100,6 +100,7 @@
#include "core/dom/StaticNodeList.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/StyleEngine.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/TouchList.h"
#include "core/dom/TransformSource.h"
#include "core/dom/TreeWalker.h"
@@ -445,7 +446,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_compositorPendingAnimations(new CompositorPendingAnimations())
, m_templateDocumentHost(nullptr)
, m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsTimerFired)
- , m_timers(timerTaskRunner()->adoptClone())
+ , m_timers(TaskRunnerHelper::getTimerTaskRunner(this)->adoptClone())
, m_hasViewportUnits(false)
, m_parserSyncPolicy(AllowAsynchronousParsing)
, m_nodeCount(0)
@@ -3026,7 +3027,7 @@ void Document::didRemoveAllPendingStylesheet()
void Document::didLoadAllScriptBlockingResources()
{
- loadingTaskRunner()->postTask(BLINK_FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreate());
+ TaskRunnerHelper::getLoadingTaskRunner(this)->postTask(BLINK_FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreate());
if (isHTMLDocument() && body()) {
// For HTML if we have no more stylesheets to load and we're past the body
@@ -5876,39 +5877,6 @@ bool Document::isSecureContext(const SecureContextCheck privilegeContextCheck) c
return isSecureContextImpl(privilegeContextCheck);
}
-WebTaskRunner* Document::loadingTaskRunner() const
-{
- 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();
-}
-
-WebTaskRunner* Document::unthrottledTaskRunner() const
-{
- if (frame())
- return m_frame->frameScheduler()->unthrottledTaskRunner();
- if (m_importsController)
- return m_importsController->master()->unthrottledTaskRunner();
- if (m_contextDocument)
- return m_contextDocument->unthrottledTaskRunner();
- return Platform::current()->currentThread()->getWebTaskRunner();
-}
-
void Document::enforceInsecureRequestPolicy(WebInsecureRequestPolicy policy)
{
// Combine the new policy with the existing policy, as a base policy may be
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/TaskRunnerHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698