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

Unified Diff: Source/platform/scheduler/CancellableTaskFactory.cpp

Issue 1171463006: Make Timer and CancellableTaskFactory embeddeable in lazily swept objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: mark ScriptRunner's CancellableTaskFactory as needing unpoisoning Created 5 years, 6 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/platform/scheduler/CancellableTaskFactory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scheduler/CancellableTaskFactory.cpp
diff --git a/Source/platform/scheduler/CancellableTaskFactory.cpp b/Source/platform/scheduler/CancellableTaskFactory.cpp
index 87027119e635018ae91ce74982b213b780fa0d68..ad461afa77cb7386e0c377367207945fd0d89276 100644
--- a/Source/platform/scheduler/CancellableTaskFactory.cpp
+++ b/Source/platform/scheduler/CancellableTaskFactory.cpp
@@ -21,11 +21,16 @@ WebThread::Task* CancellableTaskFactory::cancelAndCreate()
return new CancellableTask(m_weakPtrFactory.createWeakPtr());
}
+NO_LAZY_SWEEP_SANITIZE_ADDRESS
void CancellableTaskFactory::CancellableTask::run()
{
- if (m_weakPtr.get()) {
- Closure* closure = m_weakPtr->m_closure.get();
- m_weakPtr->m_weakPtrFactory.revokeAll();
+ if (CancellableTaskFactory* taskFactory = m_weakPtr.get()) {
+#if defined(ADDRESS_SANITIZER)
+ if (taskFactory->m_unpoisonBeforeUpdate)
+ ASAN_UNPOISON_MEMORY_REGION(reinterpret_cast<unsigned char*>(taskFactory), sizeof(CancellableTaskFactory));
+#endif
+ Closure* closure = taskFactory->m_closure.get();
+ taskFactory->m_weakPtrFactory.revokeAll();
(*closure)();
}
}
« no previous file with comments | « Source/platform/scheduler/CancellableTaskFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698