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

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

Issue 1312353004: (Reland) Make m_executeScriptsWaitingForResourcesTimer a loading task (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename Created 5 years, 4 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 0f98d181f0a27fe4b9b2eea4ce4dc67671d68113..1306da3d56b5c1f22b34eeed4aff03f639f19ad0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -212,6 +212,7 @@
#include "public/platform/Platform.h"
#include "wtf/CurrentTime.h"
#include "wtf/DateMath.h"
+#include "wtf/Functional.h"
#include "wtf/HashFunctions.h"
#include "wtf/MainThread.h"
#include "wtf/StdLibExtras.h"
@@ -380,7 +381,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_paginatedForScreen(false)
, m_compatibilityMode(NoQuirksMode)
, m_compatibilityModeLocked(false)
- , m_executeScriptsWaitingForResourcesTimer(this, &Document::executeScriptsWaitingForResourcesTimerFired)
+ , m_executeScriptsWaitingForResourcesTask(WTF::bind(&Document::executeScriptsWaitingForResources, this))
, m_hasAutofocused(false)
, m_clearFocusedElementTimer(this, &Document::clearFocusedElementTimerFired)
, m_domTreeVersion(++s_globalTreeVersion)
@@ -2956,7 +2957,8 @@ void Document::didRemoveAllPendingStylesheet()
void Document::didLoadAllScriptBlockingResources()
{
- m_executeScriptsWaitingForResourcesTimer.startOneShot(0, FROM_HERE);
+ Platform::current()->currentThread()->scheduler()->postLoadingTask(
+ FROM_HERE, m_executeScriptsWaitingForResourcesTask.cancelAndCreate());
if (frame())
frame()->loader().client()->didRemoveAllPendingStylesheet();
@@ -2965,7 +2967,7 @@ void Document::didLoadAllScriptBlockingResources()
view()->processUrlFragment(m_url);
}
-void Document::executeScriptsWaitingForResourcesTimerFired(Timer<Document>*)
+void Document::executeScriptsWaitingForResources()
{
if (!isRenderingReady())
return;
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698