Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef RUNTIME_VM_KERNEL_ISOLATE_H_ | |
| 6 #define RUNTIME_VM_KERNEL_ISOLATE_H_ | |
| 7 | |
| 8 #if !defined(DART_PRECOMPILED_RUNTIME) | |
| 9 | |
| 10 #include "include/dart_api.h" | |
| 11 | |
| 12 #include "vm/allocation.h" | |
| 13 #include "vm/dart.h" | |
| 14 #include "vm/os_thread.h" | |
| 15 | |
| 16 namespace dart { | |
| 17 | |
| 18 class ObjectPointerVisitor; | |
| 19 class SendPort; | |
| 20 | |
| 21 class KernelIsolate : public AllStatic { | |
| 22 public: | |
| 23 static const char* kName; | |
| 24 | |
| 25 static void Run(); | |
| 26 | |
| 27 static bool Exists(); | |
| 28 static bool IsRunning(); | |
| 29 static bool IsKernelIsolate(const Isolate* isolate); | |
| 30 static Dart_Port WaitForKernelPort(); | |
| 31 static Dart_Port KernelPort() { return kernel_port_; } | |
| 32 | |
| 33 static bool LoadScript(const String& url, const String& source); | |
| 34 | |
| 35 protected: | |
| 36 static Monitor* monitor_; | |
| 37 static Dart_IsolateCreateCallback create_callback_; | |
| 38 | |
| 39 static void InitCallback(Isolate* I); | |
| 40 static void SetKernelIsolate(Isolate* isolate); | |
| 41 static void SetLoadPort(Dart_Port port); | |
| 42 static void FinishedInitializing(); | |
| 43 static void FinishedExiting(); | |
| 44 | |
| 45 static Dart_Port kernel_port_; | |
| 46 static Isolate* isolate_; | |
| 47 static bool initializing_; | |
| 48 static bool shutting_down_; | |
| 49 | |
| 50 | |
| 51 static Dart_IsolateCreateCallback create_callback() { | |
| 52 return create_callback_; | |
| 53 } | |
| 54 | |
| 55 friend class Dart; | |
| 56 friend class RunKernelTask; | |
| 57 }; | |
|
siva
2016/12/02 20:59:38
I agree that this class can be refactored to suppo
hausner
2016/12/03 01:29:00
I agree, but would like to address this in a later
| |
| 58 | |
| 59 } // namespace dart | |
| 60 | |
| 61 #endif // DART_PRECOMPILED_RUNTIME | |
| 62 | |
| 63 #endif // RUNTIME_VM_KERNEL_ISOLATE_H_ | |
| OLD | NEW |