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

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

Issue 1312843009: Improve CancellableTaskFactory handling and Oilpan usage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add unwrap() clarification Created 5 years, 3 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/ScriptRunner.h ('k') | Source/core/dom/ScriptRunnerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptRunner.cpp
diff --git a/Source/core/dom/ScriptRunner.cpp b/Source/core/dom/ScriptRunner.cpp
index 41a2b4b0e9a2480f77fe1b0a6d44dac9271a3a0a..748809724c54905f9089c9175b69ee405c8486d2 100644
--- a/Source/core/dom/ScriptRunner.cpp
+++ b/Source/core/dom/ScriptRunner.cpp
@@ -30,29 +30,19 @@
#include "core/dom/Element.h"
#include "core/dom/ScriptLoader.h"
#include "platform/heap/Handle.h"
+#include "platform/scheduler/CancellableTaskFactory.h"
#include "public/platform/Platform.h"
#include "public/platform/WebScheduler.h"
#include "public/platform/WebThread.h"
-#include "wtf/Functional.h"
-
-// This bit of magic is needed by oilpan to prevent the ScriptRunner from leaking.
-namespace WTF {
-template<>
-struct ParamStorageTraits<blink::ScriptRunner*> : public PointerParamStorageTraits<blink::ScriptRunner*, false> {
-};
-}
namespace blink {
ScriptRunner::ScriptRunner(Document* document)
: m_document(document)
- , m_executeScriptsTaskFactory(WTF::bind(&ScriptRunner::executeScripts, this))
+ , m_executeScriptsTaskFactory(CancellableTaskFactory::create(this, &ScriptRunner::executeScripts))
{
ASSERT(document);
-#if ENABLE(LAZY_SWEEPING) && defined(ADDRESS_SANITIZER)
- m_executeScriptsTaskFactory.setUnpoisonBeforeUpdate();
-#endif
}
ScriptRunner::~ScriptRunner()
@@ -92,7 +82,7 @@ void ScriptRunner::queueScriptForExecution(ScriptLoader* scriptLoader, Execution
void ScriptRunner::suspend()
{
- m_executeScriptsTaskFactory.cancel();
+ m_executeScriptsTaskFactory->cancel();
}
void ScriptRunner::resume()
@@ -224,10 +214,10 @@ bool ScriptRunner::yieldForHighPriorityWork()
void ScriptRunner::postTaskIfOneIsNotAlreadyInFlight()
{
- if (m_executeScriptsTaskFactory.isPending())
+ if (m_executeScriptsTaskFactory->isPending())
return;
- Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postTask(FROM_HERE, m_executeScriptsTaskFactory.cancelAndCreate());
+ Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postTask(FROM_HERE, m_executeScriptsTaskFactory->cancelAndCreate());
}
DEFINE_TRACE(ScriptRunner)
@@ -240,4 +230,4 @@ DEFINE_TRACE(ScriptRunner)
#endif
}
-}
+} // namespace blink
« no previous file with comments | « Source/core/dom/ScriptRunner.h ('k') | Source/core/dom/ScriptRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698