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

Unified Diff: sky/engine/tonic/dart_timer_heap.cc

Issue 1241583003: Remove all remaining HashMap and HashSet usages except dart_string_cache (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « sky/engine/tonic/dart_timer_heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/tonic/dart_timer_heap.cc
diff --git a/sky/engine/tonic/dart_timer_heap.cc b/sky/engine/tonic/dart_timer_heap.cc
index b287b920c082f166922fb80d45f11a44f7db0ef4..ed0e6afd484d5fbaef5c943b1d4fe37e978ed75a 100644
--- a/sky/engine/tonic/dart_timer_heap.cc
+++ b/sky/engine/tonic/dart_timer_heap.cc
@@ -27,12 +27,12 @@ int DartTimerHeap::Add(PassOwnPtr<Task> task) {
}
void DartTimerHeap::Remove(int id) {
- heap_.remove(id);
+ heap_.erase(id);
}
void DartTimerHeap::Schedule(int id, PassOwnPtr<Task> task) {
base::TimeDelta delay = task->delay;
- heap_.add(id, task);
+ heap_[id] = task;
base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
base::Bind(&DartTimerHeap::Run, weak_factory_.GetWeakPtr(), id), delay);
}
@@ -41,8 +41,8 @@ void DartTimerHeap::Run(int id) {
auto it = heap_.find(id);
if (it == heap_.end())
return;
- OwnPtr<Task> task = it->value.release();
- heap_.remove(it);
+ OwnPtr<Task> task = it->second.release();
+ heap_.erase(it);
if (!task->closure.dart_state())
return;
DartIsolateScope scope(task->closure.dart_state()->isolate());
« no previous file with comments | « sky/engine/tonic/dart_timer_heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698