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

Unified Diff: runtime/vm/service.cc

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/service.h ('k') | runtime/vm/service/service.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index f62e38f1698570d8616170358f3b2e6ce1db4a39..0a638c1f972a6d2dd43d2937d5f8fb5a65e7198b 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -27,6 +27,7 @@
#include "vm/port.h"
#include "vm/profiler_service.h"
#include "vm/reusable_handles.h"
+#include "vm/service_event.h"
#include "vm/service_isolate.h"
#include "vm/stack_frame.h"
#include "vm/symbols.h"
@@ -501,13 +502,18 @@ bool Service::EventMaskHas(uint32_t mask) {
}
+bool Service::NeedsEvents() {
+ return ServiceIsolate::IsRunning();
+}
+
+
bool Service::NeedsDebuggerEvents() {
- return ServiceIsolate::IsRunning() && EventMaskHas(kEventFamilyDebugMask);
+ return NeedsEvents() && EventMaskHas(kEventFamilyDebugMask);
}
bool Service::NeedsGCEvents() {
- return ServiceIsolate::IsRunning() && EventMaskHas(kEventFamilyGCMask);
+ return NeedsEvents() && EventMaskHas(kEventFamilyGCMask);
}
@@ -583,7 +589,7 @@ void Service::HandleGCEvent(GCEvent* event) {
}
-void Service::HandleDebuggerEvent(DebuggerEvent* event) {
+void Service::HandleEvent(ServiceEvent* event) {
JSONStream js;
event->PrintJSON(&js);
const String& message = String::Handle(String::New(js.ToCString()));
@@ -2016,8 +2022,8 @@ static bool Resume(Isolate* isolate, JSONStream* js) {
jsobj.AddProperty("type", "Success");
jsobj.AddProperty("id", "");
{
- DebuggerEvent resumeEvent(isolate, DebuggerEvent::kIsolateResumed);
- Service::HandleDebuggerEvent(&resumeEvent);
+ ServiceEvent event(isolate, ServiceEvent::kResume);
+ Service::HandleEvent(&event);
}
return true;
}
@@ -2054,21 +2060,6 @@ static bool Resume(Isolate* isolate, JSONStream* js) {
}
-static const MethodParameter* get_breakpoints_params[] = {
- ISOLATE_PARAMETER,
- NULL,
-};
-
-
-static bool GetBreakpoints(Isolate* isolate, JSONStream* js) {
- JSONObject jsobj(js);
- jsobj.AddProperty("type", "BreakpointList");
- JSONArray jsarr(&jsobj, "breakpoints");
- isolate->debugger()->PrintBreakpointsToJSONArray(&jsarr);
- return true;
-}
-
-
static const MethodParameter* pause_params[] = {
ISOLATE_PARAMETER,
NULL,
@@ -2517,8 +2508,6 @@ static ServiceMethodDescriptor service_methods_[] = {
eval_params },
{ "getAllocationProfile", GetAllocationProfile,
get_allocation_profile_params },
- { "getBreakpoints", GetBreakpoints,
- get_breakpoints_params },
{ "getCallSiteData", GetCallSiteData,
get_call_site_data_params },
{ "getClassList", GetClassList,
« no previous file with comments | « runtime/vm/service.h ('k') | runtime/vm/service/service.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698