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

Unified Diff: Source/core/workers/WorkerThread.cpp

Issue 705003002: Change the return type of WTF::bind() to |OwnPtr<Function>| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reflect comments from yhirano Created 6 years, 1 month 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
Index: Source/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index 6a0ad514baf928787325d3b33eb458c05488f8c3..23e90e4a8af7e59184c019c9151b355277cd4ec7 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -90,7 +90,7 @@ unsigned WorkerThread::workerThreadCount()
class WorkerThreadCancelableTask final : public ExecutionContextTask {
WTF_MAKE_NONCOPYABLE(WorkerThreadCancelableTask); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<WorkerThreadCancelableTask> create(const Closure& closure)
+ static PassOwnPtr<WorkerThreadCancelableTask> create(PassOwnPtr<Closure> closure)
{
return adoptPtr(new WorkerThreadCancelableTask(closure));
}
@@ -98,18 +98,18 @@ public:
virtual void performTask(ExecutionContext*) override
{
if (!m_taskCanceled)
- m_closure();
+ (*m_closure)();
}
void cancelTask() { m_taskCanceled = true; }
private:
- explicit WorkerThreadCancelableTask(const Closure& closure)
+ explicit WorkerThreadCancelableTask(PassOwnPtr<Closure> closure)
: m_closure(closure)
, m_taskCanceled(false)
{ }
- Closure m_closure;
+ OwnPtr<Closure> m_closure;
bool m_taskCanceled;
};
« no previous file with comments | « Source/core/page/NetworkStateNotifierTest.cpp ('k') | Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698