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

Unified Diff: Source/core/dom/Document.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/Document.h ('k') | Source/core/dom/ScriptRunner.h » ('j') | 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 fe49f47d371e50798ab53f7ac76a6b6437f71b0b..63279d51505cda548a6f7a1f75348fac0bb037a0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -203,6 +203,7 @@
#include "platform/TraceEvent.h"
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "platform/network/HTTPParsers.h"
+#include "platform/scheduler/CancellableTaskFactory.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "platform/text/PlatformLocale.h"
#include "platform/text/SegmentedString.h"
@@ -366,25 +367,6 @@ private:
}
};
-} // namespace blink
-
-namespace WTF {
-
-#if ENABLE(OILPAN)
-// NOTE this is to prevent Document::m_executeScriptsWaitingForResourcesTask from leaking.
-template<>
-struct PointerParamStorageTraits<blink::Document*, true> {
- using StorageType = blink::CrossThreadWeakPersistent<blink::Document>;
-
- static StorageType wrap(blink::Document* value) { return value; }
- static blink::Document* unwrap(const StorageType& value) { return value.get(); }
-};
-#endif
-
-} // namespace WTF
-
-namespace blink {
-
Document::Document(const DocumentInit& initializer, DocumentClassFlags documentClasses)
: ContainerNode(0, CreateDocument)
, TreeScope(*this)
@@ -401,7 +383,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_executeScriptsWaitingForResourcesTask(CancellableTaskFactory::create(this, &Document::executeScriptsWaitingForResources))
, m_hasAutofocused(false)
, m_clearFocusedElementTimer(this, &Document::clearFocusedElementTimerFired)
, m_domTreeVersion(++s_globalTreeVersion)
@@ -2982,7 +2964,7 @@ void Document::didRemoveAllPendingStylesheet()
void Document::didLoadAllScriptBlockingResources()
{
Platform::current()->currentThread()->scheduler()->loadingTaskRunner()->postTask(
- FROM_HERE, m_executeScriptsWaitingForResourcesTask.cancelAndCreate());
+ FROM_HERE, m_executeScriptsWaitingForResourcesTask->cancelAndCreate());
if (frame())
frame()->loader().client()->didRemoveAllPendingStylesheet();
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/ScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698