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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class RingServiceIdZone : public ServiceIdZone { | 44 class RingServiceIdZone : public ServiceIdZone { |
45 public: | 45 public: |
46 RingServiceIdZone(); | 46 RingServiceIdZone(); |
47 virtual ~RingServiceIdZone(); | 47 virtual ~RingServiceIdZone(); |
48 | 48 |
49 void Init(ObjectIdRing* ring, ObjectIdRing::IdPolicy policy); | 49 void Init(ObjectIdRing* ring, ObjectIdRing::IdPolicy policy); |
50 | 50 |
51 // Returned string will be zone allocated. | 51 // Returned string will be zone allocated. |
52 virtual char* GetServiceId(const Object& obj); | 52 virtual char* GetServiceId(const Object& obj); |
53 | 53 |
54 void set_policy(ObjectIdRing::IdPolicy policy) { | 54 void set_policy(ObjectIdRing::IdPolicy policy) { policy_ = policy; } |
55 policy_ = policy; | |
56 } | |
57 | 55 |
58 ObjectIdRing::IdPolicy policy() const { | 56 ObjectIdRing::IdPolicy policy() const { return policy_; } |
59 return policy_; | |
60 } | |
61 | 57 |
62 private: | 58 private: |
63 ObjectIdRing* ring_; | 59 ObjectIdRing* ring_; |
64 ObjectIdRing::IdPolicy policy_; | 60 ObjectIdRing::IdPolicy policy_; |
65 }; | 61 }; |
66 | 62 |
67 | 63 |
68 class StreamInfo { | 64 class StreamInfo { |
69 public: | 65 public: |
70 explicit StreamInfo(const char* id) : id_(id), enabled_(false) {} | 66 explicit StreamInfo(const char* id) : id_(id), enabled_(false) {} |
(...skipping 21 matching lines...) Expand all Loading... |
92 // Handles a message which is directed to a particular isolate. | 88 // Handles a message which is directed to a particular isolate. |
93 static void HandleIsolateMessage(Isolate* isolate, const Array& message); | 89 static void HandleIsolateMessage(Isolate* isolate, const Array& message); |
94 | 90 |
95 static void HandleEvent(ServiceEvent* event); | 91 static void HandleEvent(ServiceEvent* event); |
96 | 92 |
97 static void RegisterIsolateEmbedderCallback( | 93 static void RegisterIsolateEmbedderCallback( |
98 const char* name, | 94 const char* name, |
99 Dart_ServiceRequestCallback callback, | 95 Dart_ServiceRequestCallback callback, |
100 void* user_data); | 96 void* user_data); |
101 | 97 |
102 static void RegisterRootEmbedderCallback( | 98 static void RegisterRootEmbedderCallback(const char* name, |
103 const char* name, | 99 Dart_ServiceRequestCallback callback, |
104 Dart_ServiceRequestCallback callback, | 100 void* user_data); |
105 void* user_data); | |
106 | 101 |
107 static void SetEmbedderStreamCallbacks( | 102 static void SetEmbedderStreamCallbacks( |
108 Dart_ServiceStreamListenCallback listen_callback, | 103 Dart_ServiceStreamListenCallback listen_callback, |
109 Dart_ServiceStreamCancelCallback cancel_callback); | 104 Dart_ServiceStreamCancelCallback cancel_callback); |
110 | 105 |
111 static void SetGetServiceAssetsCallback( | 106 static void SetGetServiceAssetsCallback( |
112 Dart_GetVMServiceAssetsArchive get_service_assets); | 107 Dart_GetVMServiceAssetsArchive get_service_assets); |
113 | 108 |
114 static void SendEchoEvent(Isolate* isolate, const char* text); | 109 static void SendEchoEvent(Isolate* isolate, const char* text); |
115 static void SendGraphEvent(Thread* thread, bool collect_garbage); | 110 static void SendGraphEvent(Thread* thread, bool collect_garbage); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 static bool needs_isolate_events_; | 210 static bool needs_isolate_events_; |
216 static bool needs_debug_events_; | 211 static bool needs_debug_events_; |
217 static bool needs_gc_events_; | 212 static bool needs_gc_events_; |
218 static bool needs_echo_events_; | 213 static bool needs_echo_events_; |
219 static bool needs_graph_events_; | 214 static bool needs_graph_events_; |
220 }; | 215 }; |
221 | 216 |
222 } // namespace dart | 217 } // namespace dart |
223 | 218 |
224 #endif // RUNTIME_VM_SERVICE_H_ | 219 #endif // RUNTIME_VM_SERVICE_H_ |
OLD | NEW |