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

Unified Diff: third_party/WebKit/Source/platform/WebTaskRunner.cpp

Issue 2482813002: Cancel a task associated to TaskHandle when the TaskHandle is overridden (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/WebTaskRunner.cpp
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.cpp b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
index 4fb10649a88da4ce844c7e6dfd73015a4f713924..059abdf83d05f66c7baf472599d312d4509ab646 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
@@ -71,7 +71,12 @@ TaskHandle::~TaskHandle() {
}
TaskHandle::TaskHandle(TaskHandle&&) = default;
-TaskHandle& TaskHandle::operator=(TaskHandle&&) = default;
+
+TaskHandle& TaskHandle::operator=(TaskHandle&& other) {
+ TaskHandle tmp(std::move(other));
+ m_runner.swap(tmp.m_runner);
+ return *this;
+}
TaskHandle::TaskHandle(RefPtr<Runner> runner) : m_runner(std::move(runner)) {
DCHECK(m_runner);
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698