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

Unified Diff: src/cancelable-task.cc

Issue 2414073002: Revert of [heap] Cancel tasks before tearing down the heap. (Closed)
Patch Set: Created 4 years, 2 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 | « src/cancelable-task.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cancelable-task.cc
diff --git a/src/cancelable-task.cc b/src/cancelable-task.cc
index 852f4ffda806bbc2266cd61ee64de2a5f421f419..defbb44775a8c1f64b8eedac62ea21b8376eacd1 100644
--- a/src/cancelable-task.cc
+++ b/src/cancelable-task.cc
@@ -26,20 +26,14 @@
}
}
-CancelableTaskManager::CancelableTaskManager()
- : task_id_counter_(0), canceled_(false) {}
+CancelableTaskManager::CancelableTaskManager() : task_id_counter_(0) {}
uint32_t CancelableTaskManager::Register(Cancelable* task) {
base::LockGuard<base::Mutex> guard(&mutex_);
uint32_t id = ++task_id_counter_;
// The loop below is just used when task_id_counter_ overflows.
while (cancelable_tasks_.count(id) > 0) ++id;
- if (canceled_) {
- bool successfully_canceled_task = task->Cancel();
- CHECK(successfully_canceled_task);
- } else {
- cancelable_tasks_[id] = task;
- }
+ cancelable_tasks_[id] = task;
return id;
}
@@ -75,7 +69,6 @@
// of canceling we wait for the background tasks that have already been
// started.
base::LockGuard<base::Mutex> guard(&mutex_);
- canceled_ = true;
// Cancelable tasks could be running or could potentially register new
// tasks, requiring a loop here.
« no previous file with comments | « src/cancelable-task.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698