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

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

Issue 1537523002: Add dart:developer.postEvent for posting events to the service protocol from Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/service.md ('k') | runtime/vm/service_event.cc » ('j') | 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 #ifndef VM_SERVICE_EVENT_H_ 5 #ifndef VM_SERVICE_EVENT_H_
6 #define VM_SERVICE_EVENT_H_ 6 #define VM_SERVICE_EVENT_H_
7 7
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 9
10 class DebuggerEvent; 10 class DebuggerEvent;
(...skipping 23 matching lines...) Expand all
34 kBreakpointRemoved, 34 kBreakpointRemoved,
35 kInspect, 35 kInspect,
36 kDebuggerSettingsUpdate, 36 kDebuggerSettingsUpdate,
37 37
38 kGC, 38 kGC,
39 39
40 kEmbedder, 40 kEmbedder,
41 41
42 kLogging, 42 kLogging,
43 43
44 kExtension,
45
44 kIllegal, 46 kIllegal,
45 }; 47 };
46 48
47 struct LogRecord { 49 struct LogRecord {
48 int64_t sequence_number; 50 int64_t sequence_number;
49 int64_t timestamp; 51 int64_t timestamp;
50 intptr_t level; 52 intptr_t level;
51 const String* name; 53 const String* name;
52 const String* message; 54 const String* message;
53 const Instance* zone; 55 const Instance* zone;
54 const Object* error; 56 const Object* error;
55 const Instance* stack_trace; 57 const Instance* stack_trace;
56 }; 58 };
57 59
60 struct ExtensionEvent {
61 const String* event_kind;
62 const String* event_data;
63 };
64
58 ServiceEvent(Isolate* isolate, EventKind event_kind); 65 ServiceEvent(Isolate* isolate, EventKind event_kind);
59 66
60 explicit ServiceEvent(const DebuggerEvent* debugger_event); 67 explicit ServiceEvent(const DebuggerEvent* debugger_event);
61 68
62 Isolate* isolate() const { return isolate_; } 69 Isolate* isolate() const { return isolate_; }
63 70
64 EventKind kind() const { return kind_; } 71 EventKind kind() const { return kind_; }
65 72
66 const char* embedder_kind() const { return embedder_kind_; } 73 const char* embedder_kind() const { return embedder_kind_; }
67 74
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 162
156 void set_bytes(const uint8_t* bytes, intptr_t bytes_length) { 163 void set_bytes(const uint8_t* bytes, intptr_t bytes_length) {
157 bytes_ = bytes; 164 bytes_ = bytes;
158 bytes_length_ = bytes_length; 165 bytes_length_ = bytes_length;
159 } 166 }
160 167
161 void set_log_record(const LogRecord& log_record) { 168 void set_log_record(const LogRecord& log_record) {
162 log_record_ = log_record; 169 log_record_ = log_record;
163 } 170 }
164 171
172 void set_extension_event(const ExtensionEvent& extension_event) {
173 extension_event_ = extension_event;
174 }
175
165 int64_t timestamp() const { 176 int64_t timestamp() const {
166 return timestamp_; 177 return timestamp_;
167 } 178 }
168 179
169 void PrintJSON(JSONStream* js) const; 180 void PrintJSON(JSONStream* js) const;
170 181
171 void PrintJSONHeader(JSONObject* jsobj) const; 182 void PrintJSONHeader(JSONObject* jsobj) const;
172 183
173 private: 184 private:
174 Isolate* isolate_; 185 Isolate* isolate_;
175 EventKind kind_; 186 EventKind kind_;
176 const char* embedder_kind_; 187 const char* embedder_kind_;
177 const char* embedder_stream_id_; 188 const char* embedder_stream_id_;
178 Breakpoint* breakpoint_; 189 Breakpoint* breakpoint_;
179 ActivationFrame* top_frame_; 190 ActivationFrame* top_frame_;
180 const String* extension_rpc_; 191 const String* extension_rpc_;
181 const Object* exception_; 192 const Object* exception_;
182 const Object* async_continuation_; 193 const Object* async_continuation_;
183 bool at_async_jump_; 194 bool at_async_jump_;
184 const Object* inspectee_; 195 const Object* inspectee_;
185 const Heap::GCStats* gc_stats_; 196 const Heap::GCStats* gc_stats_;
186 const uint8_t* bytes_; 197 const uint8_t* bytes_;
187 intptr_t bytes_length_; 198 intptr_t bytes_length_;
188 LogRecord log_record_; 199 LogRecord log_record_;
200 ExtensionEvent extension_event_;
189 int64_t timestamp_; 201 int64_t timestamp_;
190 }; 202 };
191 203
192 } // namespace dart 204 } // namespace dart
193 205
194 #endif // VM_SERVICE_EVENT_H_ 206 #endif // VM_SERVICE_EVENT_H_
OLDNEW
« no previous file with comments | « runtime/vm/service/service.md ('k') | runtime/vm/service_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698