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

Side by Side Diff: sky/engine/tonic/dart_timer_heap.h

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 unified diff | Download patch
« no previous file with comments | « sky/engine/tonic/dart_library_loader.cc ('k') | sky/engine/tonic/dart_timer_heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_ 5 #ifndef SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_
6 #define SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_ 6 #define SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_
7 7
8 #include <unordered_map>
9
8 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
9 #include "base/time/time.h" 11 #include "base/time/time.h"
10 #include "dart/runtime/include/dart_api.h" 12 #include "dart/runtime/include/dart_api.h"
11 #include "sky/engine/tonic/dart_persistent_value.h" 13 #include "sky/engine/tonic/dart_persistent_value.h"
12 #include "sky/engine/wtf/HashMap.h"
13 #include "sky/engine/wtf/OwnPtr.h" 14 #include "sky/engine/wtf/OwnPtr.h"
14 #include "sky/engine/wtf/PassOwnPtr.h" 15 #include "sky/engine/wtf/PassOwnPtr.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 class DartTimerHeap { 19 class DartTimerHeap {
19 public: 20 public:
20 DartTimerHeap(); 21 DartTimerHeap();
21 ~DartTimerHeap(); 22 ~DartTimerHeap();
22 23
23 struct Task { 24 struct Task {
24 DartPersistentValue closure; 25 DartPersistentValue closure;
25 base::TimeDelta delay; 26 base::TimeDelta delay;
26 bool repeating = false; 27 bool repeating = false;
27 }; 28 };
28 29
29 int Add(PassOwnPtr<Task> task); 30 int Add(PassOwnPtr<Task> task);
30 void Remove(int id); 31 void Remove(int id);
31 32
32 private: 33 private:
33 void Schedule(int id, PassOwnPtr<Task> task); 34 void Schedule(int id, PassOwnPtr<Task> task);
34 void Run(int id); 35 void Run(int id);
35 36
36 int next_timer_id_; 37 int next_timer_id_;
37 HashMap<int, OwnPtr<Task>> heap_; 38 std::unordered_map<int, OwnPtr<Task>> heap_;
38 39
39 base::WeakPtrFactory<DartTimerHeap> weak_factory_; 40 base::WeakPtrFactory<DartTimerHeap> weak_factory_;
40 }; 41 };
41 42
42 } 43 }
43 44
44 #endif // SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_ 45 #endif // SKY_ENGINE_TONIC_DART_TIMER_HEAP_H_
OLDNEW
« no previous file with comments | « sky/engine/tonic/dart_library_loader.cc ('k') | sky/engine/tonic/dart_timer_heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698