| Index: runtime/vm/service.h
|
| diff --git a/runtime/vm/service.h b/runtime/vm/service.h
|
| index c3cdce955197214b8a5ffc9eb1f15c020f397df2..2ee5ad4f9c2aa9f11cc922ae514465a5568bbe49 100644
|
| --- a/runtime/vm/service.h
|
| +++ b/runtime/vm/service.h
|
| @@ -11,11 +11,13 @@
|
|
|
| namespace dart {
|
|
|
| +class DebuggerEvent;
|
| class EmbedderServiceHandler;
|
| class Instance;
|
| class Isolate;
|
| class JSONStream;
|
| class RawInstance;
|
| +class String;
|
|
|
| class Service : public AllStatic {
|
| public:
|
| @@ -28,7 +30,19 @@ class Service : public AllStatic {
|
| static Isolate* GetServiceIsolate(void* callback_data);
|
| static bool SendIsolateStartupMessage();
|
| static bool SendIsolateShutdownMessage();
|
| - static bool IsRunning();
|
| +
|
| + static bool IsRunning() {
|
| + return port_ != ILLEGAL_PORT;
|
| + }
|
| +
|
| + static void SetEventMask(uint32_t mask);
|
| +
|
| + // Is the service interested in debugger events?
|
| + static bool NeedsDebuggerEvents() {
|
| + return IsRunning() && ((event_mask_ & kEventFamilyDebugMask) != 0);
|
| + }
|
| +
|
| + static void HandleDebuggerEvent(DebuggerEvent* event);
|
|
|
| static void RegisterIsolateEmbedderCallback(
|
| const char* name,
|
| @@ -45,18 +59,26 @@ class Service : public AllStatic {
|
| }
|
|
|
| private:
|
| + // These must be kept in sync with service/constants.dart
|
| + static const int kEventFamilyDebug = 0;
|
| + static const uint32_t kEventFamilyDebugMask = (1 << kEventFamilyDebug);
|
| +
|
| static void EmbedderHandleMessage(EmbedderServiceHandler* handler,
|
| JSONStream* js);
|
| static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name);
|
| - static EmbedderServiceHandler* isolate_service_handler_head_;
|
| static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name);
|
| + static Dart_Handle GetSource(const char* name);
|
| + static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library,
|
| + Dart_Handle url);
|
| + static void SendEvent(intptr_t eventId, const String& eventMessage);
|
| +
|
| + static EmbedderServiceHandler* isolate_service_handler_head_;
|
| static EmbedderServiceHandler* root_service_handler_head_;
|
| +
|
| static Isolate* service_isolate_;
|
| static Dart_LibraryTagHandler default_handler_;
|
| static Dart_Port port_;
|
| - static Dart_Handle GetSource(const char* name);
|
| - static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library,
|
| - Dart_Handle url);
|
| + static uint32_t event_mask_;
|
| };
|
|
|
| } // namespace dart
|
|
|