| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_SERVICE_H_ | 5 #ifndef VM_SERVICE_H_ |
| 6 #define VM_SERVICE_H_ | 6 #define VM_SERVICE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const char* name, | 65 const char* name, |
| 66 Dart_ServiceRequestCallback callback, | 66 Dart_ServiceRequestCallback callback, |
| 67 void* user_data); | 67 void* user_data); |
| 68 | 68 |
| 69 static bool IsServiceIsolate(Isolate* isolate) { | 69 static bool IsServiceIsolate(Isolate* isolate) { |
| 70 return isolate == service_isolate_; | 70 return isolate == service_isolate_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 static void SendEchoEvent(Isolate* isolate); | 73 static void SendEchoEvent(Isolate* isolate); |
| 74 | 74 |
| 75 static void MaybeInjectVMServiceLibrary(Isolate* isolate); |
| 76 |
| 77 static void RunService(); |
| 78 |
| 75 private: | 79 private: |
| 76 // These must be kept in sync with service/constants.dart | 80 // These must be kept in sync with service/constants.dart |
| 77 static const int kEventFamilyDebug = 0; | 81 static const int kEventFamilyDebug = 0; |
| 78 static const int kEventFamilyGC = 1; | 82 static const int kEventFamilyGC = 1; |
| 79 static const uint32_t kEventFamilyDebugMask = (1 << kEventFamilyDebug); | 83 static const uint32_t kEventFamilyDebugMask = (1 << kEventFamilyDebug); |
| 80 static const uint32_t kEventFamilyGCMask = (1 << kEventFamilyGC); | 84 static const uint32_t kEventFamilyGCMask = (1 << kEventFamilyGC); |
| 81 | 85 |
| 82 static void EmbedderHandleMessage(EmbedderServiceHandler* handler, | 86 static void EmbedderHandleMessage(EmbedderServiceHandler* handler, |
| 83 JSONStream* js); | 87 JSONStream* js); |
| 88 |
| 84 static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name); | 89 static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name); |
| 85 static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name); | 90 static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name); |
| 86 static Dart_Handle GetSource(const char* name); | 91 static Dart_Handle GetSource(const char* name); |
| 87 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library, | 92 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library, |
| 88 Dart_Handle url); | 93 Dart_Handle url); |
| 94 |
| 89 static void SendEvent(intptr_t eventId, const Object& eventMessage); | 95 static void SendEvent(intptr_t eventId, const Object& eventMessage); |
| 90 // Does not take ownership of 'data'. | 96 // Does not take ownership of 'data'. |
| 91 static void SendEvent(intptr_t eventId, | 97 static void SendEvent(intptr_t eventId, |
| 92 const String& meta, | 98 const String& meta, |
| 93 const uint8_t* data, | 99 const uint8_t* data, |
| 94 intptr_t size); | 100 intptr_t size); |
| 95 | 101 |
| 96 static EmbedderServiceHandler* isolate_service_handler_head_; | 102 static EmbedderServiceHandler* isolate_service_handler_head_; |
| 97 static EmbedderServiceHandler* root_service_handler_head_; | 103 static EmbedderServiceHandler* root_service_handler_head_; |
| 98 | 104 |
| 99 static Isolate* service_isolate_; | 105 static Isolate* service_isolate_; |
| 100 static Dart_LibraryTagHandler embedder_provided_handler_; | |
| 101 static Dart_Port port_; | 106 static Dart_Port port_; |
| 102 static uint32_t event_mask_; | 107 static uint32_t event_mask_; |
| 103 }; | 108 }; |
| 104 | 109 |
| 105 } // namespace dart | 110 } // namespace dart |
| 106 | 111 |
| 107 #endif // VM_SERVICE_H_ | 112 #endif // VM_SERVICE_H_ |
| OLD | NEW |