OLD | NEW |
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 #include "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
6 #include "sky/engine/tonic/dart_state.h" | 6 #include "sky/engine/tonic/dart_state.h" |
7 | 7 |
8 #include "sky/engine/tonic/dart_class_library.h" | 8 #include "sky/engine/tonic/dart_class_library.h" |
| 9 #include "sky/engine/tonic/dart_exception_factory.h" |
9 #include "sky/engine/tonic/dart_string_cache.h" | 10 #include "sky/engine/tonic/dart_string_cache.h" |
10 #include "sky/engine/tonic/dart_exception_factory.h" | 11 #include "sky/engine/tonic/dart_timer_heap.h" |
11 #include "sky/engine/wtf/PassOwnPtr.h" | 12 #include "sky/engine/wtf/PassOwnPtr.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 DartState::Scope::Scope(DartState* dart_state) : scope_(dart_state->isolate()) { | 16 DartState::Scope::Scope(DartState* dart_state) : scope_(dart_state->isolate()) { |
16 } | 17 } |
17 | 18 |
18 DartState::Scope::~Scope() { | 19 DartState::Scope::~Scope() { |
19 } | 20 } |
20 | 21 |
21 DartState::DartState() | 22 DartState::DartState() |
22 : isolate_(NULL), | 23 : isolate_(NULL), |
23 class_library_(adoptPtr(new DartClassLibrary)), | 24 class_library_(adoptPtr(new DartClassLibrary)), |
24 string_cache_(adoptPtr(new DartStringCache)), | 25 string_cache_(adoptPtr(new DartStringCache)), |
25 exception_factory_(adoptPtr(new DartExceptionFactory(this))), | 26 exception_factory_(adoptPtr(new DartExceptionFactory(this))), |
| 27 timer_heap_(adoptPtr(new DartTimerHeap())), |
26 weak_factory_(this) { | 28 weak_factory_(this) { |
27 } | 29 } |
28 | 30 |
29 DartState::~DartState() { | 31 DartState::~DartState() { |
30 } | 32 } |
31 | 33 |
32 DartState* DartState::From(Dart_Isolate isolate) { | 34 DartState* DartState::From(Dart_Isolate isolate) { |
33 return static_cast<DartState*>(Dart_IsolateData(isolate)); | 35 return static_cast<DartState*>(Dart_IsolateData(isolate)); |
34 } | 36 } |
35 | 37 |
36 DartState* DartState::Current() { | 38 DartState* DartState::Current() { |
37 return static_cast<DartState*>(Dart_CurrentIsolateData()); | 39 return static_cast<DartState*>(Dart_CurrentIsolateData()); |
38 } | 40 } |
39 | 41 |
40 base::WeakPtr<DartState> DartState::GetWeakPtr() { | 42 base::WeakPtr<DartState> DartState::GetWeakPtr() { |
41 return weak_factory_.GetWeakPtr(); | 43 return weak_factory_.GetWeakPtr(); |
42 } | 44 } |
43 | 45 |
44 } // namespace blink | 46 } // namespace blink |
OLD | NEW |