Revert of Make m_executeScriptsWaitingForResourcesTimer a loading task...

Revert of Make m_executeScriptsWaitingForResourcesTimer a loading task (patchset #2 id:20001 of https://codereview.chromium.org/1312353004/ )

Reason for revert:
Oilpan leaks.

Original issue's description:
> Make m_executeScriptsWaitingForResourcesTimer a loading task
> 
> We would like to be able to prioritize loading tasks, but in order to
> do that we need to make sure loading tasks are posted to the right queue
> to make sure tasks run in the expected order.  If this task is posted as
> a timer, and loading tasks are prioritzed, it's possible
> FrameHostMsg_DidStopLoading will be sent before the corresponding
> FrameHostMsg_DidStartLoading ipc which causes various browser tests to
> break.
> 
> BUG=497761,510398
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201563

TBR=mkwst@chromium.org,skyostil@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=497761,510398

Review URL: https://codereview.chromium.org/1304943004

git-svn-id: svn://svn.chromium.org/blink/trunk@201641 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4e451c0a
......@@ -212,7 +212,6 @@
#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"
......@@ -382,7 +381,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_paginatedForScreen(false)
, m_compatibilityMode(NoQuirksMode)
, m_compatibilityModeLocked(false)
, m_executeScriptsWaitingForResourcesTask(WTF::bind(&Document::executeScriptsWaitingForResources, this))
, m_executeScriptsWaitingForResourcesTimer(this, &Document::executeScriptsWaitingForResourcesTimerFired)
, m_hasAutofocused(false)
, m_clearFocusedElementTimer(this, &Document::clearFocusedElementTimerFired)
, m_domTreeVersion(++s_globalTreeVersion)
......@@ -2962,8 +2961,7 @@ void Document::didRemoveAllPendingStylesheet()
void Document::didLoadAllScriptBlockingResources()
{
Platform::current()->currentThread()->scheduler()->postLoadingTask(
FROM_HERE, m_executeScriptsWaitingForResourcesTask.cancelAndCreate());
m_executeScriptsWaitingForResourcesTimer.startOneShot(0, FROM_HERE);
if (frame())
frame()->loader().client()->didRemoveAllPendingStylesheet();
......@@ -2972,7 +2970,7 @@ void Document::didLoadAllScriptBlockingResources()
view()->processUrlFragment(m_url);
}
void Document::executeScriptsWaitingForResources()
void Document::executeScriptsWaitingForResourcesTimerFired(Timer<Document>*)
{
if (!isRenderingReady())
return;
......
......@@ -57,7 +57,6 @@
#include "platform/Length.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "platform/scheduler/CancellableTaskFactory.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/ReferrerPolicy.h"
#include "public/platform/WebFocusType.h"
......@@ -1126,7 +1125,7 @@ private:
void updateFocusAppearanceTimerFired(Timer<Document>*);
void updateBaseURL();
void executeScriptsWaitingForResources();
void executeScriptsWaitingForResourcesTimerFired(Timer<Document>*);
void loadEventDelayTimerFired(Timer<Document>*);
void pluginLoadingTimerFired(Timer<Document>*);
......@@ -1200,7 +1199,7 @@ private:
CompatibilityMode m_compatibilityMode;
bool m_compatibilityModeLocked; // This is cheaper than making setCompatibilityMode virtual.
CancellableTaskFactory m_executeScriptsWaitingForResourcesTask;
Timer<Document> m_executeScriptsWaitingForResourcesTimer;
bool m_hasAutofocused;
Timer<Document> m_clearFocusedElementTimer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment