OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, 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 VM_SERVICE_ISOLATE_H_ |
| 6 #define VM_SERVICE_ISOLATE_H_ |
| 7 |
| 8 #include "include/dart_api.h" |
| 9 |
| 10 #include "vm/allocation.h" |
| 11 #include "vm/os_thread.h" |
| 12 |
| 13 namespace dart { |
| 14 |
| 15 class ServiceIsolate : public AllStatic { |
| 16 public: |
| 17 static const char* kName; |
| 18 static bool NameEquals(const char* name); |
| 19 |
| 20 static bool Exists(); |
| 21 static bool IsRunning(); |
| 22 static bool IsServiceIsolate(Isolate* isolate); |
| 23 static Dart_Port Port(); |
| 24 |
| 25 static Dart_Port WaitForLoadPort(); |
| 26 static Dart_Port LoadPort(); |
| 27 |
| 28 static void Run(); |
| 29 static bool SendIsolateStartupMessage(); |
| 30 static bool SendIsolateShutdownMessage(); |
| 31 |
| 32 protected: |
| 33 static void SetServicePort(Dart_Port port); |
| 34 static void SetServiceIsolate(Isolate* isolate); |
| 35 static void SetLoadPort(Dart_Port port); |
| 36 static void FinishedInitializing(); |
| 37 static void MaybeInjectVMServiceLibrary(Isolate* isolate); |
| 38 static Dart_IsolateCreateCallback create_callback() { |
| 39 return create_callback_; |
| 40 } |
| 41 |
| 42 static Dart_Handle GetSource(const char* name); |
| 43 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library, |
| 44 Dart_Handle url); |
| 45 |
| 46 static Dart_IsolateCreateCallback create_callback_; |
| 47 static Monitor* monitor_; |
| 48 static bool initializing_; |
| 49 static Isolate* isolate_; |
| 50 static Dart_Port port_; |
| 51 static Dart_Port load_port_; |
| 52 |
| 53 friend class Dart; |
| 54 friend class RunServiceTask; |
| 55 friend class ServiceIsolateNatives; |
| 56 }; |
| 57 |
| 58 } // namespace dart |
| 59 |
| 60 #endif // VM_SERVICE_ISOLATE_H_ |
OLD | NEW |