Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Unified Diff: runtime/vm/service.h

Issue 340443006: Add support for asynchronous event notification to the observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698