| 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/tonic/dart_state.h" | 5 #include "sky/engine/tonic/dart_state.h" |
| 6 | 6 |
| 7 #include "sky/engine/tonic/dart_class_library.h" | 7 #include "sky/engine/tonic/dart_class_library.h" |
| 8 #include "sky/engine/tonic/dart_converter.h" | 8 #include "sky/engine/tonic/dart_converter.h" |
| 9 #include "sky/engine/tonic/dart_exception_factory.h" | 9 #include "sky/engine/tonic/dart_exception_factory.h" |
| 10 #include "sky/engine/tonic/dart_library_loader.h" |
| 10 #include "sky/engine/tonic/dart_string_cache.h" | 11 #include "sky/engine/tonic/dart_string_cache.h" |
| 11 #include "sky/engine/tonic/dart_timer_heap.h" | 12 #include "sky/engine/tonic/dart_timer_heap.h" |
| 12 #include "sky/engine/wtf/PassOwnPtr.h" | 13 #include "sky/engine/wtf/PassOwnPtr.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 DartState::Scope::Scope(DartState* dart_state) : scope_(dart_state->isolate()) { | 17 DartState::Scope::Scope(DartState* dart_state) : scope_(dart_state->isolate()) { |
| 17 } | 18 } |
| 18 | 19 |
| 19 DartState::Scope::~Scope() { | 20 DartState::Scope::~Scope() { |
| 20 } | 21 } |
| 21 | 22 |
| 22 DartState::DartState() | 23 DartState::DartState() |
| 23 : isolate_(NULL), | 24 : isolate_(NULL), |
| 24 class_library_(adoptPtr(new DartClassLibrary)), | 25 class_library_(adoptPtr(new DartClassLibrary)), |
| 26 exception_factory_(adoptPtr(new DartExceptionFactory(this))), |
| 27 library_loader_(adoptPtr(new DartLibraryLoader(this))), |
| 25 string_cache_(adoptPtr(new DartStringCache)), | 28 string_cache_(adoptPtr(new DartStringCache)), |
| 26 exception_factory_(adoptPtr(new DartExceptionFactory(this))), | |
| 27 timer_heap_(adoptPtr(new DartTimerHeap())), | 29 timer_heap_(adoptPtr(new DartTimerHeap())), |
| 28 weak_factory_(this) { | 30 weak_factory_(this) { |
| 29 } | 31 } |
| 30 | 32 |
| 31 DartState::~DartState() { | 33 DartState::~DartState() { |
| 32 } | 34 } |
| 33 | 35 |
| 34 void DartState::SetIsolate(Dart_Isolate isolate) { | 36 void DartState::SetIsolate(Dart_Isolate isolate) { |
| 35 isolate_ = isolate; | 37 isolate_ = isolate; |
| 36 if (!isolate_) | 38 if (!isolate_) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 50 | 52 |
| 51 DartState* DartState::Current() { | 53 DartState* DartState::Current() { |
| 52 return static_cast<DartState*>(Dart_CurrentIsolateData()); | 54 return static_cast<DartState*>(Dart_CurrentIsolateData()); |
| 53 } | 55 } |
| 54 | 56 |
| 55 base::WeakPtr<DartState> DartState::GetWeakPtr() { | 57 base::WeakPtr<DartState> DartState::GetWeakPtr() { |
| 56 return weak_factory_.GetWeakPtr(); | 58 return weak_factory_.GetWeakPtr(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |