| 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 #ifndef SKY_ENGINE_TONIC_DART_STATE_H_ | 5 #ifndef SKY_ENGINE_TONIC_DART_STATE_H_ |
| 6 #define SKY_ENGINE_TONIC_DART_STATE_H_ | 6 #define SKY_ENGINE_TONIC_DART_STATE_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 static DartState* From(Dart_Isolate isolate); | 44 static DartState* From(Dart_Isolate isolate); |
| 45 static DartState* Current(); | 45 static DartState* Current(); |
| 46 | 46 |
| 47 base::WeakPtr<DartState> GetWeakPtr(); | 47 base::WeakPtr<DartState> GetWeakPtr(); |
| 48 | 48 |
| 49 Dart_Isolate isolate() { return isolate_; } | 49 Dart_Isolate isolate() { return isolate_; } |
| 50 void set_isolate(Dart_Isolate isolate) { | 50 void set_isolate(Dart_Isolate isolate) { |
| 51 CHECK(!isolate_); | 51 CHECK(!isolate_); |
| 52 isolate_ = isolate; | 52 isolate_ = isolate; |
| 53 DidSetIsolate(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 DartClassLibrary& class_library() { return *class_library_; } | 56 DartClassLibrary& class_library() { return *class_library_; } |
| 56 DartStringCache& string_cache() { return *string_cache_; } | 57 DartStringCache& string_cache() { return *string_cache_; } |
| 57 DartExceptionFactory& exception_factory() { return *exception_factory_; } | 58 DartExceptionFactory& exception_factory() { return *exception_factory_; } |
| 58 DartTimerHeap& timer_heap() { return *timer_heap_; } | 59 DartTimerHeap& timer_heap() { return *timer_heap_; } |
| 59 | 60 |
| 61 virtual void DidSetIsolate() {} |
| 62 |
| 60 private: | 63 private: |
| 61 Dart_Isolate isolate_; | 64 Dart_Isolate isolate_; |
| 62 OwnPtr<DartClassLibrary> class_library_; | 65 OwnPtr<DartClassLibrary> class_library_; |
| 63 OwnPtr<DartStringCache> string_cache_; | 66 OwnPtr<DartStringCache> string_cache_; |
| 64 OwnPtr<DartExceptionFactory> exception_factory_; | 67 OwnPtr<DartExceptionFactory> exception_factory_; |
| 65 OwnPtr<DartTimerHeap> timer_heap_; | 68 OwnPtr<DartTimerHeap> timer_heap_; |
| 66 | 69 |
| 67 base::WeakPtrFactory<DartState> weak_factory_; | 70 base::WeakPtrFactory<DartState> weak_factory_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(DartState); | 72 DISALLOW_COPY_AND_ASSIGN(DartState); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace blink | 75 } // namespace blink |
| 73 | 76 |
| 74 #endif // SKY_ENGINE_TONIC_DART_STATE_H_ | 77 #endif // SKY_ENGINE_TONIC_DART_STATE_H_ |
| OLD | NEW |