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

Side by Side Diff: runtime/vm/service_event.cc

Issue 1398823002: We can now name the current VM using the service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/service_event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 #include "vm/service_event.h" 5 #include "vm/service_event.h"
6 6
7 #include "vm/message_handler.h" 7 #include "vm/message_handler.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 set_top_frame(debugger_event->top_frame()); 84 set_top_frame(debugger_event->top_frame());
85 } 85 }
86 if (debugger_event->timestamp() != -1) { 86 if (debugger_event->timestamp() != -1) {
87 timestamp_ = debugger_event->timestamp(); 87 timestamp_ = debugger_event->timestamp();
88 } 88 }
89 } 89 }
90 90
91 91
92 const char* ServiceEvent::KindAsCString() const { 92 const char* ServiceEvent::KindAsCString() const {
93 switch (kind()) { 93 switch (kind()) {
94 case kVMUpdate:
95 return "VMUpdate";
94 case kIsolateStart: 96 case kIsolateStart:
95 return "IsolateStart"; 97 return "IsolateStart";
96 case kIsolateRunnable: 98 case kIsolateRunnable:
97 return "IsolateRunnable"; 99 return "IsolateRunnable";
98 case kIsolateExit: 100 case kIsolateExit:
99 return "IsolateExit"; 101 return "IsolateExit";
100 case kIsolateUpdate: 102 case kIsolateUpdate:
101 return "IsolateUpdate"; 103 return "IsolateUpdate";
102 case kPauseStart: 104 case kPauseStart:
103 return "PauseStart"; 105 return "PauseStart";
(...skipping 27 matching lines...) Expand all
131 return "Illegal"; 133 return "Illegal";
132 default: 134 default:
133 UNREACHABLE(); 135 UNREACHABLE();
134 return "Unknown"; 136 return "Unknown";
135 } 137 }
136 } 138 }
137 139
138 140
139 const char* ServiceEvent::stream_id() const { 141 const char* ServiceEvent::stream_id() const {
140 switch (kind()) { 142 switch (kind()) {
143 case kVMUpdate:
144 return Service::vm_stream.id();
145
141 case kIsolateStart: 146 case kIsolateStart:
142 case kIsolateRunnable: 147 case kIsolateRunnable:
143 case kIsolateExit: 148 case kIsolateExit:
144 case kIsolateUpdate: 149 case kIsolateUpdate:
145 return Service::isolate_stream.id(); 150 return Service::isolate_stream.id();
146 151
147 case kPauseStart: 152 case kPauseStart:
148 case kPauseExit: 153 case kPauseExit:
149 case kPauseBreakpoint: 154 case kPauseBreakpoint:
150 case kPauseInterrupted: 155 case kPauseInterrupted:
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 logRecord.AddProperty("error", *(log_record_.error)); 232 logRecord.AddProperty("error", *(log_record_.error));
228 logRecord.AddProperty("stackTrace", *(log_record_.stack_trace)); 233 logRecord.AddProperty("stackTrace", *(log_record_.stack_trace));
229 } 234 }
230 } 235 }
231 236
232 237
233 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const { 238 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const {
234 ASSERT(jsobj != NULL); 239 ASSERT(jsobj != NULL);
235 jsobj->AddProperty("type", "Event"); 240 jsobj->AddProperty("type", "Event");
236 jsobj->AddProperty("kind", KindAsCString()); 241 jsobj->AddProperty("kind", KindAsCString());
237 jsobj->AddProperty("isolate", isolate()); 242 if (kind() == kVMUpdate) {
243 jsobj->AddPropertyVM("vm");
244 } else {
245 jsobj->AddProperty("isolate", isolate());
246 }
238 ASSERT(timestamp_ != -1); 247 ASSERT(timestamp_ != -1);
239 jsobj->AddPropertyTimeMillis("timestamp", timestamp_); 248 jsobj->AddPropertyTimeMillis("timestamp", timestamp_);
240 } 249 }
241 250
242 } // namespace dart 251 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698