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 RUNTIME_VM_SERVICE_H_ | 5 #ifndef RUNTIME_VM_SERVICE_H_ |
6 #define RUNTIME_VM_SERVICE_H_ | 6 #define RUNTIME_VM_SERVICE_H_ |
7 | 7 |
8 #include "include/dart_tools_api.h" | 8 #include "include/dart_tools_api.h" |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
11 #include "vm/object_graph.h" | 11 #include "vm/object_graph.h" |
12 #include "vm/object_id_ring.h" | 12 #include "vm/object_id_ring.h" |
13 #include "vm/os_thread.h" | 13 #include "vm/os_thread.h" |
14 | 14 |
15 namespace dart { | 15 namespace dart { |
16 | 16 |
17 #define SERVICE_PROTOCOL_MAJOR_VERSION 3 | 17 #define SERVICE_PROTOCOL_MAJOR_VERSION 3 |
18 #define SERVICE_PROTOCOL_MINOR_VERSION 5 | 18 #define SERVICE_PROTOCOL_MINOR_VERSION 5 |
19 | 19 |
20 class Array; | 20 class Array; |
21 class EmbedderServiceHandler; | 21 class EmbedderServiceHandler; |
22 class Error; | 22 class Error; |
23 class GCEvent; | 23 class GCEvent; |
24 class GrowableObjectArray; | 24 class GrowableObjectArray; |
25 class Instance; | 25 class Instance; |
26 class Isolate; | 26 class Isolate; |
27 class JSONStream; | 27 class JSONStream; |
| 28 class JSONObject; |
28 class Object; | 29 class Object; |
29 class RawInstance; | 30 class RawInstance; |
30 class RawError; | 31 class RawError; |
31 class ServiceEvent; | 32 class ServiceEvent; |
32 class String; | 33 class String; |
33 | 34 |
34 class ServiceIdZone { | 35 class ServiceIdZone { |
35 public: | 36 public: |
36 ServiceIdZone(); | 37 ServiceIdZone(); |
37 virtual ~ServiceIdZone(); | 38 virtual ~ServiceIdZone(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 94 |
94 static void RegisterIsolateEmbedderCallback( | 95 static void RegisterIsolateEmbedderCallback( |
95 const char* name, | 96 const char* name, |
96 Dart_ServiceRequestCallback callback, | 97 Dart_ServiceRequestCallback callback, |
97 void* user_data); | 98 void* user_data); |
98 | 99 |
99 static void RegisterRootEmbedderCallback(const char* name, | 100 static void RegisterRootEmbedderCallback(const char* name, |
100 Dart_ServiceRequestCallback callback, | 101 Dart_ServiceRequestCallback callback, |
101 void* user_data); | 102 void* user_data); |
102 | 103 |
| 104 static void SetEmbedderInformationCallback( |
| 105 Dart_EmbedderInformationCallback callback); |
| 106 |
103 static void SetEmbedderStreamCallbacks( | 107 static void SetEmbedderStreamCallbacks( |
104 Dart_ServiceStreamListenCallback listen_callback, | 108 Dart_ServiceStreamListenCallback listen_callback, |
105 Dart_ServiceStreamCancelCallback cancel_callback); | 109 Dart_ServiceStreamCancelCallback cancel_callback); |
106 | 110 |
107 static void SetGetServiceAssetsCallback( | 111 static void SetGetServiceAssetsCallback( |
108 Dart_GetVMServiceAssetsArchive get_service_assets); | 112 Dart_GetVMServiceAssetsArchive get_service_assets); |
109 | 113 |
110 static void SendEchoEvent(Isolate* isolate, const char* text); | 114 static void SendEchoEvent(Isolate* isolate, const char* text); |
111 static void SendGraphEvent(Thread* thread, | 115 static void SendGraphEvent(Thread* thread, |
112 ObjectGraph::SnapshotRoots roots, | 116 ObjectGraph::SnapshotRoots roots, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 160 |
157 static RawObject* RequestAssets(); | 161 static RawObject* RequestAssets(); |
158 | 162 |
159 static Dart_ServiceStreamListenCallback stream_listen_callback() { | 163 static Dart_ServiceStreamListenCallback stream_listen_callback() { |
160 return stream_listen_callback_; | 164 return stream_listen_callback_; |
161 } | 165 } |
162 static Dart_ServiceStreamCancelCallback stream_cancel_callback() { | 166 static Dart_ServiceStreamCancelCallback stream_cancel_callback() { |
163 return stream_cancel_callback_; | 167 return stream_cancel_callback_; |
164 } | 168 } |
165 | 169 |
| 170 static void PrintJSONForEmbedderInformation(JSONObject *jsobj); |
166 static void PrintJSONForVM(JSONStream* js, bool ref); | 171 static void PrintJSONForVM(JSONStream* js, bool ref); |
167 | 172 |
168 static void CheckForPause(Isolate* isolate, JSONStream* stream); | 173 static void CheckForPause(Isolate* isolate, JSONStream* stream); |
169 | 174 |
| 175 static int64_t CurrentRSS(); |
| 176 static int64_t MaxRSS(); |
| 177 |
170 private: | 178 private: |
171 static RawError* InvokeMethod(Isolate* isolate, | 179 static RawError* InvokeMethod(Isolate* isolate, |
172 const Array& message, | 180 const Array& message, |
173 bool parameters_are_dart_objects = false); | 181 bool parameters_are_dart_objects = false); |
174 | 182 |
175 static void EmbedderHandleMessage(EmbedderServiceHandler* handler, | 183 static void EmbedderHandleMessage(EmbedderServiceHandler* handler, |
176 JSONStream* js); | 184 JSONStream* js); |
177 | 185 |
178 static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name); | 186 static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name); |
179 static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name); | 187 static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name); |
(...skipping 22 matching lines...) Expand all Loading... |
202 const char* kind, | 210 const char* kind, |
203 JSONStream* event); | 211 JSONStream* event); |
204 | 212 |
205 static RawError* MaybePause(Isolate* isolate, const Error& error); | 213 static RawError* MaybePause(Isolate* isolate, const Error& error); |
206 | 214 |
207 static EmbedderServiceHandler* isolate_service_handler_head_; | 215 static EmbedderServiceHandler* isolate_service_handler_head_; |
208 static EmbedderServiceHandler* root_service_handler_head_; | 216 static EmbedderServiceHandler* root_service_handler_head_; |
209 static Dart_ServiceStreamListenCallback stream_listen_callback_; | 217 static Dart_ServiceStreamListenCallback stream_listen_callback_; |
210 static Dart_ServiceStreamCancelCallback stream_cancel_callback_; | 218 static Dart_ServiceStreamCancelCallback stream_cancel_callback_; |
211 static Dart_GetVMServiceAssetsArchive get_service_assets_callback_; | 219 static Dart_GetVMServiceAssetsArchive get_service_assets_callback_; |
| 220 static Dart_EmbedderInformationCallback embedder_information_callback_; |
212 | 221 |
213 static bool needs_isolate_events_; | 222 static bool needs_isolate_events_; |
214 static bool needs_debug_events_; | 223 static bool needs_debug_events_; |
215 static bool needs_gc_events_; | 224 static bool needs_gc_events_; |
216 static bool needs_echo_events_; | 225 static bool needs_echo_events_; |
217 static bool needs_graph_events_; | 226 static bool needs_graph_events_; |
218 }; | 227 }; |
219 | 228 |
220 } // namespace dart | 229 } // namespace dart |
221 | 230 |
222 #endif // RUNTIME_VM_SERVICE_H_ | 231 #endif // RUNTIME_VM_SERVICE_H_ |
OLD | NEW |