Line data Source code
1 : // This file is generated
2 :
3 : // Copyright (c) 2016 The Chromium Authors. All rights reserved.
4 : // Use of this source code is governed by a BSD-style license that can be
5 : // found in the LICENSE file.
6 :
7 : #ifndef v8_inspector_protocol_Runtime_h
8 : #define v8_inspector_protocol_Runtime_h
9 :
10 : #include "src/inspector/protocol/Protocol.h"
11 : // For each imported domain we generate a ValueConversions struct instead of a full domain definition
12 : // and include Domain::API version from there.
13 : #include "include/inspector/Runtime.h"
14 :
15 : namespace v8_inspector {
16 : namespace protocol {
17 : namespace Runtime {
18 :
19 : // ------------- Forward and enum declarations.
20 : using ScriptId = String;
21 : using RemoteObjectId = String;
22 : using UnserializableValue = String;
23 : class RemoteObject;
24 : class CustomPreview;
25 : class ObjectPreview;
26 : class PropertyPreview;
27 : class EntryPreview;
28 : class PropertyDescriptor;
29 : class InternalPropertyDescriptor;
30 : class CallArgument;
31 : using ExecutionContextId = int;
32 : class ExecutionContextDescription;
33 : class ExceptionDetails;
34 : using Timestamp = double;
35 : using TimeDelta = double;
36 : class CallFrame;
37 : class StackTrace;
38 : using UniqueDebuggerId = String;
39 : class StackTraceId;
40 : class BindingCalledNotification;
41 : class ConsoleAPICalledNotification;
42 : class ExceptionRevokedNotification;
43 : class ExceptionThrownNotification;
44 : class ExecutionContextCreatedNotification;
45 : class ExecutionContextDestroyedNotification;
46 : using ExecutionContextsClearedNotification = Object;
47 : class InspectRequestedNotification;
48 :
49 : namespace ConsoleAPICalled {
50 : namespace TypeEnum {
51 : extern const char* Log;
52 : extern const char* Debug;
53 : extern const char* Info;
54 : extern const char* Error;
55 : extern const char* Warning;
56 : extern const char* Dir;
57 : extern const char* Dirxml;
58 : extern const char* Table;
59 : extern const char* Trace;
60 : extern const char* Clear;
61 : extern const char* StartGroup;
62 : extern const char* StartGroupCollapsed;
63 : extern const char* EndGroup;
64 : extern const char* Assert;
65 : extern const char* Profile;
66 : extern const char* ProfileEnd;
67 : extern const char* Count;
68 : extern const char* TimeEnd;
69 : } // TypeEnum
70 : } // ConsoleAPICalled
71 :
72 : // ------------- Type and builder declarations.
73 :
74 : class RemoteObject : public Serializable, public API::RemoteObject{
75 : PROTOCOL_DISALLOW_COPY(RemoteObject);
76 : public:
77 : static std::unique_ptr<RemoteObject> fromValue(protocol::Value* value, ErrorSupport* errors);
78 :
79 9198138 : ~RemoteObject() override { }
80 :
81 : struct TypeEnum {
82 : static const char* Object;
83 : static const char* Function;
84 : static const char* Undefined;
85 : static const char* String;
86 : static const char* Number;
87 : static const char* Boolean;
88 : static const char* Symbol;
89 : static const char* Bigint;
90 : }; // TypeEnum
91 :
92 2799377 : String getType() { return m_type; }
93 3066001 : void setType(const String& value) { m_type = value; }
94 :
95 : struct SubtypeEnum {
96 : static const char* Array;
97 : static const char* Null;
98 : static const char* Node;
99 : static const char* Regexp;
100 : static const char* Date;
101 : static const char* Map;
102 : static const char* Set;
103 : static const char* Weakmap;
104 : static const char* Weakset;
105 : static const char* Iterator;
106 : static const char* Generator;
107 : static const char* Error;
108 : static const char* Proxy;
109 : static const char* Promise;
110 : static const char* Typedarray;
111 : static const char* Arraybuffer;
112 : static const char* Dataview;
113 : }; // SubtypeEnum
114 :
115 : bool hasSubtype() { return m_subtype.isJust(); }
116 : String getSubtype(const String& defaultValue) { return m_subtype.isJust() ? m_subtype.fromJust() : defaultValue; }
117 119814 : void setSubtype(const String& value) { m_subtype = value; }
118 :
119 : bool hasClassName() { return m_className.isJust(); }
120 : String getClassName(const String& defaultValue) { return m_className.isJust() ? m_className.fromJust() : defaultValue; }
121 5427834 : void setClassName(const String& value) { m_className = value; }
122 :
123 : bool hasValue() { return m_value.isJust(); }
124 : protocol::Value* getValue(protocol::Value* defaultValue) { return m_value.isJust() ? m_value.fromJust() : defaultValue; }
125 : void setValue(std::unique_ptr<protocol::Value> value) { m_value = std::move(value); }
126 :
127 2835354 : bool hasUnserializableValue() { return m_unserializableValue.isJust(); }
128 : String getUnserializableValue(const String& defaultValue) { return m_unserializableValue.isJust() ? m_unserializableValue.fromJust() : defaultValue; }
129 71954 : void setUnserializableValue(const String& value) { m_unserializableValue = value; }
130 :
131 : bool hasDescription() { return m_description.isJust(); }
132 : String getDescription(const String& defaultValue) { return m_description.isJust() ? m_description.fromJust() : defaultValue; }
133 5825300 : void setDescription(const String& value) { m_description = value; }
134 :
135 : bool hasObjectId() { return m_objectId.isJust(); }
136 : String getObjectId(const String& defaultValue) { return m_objectId.isJust() ? m_objectId.fromJust() : defaultValue; }
137 5464690 : void setObjectId(const String& value) { m_objectId = value; }
138 :
139 : bool hasPreview() { return m_preview.isJust(); }
140 : protocol::Runtime::ObjectPreview* getPreview(protocol::Runtime::ObjectPreview* defaultValue) { return m_preview.isJust() ? m_preview.fromJust() : defaultValue; }
141 : void setPreview(std::unique_ptr<protocol::Runtime::ObjectPreview> value) { m_preview = std::move(value); }
142 :
143 : bool hasCustomPreview() { return m_customPreview.isJust(); }
144 : protocol::Runtime::CustomPreview* getCustomPreview(protocol::Runtime::CustomPreview* defaultValue) { return m_customPreview.isJust() ? m_customPreview.fromJust() : defaultValue; }
145 : void setCustomPreview(std::unique_ptr<protocol::Runtime::CustomPreview> value) { m_customPreview = std::move(value); }
146 :
147 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
148 90 : String serialize() override { return toValue()->serialize(); }
149 : std::unique_ptr<RemoteObject> clone() const;
150 : std::unique_ptr<StringBuffer> toJSONString() const override;
151 :
152 : template<int STATE>
153 : class RemoteObjectBuilder {
154 : public:
155 : enum {
156 : NoFieldsSet = 0,
157 : TypeSet = 1 << 1,
158 : AllFieldsSet = (TypeSet | 0)};
159 :
160 :
161 : RemoteObjectBuilder<STATE | TypeSet>& setType(const String& value)
162 : {
163 : static_assert(!(STATE & TypeSet), "property type should not be set yet");
164 : m_result->setType(value);
165 : return castState<TypeSet>();
166 : }
167 :
168 : RemoteObjectBuilder<STATE>& setSubtype(const String& value)
169 : {
170 95 : m_result->setSubtype(value);
171 : return *this;
172 : }
173 :
174 : RemoteObjectBuilder<STATE>& setClassName(const String& value)
175 : {
176 2713917 : m_result->setClassName(value);
177 : return *this;
178 : }
179 :
180 : RemoteObjectBuilder<STATE>& setValue(std::unique_ptr<protocol::Value> value)
181 : {
182 : m_result->setValue(std::move(value));
183 : return *this;
184 : }
185 :
186 : RemoteObjectBuilder<STATE>& setUnserializableValue(const String& value)
187 : {
188 103 : m_result->setUnserializableValue(value);
189 : return *this;
190 : }
191 :
192 : RemoteObjectBuilder<STATE>& setDescription(const String& value)
193 : {
194 2912650 : m_result->setDescription(value);
195 : return *this;
196 : }
197 :
198 : RemoteObjectBuilder<STATE>& setObjectId(const String& value)
199 : {
200 : m_result->setObjectId(value);
201 : return *this;
202 : }
203 :
204 : RemoteObjectBuilder<STATE>& setPreview(std::unique_ptr<protocol::Runtime::ObjectPreview> value)
205 : {
206 : m_result->setPreview(std::move(value));
207 : return *this;
208 : }
209 :
210 : RemoteObjectBuilder<STATE>& setCustomPreview(std::unique_ptr<protocol::Runtime::CustomPreview> value)
211 : {
212 : m_result->setCustomPreview(std::move(value));
213 : return *this;
214 : }
215 :
216 : std::unique_ptr<RemoteObject> build()
217 : {
218 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
219 : return std::move(m_result);
220 : }
221 :
222 : private:
223 : friend class RemoteObject;
224 6132002 : RemoteObjectBuilder() : m_result(new RemoteObject()) { }
225 :
226 : template<int STEP> RemoteObjectBuilder<STATE | STEP>& castState()
227 : {
228 : return *reinterpret_cast<RemoteObjectBuilder<STATE | STEP>*>(this);
229 : }
230 :
231 : std::unique_ptr<protocol::Runtime::RemoteObject> m_result;
232 : };
233 :
234 : static RemoteObjectBuilder<0> create()
235 : {
236 3066001 : return RemoteObjectBuilder<0>();
237 : }
238 :
239 : private:
240 3066046 : RemoteObject()
241 3066046 : {
242 3066046 : }
243 :
244 : String m_type;
245 : Maybe<String> m_subtype;
246 : Maybe<String> m_className;
247 : Maybe<protocol::Value> m_value;
248 : Maybe<String> m_unserializableValue;
249 : Maybe<String> m_description;
250 : Maybe<String> m_objectId;
251 : Maybe<protocol::Runtime::ObjectPreview> m_preview;
252 : Maybe<protocol::Runtime::CustomPreview> m_customPreview;
253 : };
254 :
255 :
256 : class CustomPreview : public Serializable{
257 : PROTOCOL_DISALLOW_COPY(CustomPreview);
258 : public:
259 : static std::unique_ptr<CustomPreview> fromValue(protocol::Value* value, ErrorSupport* errors);
260 :
261 180 : ~CustomPreview() override { }
262 :
263 : String getHeader() { return m_header; }
264 60 : void setHeader(const String& value) { m_header = value; }
265 :
266 : bool hasBodyGetterId() { return m_bodyGetterId.isJust(); }
267 : String getBodyGetterId(const String& defaultValue) { return m_bodyGetterId.isJust() ? m_bodyGetterId.fromJust() : defaultValue; }
268 100 : void setBodyGetterId(const String& value) { m_bodyGetterId = value; }
269 :
270 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
271 0 : String serialize() override { return toValue()->serialize(); }
272 : std::unique_ptr<CustomPreview> clone() const;
273 :
274 : template<int STATE>
275 : class CustomPreviewBuilder {
276 : public:
277 : enum {
278 : NoFieldsSet = 0,
279 : HeaderSet = 1 << 1,
280 : AllFieldsSet = (HeaderSet | 0)};
281 :
282 :
283 : CustomPreviewBuilder<STATE | HeaderSet>& setHeader(const String& value)
284 : {
285 : static_assert(!(STATE & HeaderSet), "property header should not be set yet");
286 : m_result->setHeader(value);
287 : return castState<HeaderSet>();
288 : }
289 :
290 : CustomPreviewBuilder<STATE>& setBodyGetterId(const String& value)
291 : {
292 : m_result->setBodyGetterId(value);
293 : return *this;
294 : }
295 :
296 : std::unique_ptr<CustomPreview> build()
297 : {
298 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
299 : return std::move(m_result);
300 : }
301 :
302 : private:
303 : friend class CustomPreview;
304 120 : CustomPreviewBuilder() : m_result(new CustomPreview()) { }
305 :
306 : template<int STEP> CustomPreviewBuilder<STATE | STEP>& castState()
307 : {
308 : return *reinterpret_cast<CustomPreviewBuilder<STATE | STEP>*>(this);
309 : }
310 :
311 : std::unique_ptr<protocol::Runtime::CustomPreview> m_result;
312 : };
313 :
314 : static CustomPreviewBuilder<0> create()
315 : {
316 60 : return CustomPreviewBuilder<0>();
317 : }
318 :
319 : private:
320 60 : CustomPreview()
321 60 : {
322 60 : }
323 :
324 : String m_header;
325 : Maybe<String> m_bodyGetterId;
326 : };
327 :
328 :
329 : class ObjectPreview : public Serializable{
330 : PROTOCOL_DISALLOW_COPY(ObjectPreview);
331 : public:
332 : static std::unique_ptr<ObjectPreview> fromValue(protocol::Value* value, ErrorSupport* errors);
333 :
334 33525 : ~ObjectPreview() override { }
335 :
336 : struct TypeEnum {
337 : static const char* Object;
338 : static const char* Function;
339 : static const char* Undefined;
340 : static const char* String;
341 : static const char* Number;
342 : static const char* Boolean;
343 : static const char* Symbol;
344 : static const char* Bigint;
345 : }; // TypeEnum
346 :
347 150 : String getType() { return m_type; }
348 11175 : void setType(const String& value) { m_type = value; }
349 :
350 : struct SubtypeEnum {
351 : static const char* Array;
352 : static const char* Null;
353 : static const char* Node;
354 : static const char* Regexp;
355 : static const char* Date;
356 : static const char* Map;
357 : static const char* Set;
358 : static const char* Weakmap;
359 : static const char* Weakset;
360 : static const char* Iterator;
361 : static const char* Generator;
362 : static const char* Error;
363 : }; // SubtypeEnum
364 :
365 : bool hasSubtype() { return m_subtype.isJust(); }
366 : String getSubtype(const String& defaultValue) { return m_subtype.isJust() ? m_subtype.fromJust() : defaultValue; }
367 21030 : void setSubtype(const String& value) { m_subtype = value; }
368 :
369 : bool hasDescription() { return m_description.isJust(); }
370 150 : String getDescription(const String& defaultValue) { return m_description.isJust() ? m_description.fromJust() : defaultValue; }
371 22350 : void setDescription(const String& value) { m_description = value; }
372 :
373 : bool getOverflow() { return m_overflow; }
374 11175 : void setOverflow(bool value) { m_overflow = value; }
375 :
376 : protocol::Array<protocol::Runtime::PropertyPreview>* getProperties() { return m_properties.get(); }
377 : void setProperties(std::unique_ptr<protocol::Array<protocol::Runtime::PropertyPreview>> value) { m_properties = std::move(value); }
378 :
379 : bool hasEntries() { return m_entries.isJust(); }
380 : protocol::Array<protocol::Runtime::EntryPreview>* getEntries(protocol::Array<protocol::Runtime::EntryPreview>* defaultValue) { return m_entries.isJust() ? m_entries.fromJust() : defaultValue; }
381 : void setEntries(std::unique_ptr<protocol::Array<protocol::Runtime::EntryPreview>> value) { m_entries = std::move(value); }
382 :
383 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
384 0 : String serialize() override { return toValue()->serialize(); }
385 : std::unique_ptr<ObjectPreview> clone() const;
386 :
387 : template<int STATE>
388 : class ObjectPreviewBuilder {
389 : public:
390 : enum {
391 : NoFieldsSet = 0,
392 : TypeSet = 1 << 1,
393 : OverflowSet = 1 << 2,
394 : PropertiesSet = 1 << 3,
395 : AllFieldsSet = (TypeSet | OverflowSet | PropertiesSet | 0)};
396 :
397 :
398 : ObjectPreviewBuilder<STATE | TypeSet>& setType(const String& value)
399 : {
400 : static_assert(!(STATE & TypeSet), "property type should not be set yet");
401 : m_result->setType(value);
402 : return castState<TypeSet>();
403 : }
404 :
405 : ObjectPreviewBuilder<STATE>& setSubtype(const String& value)
406 : {
407 : m_result->setSubtype(value);
408 : return *this;
409 : }
410 :
411 : ObjectPreviewBuilder<STATE>& setDescription(const String& value)
412 : {
413 11175 : m_result->setDescription(value);
414 : return *this;
415 : }
416 :
417 : ObjectPreviewBuilder<STATE | OverflowSet>& setOverflow(bool value)
418 : {
419 : static_assert(!(STATE & OverflowSet), "property overflow should not be set yet");
420 : m_result->setOverflow(value);
421 : return castState<OverflowSet>();
422 : }
423 :
424 : ObjectPreviewBuilder<STATE | PropertiesSet>& setProperties(std::unique_ptr<protocol::Array<protocol::Runtime::PropertyPreview>> value)
425 : {
426 : static_assert(!(STATE & PropertiesSet), "property properties should not be set yet");
427 : m_result->setProperties(std::move(value));
428 : return castState<PropertiesSet>();
429 : }
430 :
431 : ObjectPreviewBuilder<STATE>& setEntries(std::unique_ptr<protocol::Array<protocol::Runtime::EntryPreview>> value)
432 : {
433 : m_result->setEntries(std::move(value));
434 : return *this;
435 : }
436 :
437 : std::unique_ptr<ObjectPreview> build()
438 : {
439 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
440 : return std::move(m_result);
441 : }
442 :
443 : private:
444 : friend class ObjectPreview;
445 22350 : ObjectPreviewBuilder() : m_result(new ObjectPreview()) { }
446 :
447 : template<int STEP> ObjectPreviewBuilder<STATE | STEP>& castState()
448 : {
449 : return *reinterpret_cast<ObjectPreviewBuilder<STATE | STEP>*>(this);
450 : }
451 :
452 : std::unique_ptr<protocol::Runtime::ObjectPreview> m_result;
453 : };
454 :
455 : static ObjectPreviewBuilder<0> create()
456 : {
457 11175 : return ObjectPreviewBuilder<0>();
458 : }
459 :
460 : private:
461 11175 : ObjectPreview()
462 22350 : {
463 11175 : m_overflow = false;
464 11175 : }
465 :
466 : String m_type;
467 : Maybe<String> m_subtype;
468 : Maybe<String> m_description;
469 : bool m_overflow;
470 : std::unique_ptr<protocol::Array<protocol::Runtime::PropertyPreview>> m_properties;
471 : Maybe<protocol::Array<protocol::Runtime::EntryPreview>> m_entries;
472 : };
473 :
474 :
475 : class PropertyPreview : public Serializable{
476 : PROTOCOL_DISALLOW_COPY(PropertyPreview);
477 : public:
478 : static std::unique_ptr<PropertyPreview> fromValue(protocol::Value* value, ErrorSupport* errors);
479 :
480 96480 : ~PropertyPreview() override { }
481 :
482 50 : String getName() { return m_name; }
483 32135 : void setName(const String& value) { m_name = value; }
484 :
485 : struct TypeEnum {
486 : static const char* Object;
487 : static const char* Function;
488 : static const char* Undefined;
489 : static const char* String;
490 : static const char* Number;
491 : static const char* Boolean;
492 : static const char* Symbol;
493 : static const char* Accessor;
494 : static const char* Bigint;
495 : }; // TypeEnum
496 :
497 : String getType() { return m_type; }
498 32135 : void setType(const String& value) { m_type = value; }
499 :
500 : bool hasValue() { return m_value.isJust(); }
501 : String getValue(const String& defaultValue) { return m_value.isJust() ? m_value.fromJust() : defaultValue; }
502 64200 : void setValue(const String& value) { m_value = value; }
503 :
504 : bool hasValuePreview() { return m_valuePreview.isJust(); }
505 25 : protocol::Runtime::ObjectPreview* getValuePreview(protocol::Runtime::ObjectPreview* defaultValue) { return m_valuePreview.isJust() ? m_valuePreview.fromJust() : defaultValue; }
506 : void setValuePreview(std::unique_ptr<protocol::Runtime::ObjectPreview> value) { m_valuePreview = std::move(value); }
507 :
508 : struct SubtypeEnum {
509 : static const char* Array;
510 : static const char* Null;
511 : static const char* Node;
512 : static const char* Regexp;
513 : static const char* Date;
514 : static const char* Map;
515 : static const char* Set;
516 : static const char* Weakmap;
517 : static const char* Weakset;
518 : static const char* Iterator;
519 : static const char* Generator;
520 : static const char* Error;
521 : }; // SubtypeEnum
522 :
523 : bool hasSubtype() { return m_subtype.isJust(); }
524 : String getSubtype(const String& defaultValue) { return m_subtype.isJust() ? m_subtype.fromJust() : defaultValue; }
525 20370 : void setSubtype(const String& value) { m_subtype = value; }
526 :
527 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
528 0 : String serialize() override { return toValue()->serialize(); }
529 : std::unique_ptr<PropertyPreview> clone() const;
530 :
531 : template<int STATE>
532 : class PropertyPreviewBuilder {
533 : public:
534 : enum {
535 : NoFieldsSet = 0,
536 : NameSet = 1 << 1,
537 : TypeSet = 1 << 2,
538 : AllFieldsSet = (NameSet | TypeSet | 0)};
539 :
540 :
541 : PropertyPreviewBuilder<STATE | NameSet>& setName(const String& value)
542 : {
543 : static_assert(!(STATE & NameSet), "property name should not be set yet");
544 : m_result->setName(value);
545 : return castState<NameSet>();
546 : }
547 :
548 : PropertyPreviewBuilder<STATE | TypeSet>& setType(const String& value)
549 : {
550 : static_assert(!(STATE & TypeSet), "property type should not be set yet");
551 : m_result->setType(value);
552 : return castState<TypeSet>();
553 : }
554 :
555 : PropertyPreviewBuilder<STATE>& setValue(const String& value)
556 : {
557 32100 : m_result->setValue(value);
558 : return *this;
559 : }
560 :
561 : PropertyPreviewBuilder<STATE>& setValuePreview(std::unique_ptr<protocol::Runtime::ObjectPreview> value)
562 : {
563 : m_result->setValuePreview(std::move(value));
564 : return *this;
565 : }
566 :
567 : PropertyPreviewBuilder<STATE>& setSubtype(const String& value)
568 : {
569 : m_result->setSubtype(value);
570 : return *this;
571 : }
572 :
573 : std::unique_ptr<PropertyPreview> build()
574 : {
575 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
576 : return std::move(m_result);
577 : }
578 :
579 : private:
580 : friend class PropertyPreview;
581 64270 : PropertyPreviewBuilder() : m_result(new PropertyPreview()) { }
582 :
583 : template<int STEP> PropertyPreviewBuilder<STATE | STEP>& castState()
584 : {
585 : return *reinterpret_cast<PropertyPreviewBuilder<STATE | STEP>*>(this);
586 : }
587 :
588 : std::unique_ptr<protocol::Runtime::PropertyPreview> m_result;
589 : };
590 :
591 : static PropertyPreviewBuilder<0> create()
592 : {
593 32135 : return PropertyPreviewBuilder<0>();
594 : }
595 :
596 : private:
597 32160 : PropertyPreview()
598 32160 : {
599 32160 : }
600 :
601 : String m_name;
602 : String m_type;
603 : Maybe<String> m_value;
604 : Maybe<protocol::Runtime::ObjectPreview> m_valuePreview;
605 : Maybe<String> m_subtype;
606 : };
607 :
608 :
609 : class EntryPreview : public Serializable{
610 : PROTOCOL_DISALLOW_COPY(EntryPreview);
611 : public:
612 : static std::unique_ptr<EntryPreview> fromValue(protocol::Value* value, ErrorSupport* errors);
613 :
614 555 : ~EntryPreview() override { }
615 :
616 : bool hasKey() { return m_key.isJust(); }
617 : protocol::Runtime::ObjectPreview* getKey(protocol::Runtime::ObjectPreview* defaultValue) { return m_key.isJust() ? m_key.fromJust() : defaultValue; }
618 : void setKey(std::unique_ptr<protocol::Runtime::ObjectPreview> value) { m_key = std::move(value); }
619 :
620 : protocol::Runtime::ObjectPreview* getValue() { return m_value.get(); }
621 : void setValue(std::unique_ptr<protocol::Runtime::ObjectPreview> value) { m_value = std::move(value); }
622 :
623 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
624 0 : String serialize() override { return toValue()->serialize(); }
625 : std::unique_ptr<EntryPreview> clone() const;
626 :
627 : template<int STATE>
628 : class EntryPreviewBuilder {
629 : public:
630 : enum {
631 : NoFieldsSet = 0,
632 : ValueSet = 1 << 1,
633 : AllFieldsSet = (ValueSet | 0)};
634 :
635 :
636 : EntryPreviewBuilder<STATE>& setKey(std::unique_ptr<protocol::Runtime::ObjectPreview> value)
637 : {
638 : m_result->setKey(std::move(value));
639 : return *this;
640 : }
641 :
642 : EntryPreviewBuilder<STATE | ValueSet>& setValue(std::unique_ptr<protocol::Runtime::ObjectPreview> value)
643 : {
644 : static_assert(!(STATE & ValueSet), "property value should not be set yet");
645 : m_result->setValue(std::move(value));
646 : return castState<ValueSet>();
647 : }
648 :
649 : std::unique_ptr<EntryPreview> build()
650 : {
651 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
652 : return std::move(m_result);
653 : }
654 :
655 : private:
656 : friend class EntryPreview;
657 370 : EntryPreviewBuilder() : m_result(new EntryPreview()) { }
658 :
659 : template<int STEP> EntryPreviewBuilder<STATE | STEP>& castState()
660 : {
661 : return *reinterpret_cast<EntryPreviewBuilder<STATE | STEP>*>(this);
662 : }
663 :
664 : std::unique_ptr<protocol::Runtime::EntryPreview> m_result;
665 : };
666 :
667 : static EntryPreviewBuilder<0> create()
668 : {
669 185 : return EntryPreviewBuilder<0>();
670 : }
671 :
672 : private:
673 : EntryPreview()
674 370 : {
675 : }
676 :
677 : Maybe<protocol::Runtime::ObjectPreview> m_key;
678 : std::unique_ptr<protocol::Runtime::ObjectPreview> m_value;
679 : };
680 :
681 :
682 : class PropertyDescriptor : public Serializable{
683 : PROTOCOL_DISALLOW_COPY(PropertyDescriptor);
684 : public:
685 : static std::unique_ptr<PropertyDescriptor> fromValue(protocol::Value* value, ErrorSupport* errors);
686 :
687 7472367 : ~PropertyDescriptor() override { }
688 :
689 : String getName() { return m_name; }
690 2490789 : void setName(const String& value) { m_name = value; }
691 :
692 : bool hasValue() { return m_value.isJust(); }
693 : protocol::Runtime::RemoteObject* getValue(protocol::Runtime::RemoteObject* defaultValue) { return m_value.isJust() ? m_value.fromJust() : defaultValue; }
694 : void setValue(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_value = std::move(value); }
695 :
696 : bool hasWritable() { return m_writable.isJust(); }
697 : bool getWritable(bool defaultValue) { return m_writable.isJust() ? m_writable.fromJust() : defaultValue; }
698 : void setWritable(bool value) { m_writable = value; }
699 :
700 : bool hasGet() { return m_get.isJust(); }
701 : protocol::Runtime::RemoteObject* getGet(protocol::Runtime::RemoteObject* defaultValue) { return m_get.isJust() ? m_get.fromJust() : defaultValue; }
702 : void setGet(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_get = std::move(value); }
703 :
704 : bool hasSet() { return m_set.isJust(); }
705 : protocol::Runtime::RemoteObject* getSet(protocol::Runtime::RemoteObject* defaultValue) { return m_set.isJust() ? m_set.fromJust() : defaultValue; }
706 : void setSet(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_set = std::move(value); }
707 :
708 : bool getConfigurable() { return m_configurable; }
709 2490789 : void setConfigurable(bool value) { m_configurable = value; }
710 :
711 : bool getEnumerable() { return m_enumerable; }
712 2490789 : void setEnumerable(bool value) { m_enumerable = value; }
713 :
714 : bool hasWasThrown() { return m_wasThrown.isJust(); }
715 : bool getWasThrown(bool defaultValue) { return m_wasThrown.isJust() ? m_wasThrown.fromJust() : defaultValue; }
716 : void setWasThrown(bool value) { m_wasThrown = value; }
717 :
718 : bool hasIsOwn() { return m_isOwn.isJust(); }
719 : bool getIsOwn(bool defaultValue) { return m_isOwn.isJust() ? m_isOwn.fromJust() : defaultValue; }
720 : void setIsOwn(bool value) { m_isOwn = value; }
721 :
722 : bool hasSymbol() { return m_symbol.isJust(); }
723 : protocol::Runtime::RemoteObject* getSymbol(protocol::Runtime::RemoteObject* defaultValue) { return m_symbol.isJust() ? m_symbol.fromJust() : defaultValue; }
724 : void setSymbol(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_symbol = std::move(value); }
725 :
726 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
727 0 : String serialize() override { return toValue()->serialize(); }
728 : std::unique_ptr<PropertyDescriptor> clone() const;
729 :
730 : template<int STATE>
731 : class PropertyDescriptorBuilder {
732 : public:
733 : enum {
734 : NoFieldsSet = 0,
735 : NameSet = 1 << 1,
736 : ConfigurableSet = 1 << 2,
737 : EnumerableSet = 1 << 3,
738 : AllFieldsSet = (NameSet | ConfigurableSet | EnumerableSet | 0)};
739 :
740 :
741 : PropertyDescriptorBuilder<STATE | NameSet>& setName(const String& value)
742 : {
743 : static_assert(!(STATE & NameSet), "property name should not be set yet");
744 : m_result->setName(value);
745 : return castState<NameSet>();
746 : }
747 :
748 : PropertyDescriptorBuilder<STATE>& setValue(std::unique_ptr<protocol::Runtime::RemoteObject> value)
749 : {
750 : m_result->setValue(std::move(value));
751 : return *this;
752 : }
753 :
754 : PropertyDescriptorBuilder<STATE>& setWritable(bool value)
755 : {
756 : m_result->setWritable(value);
757 : return *this;
758 : }
759 :
760 : PropertyDescriptorBuilder<STATE>& setGet(std::unique_ptr<protocol::Runtime::RemoteObject> value)
761 : {
762 : m_result->setGet(std::move(value));
763 : return *this;
764 : }
765 :
766 : PropertyDescriptorBuilder<STATE>& setSet(std::unique_ptr<protocol::Runtime::RemoteObject> value)
767 : {
768 : m_result->setSet(std::move(value));
769 : return *this;
770 : }
771 :
772 : PropertyDescriptorBuilder<STATE | ConfigurableSet>& setConfigurable(bool value)
773 : {
774 : static_assert(!(STATE & ConfigurableSet), "property configurable should not be set yet");
775 : m_result->setConfigurable(value);
776 : return castState<ConfigurableSet>();
777 : }
778 :
779 : PropertyDescriptorBuilder<STATE | EnumerableSet>& setEnumerable(bool value)
780 : {
781 : static_assert(!(STATE & EnumerableSet), "property enumerable should not be set yet");
782 : m_result->setEnumerable(value);
783 : return castState<EnumerableSet>();
784 : }
785 :
786 : PropertyDescriptorBuilder<STATE>& setWasThrown(bool value)
787 : {
788 : m_result->setWasThrown(value);
789 : return *this;
790 : }
791 :
792 : PropertyDescriptorBuilder<STATE>& setIsOwn(bool value)
793 : {
794 : m_result->setIsOwn(value);
795 : return *this;
796 : }
797 :
798 : PropertyDescriptorBuilder<STATE>& setSymbol(std::unique_ptr<protocol::Runtime::RemoteObject> value)
799 : {
800 : m_result->setSymbol(std::move(value));
801 : return *this;
802 : }
803 :
804 : std::unique_ptr<PropertyDescriptor> build()
805 : {
806 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
807 : return std::move(m_result);
808 : }
809 :
810 : private:
811 : friend class PropertyDescriptor;
812 4981578 : PropertyDescriptorBuilder() : m_result(new PropertyDescriptor()) { }
813 :
814 : template<int STEP> PropertyDescriptorBuilder<STATE | STEP>& castState()
815 : {
816 : return *reinterpret_cast<PropertyDescriptorBuilder<STATE | STEP>*>(this);
817 : }
818 :
819 : std::unique_ptr<protocol::Runtime::PropertyDescriptor> m_result;
820 : };
821 :
822 : static PropertyDescriptorBuilder<0> create()
823 : {
824 2490789 : return PropertyDescriptorBuilder<0>();
825 : }
826 :
827 : private:
828 2490789 : PropertyDescriptor()
829 2490789 : {
830 2490789 : m_configurable = false;
831 2490789 : m_enumerable = false;
832 2490789 : }
833 :
834 : String m_name;
835 : Maybe<protocol::Runtime::RemoteObject> m_value;
836 : Maybe<bool> m_writable;
837 : Maybe<protocol::Runtime::RemoteObject> m_get;
838 : Maybe<protocol::Runtime::RemoteObject> m_set;
839 : bool m_configurable;
840 : bool m_enumerable;
841 : Maybe<bool> m_wasThrown;
842 : Maybe<bool> m_isOwn;
843 : Maybe<protocol::Runtime::RemoteObject> m_symbol;
844 : };
845 :
846 :
847 : class InternalPropertyDescriptor : public Serializable{
848 : PROTOCOL_DISALLOW_COPY(InternalPropertyDescriptor);
849 : public:
850 : static std::unique_ptr<InternalPropertyDescriptor> fromValue(protocol::Value* value, ErrorSupport* errors);
851 :
852 3177 : ~InternalPropertyDescriptor() override { }
853 :
854 : String getName() { return m_name; }
855 1059 : void setName(const String& value) { m_name = value; }
856 :
857 : bool hasValue() { return m_value.isJust(); }
858 : protocol::Runtime::RemoteObject* getValue(protocol::Runtime::RemoteObject* defaultValue) { return m_value.isJust() ? m_value.fromJust() : defaultValue; }
859 : void setValue(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_value = std::move(value); }
860 :
861 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
862 0 : String serialize() override { return toValue()->serialize(); }
863 : std::unique_ptr<InternalPropertyDescriptor> clone() const;
864 :
865 : template<int STATE>
866 : class InternalPropertyDescriptorBuilder {
867 : public:
868 : enum {
869 : NoFieldsSet = 0,
870 : NameSet = 1 << 1,
871 : AllFieldsSet = (NameSet | 0)};
872 :
873 :
874 : InternalPropertyDescriptorBuilder<STATE | NameSet>& setName(const String& value)
875 : {
876 : static_assert(!(STATE & NameSet), "property name should not be set yet");
877 : m_result->setName(value);
878 : return castState<NameSet>();
879 : }
880 :
881 : InternalPropertyDescriptorBuilder<STATE>& setValue(std::unique_ptr<protocol::Runtime::RemoteObject> value)
882 : {
883 : m_result->setValue(std::move(value));
884 : return *this;
885 : }
886 :
887 : std::unique_ptr<InternalPropertyDescriptor> build()
888 : {
889 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
890 : return std::move(m_result);
891 : }
892 :
893 : private:
894 : friend class InternalPropertyDescriptor;
895 2118 : InternalPropertyDescriptorBuilder() : m_result(new InternalPropertyDescriptor()) { }
896 :
897 : template<int STEP> InternalPropertyDescriptorBuilder<STATE | STEP>& castState()
898 : {
899 : return *reinterpret_cast<InternalPropertyDescriptorBuilder<STATE | STEP>*>(this);
900 : }
901 :
902 : std::unique_ptr<protocol::Runtime::InternalPropertyDescriptor> m_result;
903 : };
904 :
905 : static InternalPropertyDescriptorBuilder<0> create()
906 : {
907 1059 : return InternalPropertyDescriptorBuilder<0>();
908 : }
909 :
910 : private:
911 : InternalPropertyDescriptor()
912 1059 : {
913 : }
914 :
915 : String m_name;
916 : Maybe<protocol::Runtime::RemoteObject> m_value;
917 : };
918 :
919 :
920 : class CallArgument : public Serializable{
921 : PROTOCOL_DISALLOW_COPY(CallArgument);
922 : public:
923 : static std::unique_ptr<CallArgument> fromValue(protocol::Value* value, ErrorSupport* errors);
924 :
925 1128 : ~CallArgument() override { }
926 :
927 : bool hasValue() { return m_value.isJust(); }
928 236 : protocol::Value* getValue(protocol::Value* defaultValue) { return m_value.isJust() ? m_value.fromJust() : defaultValue; }
929 : void setValue(std::unique_ptr<protocol::Value> value) { m_value = std::move(value); }
930 :
931 35 : bool hasUnserializableValue() { return m_unserializableValue.isJust(); }
932 30 : String getUnserializableValue(const String& defaultValue) { return m_unserializableValue.isJust() ? m_unserializableValue.fromJust() : defaultValue; }
933 : void setUnserializableValue(const String& value) { m_unserializableValue = value; }
934 :
935 366 : bool hasObjectId() { return m_objectId.isJust(); }
936 95 : String getObjectId(const String& defaultValue) { return m_objectId.isJust() ? m_objectId.fromJust() : defaultValue; }
937 : void setObjectId(const String& value) { m_objectId = value; }
938 :
939 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
940 0 : String serialize() override { return toValue()->serialize(); }
941 : std::unique_ptr<CallArgument> clone() const;
942 :
943 : template<int STATE>
944 : class CallArgumentBuilder {
945 : public:
946 : enum {
947 : NoFieldsSet = 0,
948 : AllFieldsSet = (0)};
949 :
950 :
951 : CallArgumentBuilder<STATE>& setValue(std::unique_ptr<protocol::Value> value)
952 : {
953 : m_result->setValue(std::move(value));
954 : return *this;
955 : }
956 :
957 : CallArgumentBuilder<STATE>& setUnserializableValue(const String& value)
958 : {
959 : m_result->setUnserializableValue(value);
960 : return *this;
961 : }
962 :
963 : CallArgumentBuilder<STATE>& setObjectId(const String& value)
964 : {
965 : m_result->setObjectId(value);
966 : return *this;
967 : }
968 :
969 : std::unique_ptr<CallArgument> build()
970 : {
971 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
972 : return std::move(m_result);
973 : }
974 :
975 : private:
976 : friend class CallArgument;
977 : CallArgumentBuilder() : m_result(new CallArgument()) { }
978 :
979 : template<int STEP> CallArgumentBuilder<STATE | STEP>& castState()
980 : {
981 : return *reinterpret_cast<CallArgumentBuilder<STATE | STEP>*>(this);
982 : }
983 :
984 : std::unique_ptr<protocol::Runtime::CallArgument> m_result;
985 : };
986 :
987 : static CallArgumentBuilder<0> create()
988 : {
989 : return CallArgumentBuilder<0>();
990 : }
991 :
992 : private:
993 376 : CallArgument()
994 376 : {
995 376 : }
996 :
997 : Maybe<protocol::Value> m_value;
998 : Maybe<String> m_unserializableValue;
999 : Maybe<String> m_objectId;
1000 : };
1001 :
1002 :
1003 : class ExecutionContextDescription : public Serializable{
1004 : PROTOCOL_DISALLOW_COPY(ExecutionContextDescription);
1005 : public:
1006 : static std::unique_ptr<ExecutionContextDescription> fromValue(protocol::Value* value, ErrorSupport* errors);
1007 :
1008 2145 : ~ExecutionContextDescription() override { }
1009 :
1010 : int getId() { return m_id; }
1011 715 : void setId(int value) { m_id = value; }
1012 :
1013 : String getOrigin() { return m_origin; }
1014 715 : void setOrigin(const String& value) { m_origin = value; }
1015 :
1016 : String getName() { return m_name; }
1017 715 : void setName(const String& value) { m_name = value; }
1018 :
1019 : bool hasAuxData() { return m_auxData.isJust(); }
1020 : protocol::DictionaryValue* getAuxData(protocol::DictionaryValue* defaultValue) { return m_auxData.isJust() ? m_auxData.fromJust() : defaultValue; }
1021 : void setAuxData(std::unique_ptr<protocol::DictionaryValue> value) { m_auxData = std::move(value); }
1022 :
1023 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1024 0 : String serialize() override { return toValue()->serialize(); }
1025 : std::unique_ptr<ExecutionContextDescription> clone() const;
1026 :
1027 : template<int STATE>
1028 : class ExecutionContextDescriptionBuilder {
1029 : public:
1030 : enum {
1031 : NoFieldsSet = 0,
1032 : IdSet = 1 << 1,
1033 : OriginSet = 1 << 2,
1034 : NameSet = 1 << 3,
1035 : AllFieldsSet = (IdSet | OriginSet | NameSet | 0)};
1036 :
1037 :
1038 : ExecutionContextDescriptionBuilder<STATE | IdSet>& setId(int value)
1039 : {
1040 : static_assert(!(STATE & IdSet), "property id should not be set yet");
1041 : m_result->setId(value);
1042 : return castState<IdSet>();
1043 : }
1044 :
1045 : ExecutionContextDescriptionBuilder<STATE | OriginSet>& setOrigin(const String& value)
1046 : {
1047 : static_assert(!(STATE & OriginSet), "property origin should not be set yet");
1048 : m_result->setOrigin(value);
1049 : return castState<OriginSet>();
1050 : }
1051 :
1052 : ExecutionContextDescriptionBuilder<STATE | NameSet>& setName(const String& value)
1053 : {
1054 : static_assert(!(STATE & NameSet), "property name should not be set yet");
1055 : m_result->setName(value);
1056 : return castState<NameSet>();
1057 : }
1058 :
1059 : ExecutionContextDescriptionBuilder<STATE>& setAuxData(std::unique_ptr<protocol::DictionaryValue> value)
1060 : {
1061 : m_result->setAuxData(std::move(value));
1062 : return *this;
1063 : }
1064 :
1065 : std::unique_ptr<ExecutionContextDescription> build()
1066 : {
1067 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1068 : return std::move(m_result);
1069 : }
1070 :
1071 : private:
1072 : friend class ExecutionContextDescription;
1073 1430 : ExecutionContextDescriptionBuilder() : m_result(new ExecutionContextDescription()) { }
1074 :
1075 : template<int STEP> ExecutionContextDescriptionBuilder<STATE | STEP>& castState()
1076 : {
1077 : return *reinterpret_cast<ExecutionContextDescriptionBuilder<STATE | STEP>*>(this);
1078 : }
1079 :
1080 : std::unique_ptr<protocol::Runtime::ExecutionContextDescription> m_result;
1081 : };
1082 :
1083 : static ExecutionContextDescriptionBuilder<0> create()
1084 : {
1085 715 : return ExecutionContextDescriptionBuilder<0>();
1086 : }
1087 :
1088 : private:
1089 715 : ExecutionContextDescription()
1090 715 : {
1091 715 : m_id = 0;
1092 715 : }
1093 :
1094 : int m_id;
1095 : String m_origin;
1096 : String m_name;
1097 : Maybe<protocol::DictionaryValue> m_auxData;
1098 : };
1099 :
1100 :
1101 : class ExceptionDetails : public Serializable{
1102 : PROTOCOL_DISALLOW_COPY(ExceptionDetails);
1103 : public:
1104 : static std::unique_ptr<ExceptionDetails> fromValue(protocol::Value* value, ErrorSupport* errors);
1105 :
1106 5373 : ~ExceptionDetails() override { }
1107 :
1108 : int getExceptionId() { return m_exceptionId; }
1109 1791 : void setExceptionId(int value) { m_exceptionId = value; }
1110 :
1111 : String getText() { return m_text; }
1112 1791 : void setText(const String& value) { m_text = value; }
1113 :
1114 : int getLineNumber() { return m_lineNumber; }
1115 1791 : void setLineNumber(int value) { m_lineNumber = value; }
1116 :
1117 : int getColumnNumber() { return m_columnNumber; }
1118 1791 : void setColumnNumber(int value) { m_columnNumber = value; }
1119 :
1120 : bool hasScriptId() { return m_scriptId.isJust(); }
1121 : String getScriptId(const String& defaultValue) { return m_scriptId.isJust() ? m_scriptId.fromJust() : defaultValue; }
1122 3332 : void setScriptId(const String& value) { m_scriptId = value; }
1123 :
1124 : bool hasUrl() { return m_url.isJust(); }
1125 : String getUrl(const String& defaultValue) { return m_url.isJust() ? m_url.fromJust() : defaultValue; }
1126 40 : void setUrl(const String& value) { m_url = value; }
1127 :
1128 : bool hasStackTrace() { return m_stackTrace.isJust(); }
1129 : protocol::Runtime::StackTrace* getStackTrace(protocol::Runtime::StackTrace* defaultValue) { return m_stackTrace.isJust() ? m_stackTrace.fromJust() : defaultValue; }
1130 : void setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_stackTrace = std::move(value); }
1131 :
1132 : bool hasException() { return m_exception.isJust(); }
1133 : protocol::Runtime::RemoteObject* getException(protocol::Runtime::RemoteObject* defaultValue) { return m_exception.isJust() ? m_exception.fromJust() : defaultValue; }
1134 : void setException(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_exception = std::move(value); }
1135 :
1136 : bool hasExecutionContextId() { return m_executionContextId.isJust(); }
1137 : int getExecutionContextId(int defaultValue) { return m_executionContextId.isJust() ? m_executionContextId.fromJust() : defaultValue; }
1138 : void setExecutionContextId(int value) { m_executionContextId = value; }
1139 :
1140 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1141 0 : String serialize() override { return toValue()->serialize(); }
1142 : std::unique_ptr<ExceptionDetails> clone() const;
1143 :
1144 : template<int STATE>
1145 : class ExceptionDetailsBuilder {
1146 : public:
1147 : enum {
1148 : NoFieldsSet = 0,
1149 : ExceptionIdSet = 1 << 1,
1150 : TextSet = 1 << 2,
1151 : LineNumberSet = 1 << 3,
1152 : ColumnNumberSet = 1 << 4,
1153 : AllFieldsSet = (ExceptionIdSet | TextSet | LineNumberSet | ColumnNumberSet | 0)};
1154 :
1155 :
1156 : ExceptionDetailsBuilder<STATE | ExceptionIdSet>& setExceptionId(int value)
1157 : {
1158 : static_assert(!(STATE & ExceptionIdSet), "property exceptionId should not be set yet");
1159 : m_result->setExceptionId(value);
1160 : return castState<ExceptionIdSet>();
1161 : }
1162 :
1163 : ExceptionDetailsBuilder<STATE | TextSet>& setText(const String& value)
1164 : {
1165 : static_assert(!(STATE & TextSet), "property text should not be set yet");
1166 : m_result->setText(value);
1167 : return castState<TextSet>();
1168 : }
1169 :
1170 : ExceptionDetailsBuilder<STATE | LineNumberSet>& setLineNumber(int value)
1171 : {
1172 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
1173 : m_result->setLineNumber(value);
1174 : return castState<LineNumberSet>();
1175 : }
1176 :
1177 : ExceptionDetailsBuilder<STATE | ColumnNumberSet>& setColumnNumber(int value)
1178 : {
1179 : static_assert(!(STATE & ColumnNumberSet), "property columnNumber should not be set yet");
1180 : m_result->setColumnNumber(value);
1181 : return castState<ColumnNumberSet>();
1182 : }
1183 :
1184 : ExceptionDetailsBuilder<STATE>& setScriptId(const String& value)
1185 : {
1186 : m_result->setScriptId(value);
1187 : return *this;
1188 : }
1189 :
1190 : ExceptionDetailsBuilder<STATE>& setUrl(const String& value)
1191 : {
1192 : m_result->setUrl(value);
1193 : return *this;
1194 : }
1195 :
1196 : ExceptionDetailsBuilder<STATE>& setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value)
1197 : {
1198 : m_result->setStackTrace(std::move(value));
1199 : return *this;
1200 : }
1201 :
1202 : ExceptionDetailsBuilder<STATE>& setException(std::unique_ptr<protocol::Runtime::RemoteObject> value)
1203 : {
1204 : m_result->setException(std::move(value));
1205 : return *this;
1206 : }
1207 :
1208 : ExceptionDetailsBuilder<STATE>& setExecutionContextId(int value)
1209 : {
1210 : m_result->setExecutionContextId(value);
1211 : return *this;
1212 : }
1213 :
1214 : std::unique_ptr<ExceptionDetails> build()
1215 : {
1216 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1217 : return std::move(m_result);
1218 : }
1219 :
1220 : private:
1221 : friend class ExceptionDetails;
1222 3582 : ExceptionDetailsBuilder() : m_result(new ExceptionDetails()) { }
1223 :
1224 : template<int STEP> ExceptionDetailsBuilder<STATE | STEP>& castState()
1225 : {
1226 : return *reinterpret_cast<ExceptionDetailsBuilder<STATE | STEP>*>(this);
1227 : }
1228 :
1229 : std::unique_ptr<protocol::Runtime::ExceptionDetails> m_result;
1230 : };
1231 :
1232 : static ExceptionDetailsBuilder<0> create()
1233 : {
1234 1791 : return ExceptionDetailsBuilder<0>();
1235 : }
1236 :
1237 : private:
1238 1791 : ExceptionDetails()
1239 1791 : {
1240 1791 : m_exceptionId = 0;
1241 1791 : m_lineNumber = 0;
1242 1791 : m_columnNumber = 0;
1243 1791 : }
1244 :
1245 : int m_exceptionId;
1246 : String m_text;
1247 : int m_lineNumber;
1248 : int m_columnNumber;
1249 : Maybe<String> m_scriptId;
1250 : Maybe<String> m_url;
1251 : Maybe<protocol::Runtime::StackTrace> m_stackTrace;
1252 : Maybe<protocol::Runtime::RemoteObject> m_exception;
1253 : Maybe<int> m_executionContextId;
1254 : };
1255 :
1256 :
1257 : class CallFrame : public Serializable{
1258 : PROTOCOL_DISALLOW_COPY(CallFrame);
1259 : public:
1260 : static std::unique_ptr<CallFrame> fromValue(protocol::Value* value, ErrorSupport* errors);
1261 :
1262 191268 : ~CallFrame() override { }
1263 :
1264 : String getFunctionName() { return m_functionName; }
1265 63756 : void setFunctionName(const String& value) { m_functionName = value; }
1266 :
1267 : String getScriptId() { return m_scriptId; }
1268 63756 : void setScriptId(const String& value) { m_scriptId = value; }
1269 :
1270 : String getUrl() { return m_url; }
1271 63756 : void setUrl(const String& value) { m_url = value; }
1272 :
1273 : int getLineNumber() { return m_lineNumber; }
1274 63756 : void setLineNumber(int value) { m_lineNumber = value; }
1275 :
1276 : int getColumnNumber() { return m_columnNumber; }
1277 63756 : void setColumnNumber(int value) { m_columnNumber = value; }
1278 :
1279 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1280 0 : String serialize() override { return toValue()->serialize(); }
1281 : std::unique_ptr<CallFrame> clone() const;
1282 :
1283 : template<int STATE>
1284 : class CallFrameBuilder {
1285 : public:
1286 : enum {
1287 : NoFieldsSet = 0,
1288 : FunctionNameSet = 1 << 1,
1289 : ScriptIdSet = 1 << 2,
1290 : UrlSet = 1 << 3,
1291 : LineNumberSet = 1 << 4,
1292 : ColumnNumberSet = 1 << 5,
1293 : AllFieldsSet = (FunctionNameSet | ScriptIdSet | UrlSet | LineNumberSet | ColumnNumberSet | 0)};
1294 :
1295 :
1296 : CallFrameBuilder<STATE | FunctionNameSet>& setFunctionName(const String& value)
1297 : {
1298 : static_assert(!(STATE & FunctionNameSet), "property functionName should not be set yet");
1299 : m_result->setFunctionName(value);
1300 : return castState<FunctionNameSet>();
1301 : }
1302 :
1303 : CallFrameBuilder<STATE | ScriptIdSet>& setScriptId(const String& value)
1304 : {
1305 : static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
1306 : m_result->setScriptId(value);
1307 : return castState<ScriptIdSet>();
1308 : }
1309 :
1310 : CallFrameBuilder<STATE | UrlSet>& setUrl(const String& value)
1311 : {
1312 : static_assert(!(STATE & UrlSet), "property url should not be set yet");
1313 : m_result->setUrl(value);
1314 : return castState<UrlSet>();
1315 : }
1316 :
1317 : CallFrameBuilder<STATE | LineNumberSet>& setLineNumber(int value)
1318 : {
1319 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
1320 : m_result->setLineNumber(value);
1321 : return castState<LineNumberSet>();
1322 : }
1323 :
1324 : CallFrameBuilder<STATE | ColumnNumberSet>& setColumnNumber(int value)
1325 : {
1326 : static_assert(!(STATE & ColumnNumberSet), "property columnNumber should not be set yet");
1327 : m_result->setColumnNumber(value);
1328 : return castState<ColumnNumberSet>();
1329 : }
1330 :
1331 : std::unique_ptr<CallFrame> build()
1332 : {
1333 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1334 : return std::move(m_result);
1335 : }
1336 :
1337 : private:
1338 : friend class CallFrame;
1339 127512 : CallFrameBuilder() : m_result(new CallFrame()) { }
1340 :
1341 : template<int STEP> CallFrameBuilder<STATE | STEP>& castState()
1342 : {
1343 : return *reinterpret_cast<CallFrameBuilder<STATE | STEP>*>(this);
1344 : }
1345 :
1346 : std::unique_ptr<protocol::Runtime::CallFrame> m_result;
1347 : };
1348 :
1349 : static CallFrameBuilder<0> create()
1350 : {
1351 63756 : return CallFrameBuilder<0>();
1352 : }
1353 :
1354 : private:
1355 63756 : CallFrame()
1356 63756 : {
1357 63756 : m_lineNumber = 0;
1358 63756 : m_columnNumber = 0;
1359 63756 : }
1360 :
1361 : String m_functionName;
1362 : String m_scriptId;
1363 : String m_url;
1364 : int m_lineNumber;
1365 : int m_columnNumber;
1366 : };
1367 :
1368 :
1369 : class StackTrace : public Serializable, public API::StackTrace{
1370 : PROTOCOL_DISALLOW_COPY(StackTrace);
1371 : public:
1372 : static std::unique_ptr<StackTrace> fromValue(protocol::Value* value, ErrorSupport* errors);
1373 :
1374 185112 : ~StackTrace() override { }
1375 :
1376 : bool hasDescription() { return m_description.isJust(); }
1377 : String getDescription(const String& defaultValue) { return m_description.isJust() ? m_description.fromJust() : defaultValue; }
1378 3470 : void setDescription(const String& value) { m_description = value; }
1379 :
1380 : protocol::Array<protocol::Runtime::CallFrame>* getCallFrames() { return m_callFrames.get(); }
1381 : void setCallFrames(std::unique_ptr<protocol::Array<protocol::Runtime::CallFrame>> value) { m_callFrames = std::move(value); }
1382 :
1383 : bool hasParent() { return m_parent.isJust(); }
1384 : protocol::Runtime::StackTrace* getParent(protocol::Runtime::StackTrace* defaultValue) { return m_parent.isJust() ? m_parent.fromJust() : defaultValue; }
1385 : void setParent(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_parent = std::move(value); }
1386 :
1387 : bool hasParentId() { return m_parentId.isJust(); }
1388 : protocol::Runtime::StackTraceId* getParentId(protocol::Runtime::StackTraceId* defaultValue) { return m_parentId.isJust() ? m_parentId.fromJust() : defaultValue; }
1389 : void setParentId(std::unique_ptr<protocol::Runtime::StackTraceId> value) { m_parentId = std::move(value); }
1390 :
1391 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1392 0 : String serialize() override { return toValue()->serialize(); }
1393 : std::unique_ptr<StackTrace> clone() const;
1394 : std::unique_ptr<StringBuffer> toJSONString() const override;
1395 :
1396 : template<int STATE>
1397 : class StackTraceBuilder {
1398 : public:
1399 : enum {
1400 : NoFieldsSet = 0,
1401 : CallFramesSet = 1 << 1,
1402 : AllFieldsSet = (CallFramesSet | 0)};
1403 :
1404 :
1405 : StackTraceBuilder<STATE>& setDescription(const String& value)
1406 : {
1407 : m_result->setDescription(value);
1408 : return *this;
1409 : }
1410 :
1411 : StackTraceBuilder<STATE | CallFramesSet>& setCallFrames(std::unique_ptr<protocol::Array<protocol::Runtime::CallFrame>> value)
1412 : {
1413 : static_assert(!(STATE & CallFramesSet), "property callFrames should not be set yet");
1414 : m_result->setCallFrames(std::move(value));
1415 : return castState<CallFramesSet>();
1416 : }
1417 :
1418 : StackTraceBuilder<STATE>& setParent(std::unique_ptr<protocol::Runtime::StackTrace> value)
1419 : {
1420 : m_result->setParent(std::move(value));
1421 : return *this;
1422 : }
1423 :
1424 : StackTraceBuilder<STATE>& setParentId(std::unique_ptr<protocol::Runtime::StackTraceId> value)
1425 : {
1426 : m_result->setParentId(std::move(value));
1427 : return *this;
1428 : }
1429 :
1430 : std::unique_ptr<StackTrace> build()
1431 : {
1432 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1433 : return std::move(m_result);
1434 : }
1435 :
1436 : private:
1437 : friend class StackTrace;
1438 123408 : StackTraceBuilder() : m_result(new StackTrace()) { }
1439 :
1440 : template<int STEP> StackTraceBuilder<STATE | STEP>& castState()
1441 : {
1442 : return *reinterpret_cast<StackTraceBuilder<STATE | STEP>*>(this);
1443 : }
1444 :
1445 : std::unique_ptr<protocol::Runtime::StackTrace> m_result;
1446 : };
1447 :
1448 : static StackTraceBuilder<0> create()
1449 : {
1450 61704 : return StackTraceBuilder<0>();
1451 : }
1452 :
1453 : private:
1454 : StackTrace()
1455 123408 : {
1456 : }
1457 :
1458 : Maybe<String> m_description;
1459 : std::unique_ptr<protocol::Array<protocol::Runtime::CallFrame>> m_callFrames;
1460 : Maybe<protocol::Runtime::StackTrace> m_parent;
1461 : Maybe<protocol::Runtime::StackTraceId> m_parentId;
1462 : };
1463 :
1464 :
1465 : class StackTraceId : public Serializable, public API::StackTraceId{
1466 : PROTOCOL_DISALLOW_COPY(StackTraceId);
1467 : public:
1468 : static std::unique_ptr<StackTraceId> fromValue(protocol::Value* value, ErrorSupport* errors);
1469 :
1470 1095 : ~StackTraceId() override { }
1471 :
1472 130 : String getId() { return m_id; }
1473 235 : void setId(const String& value) { m_id = value; }
1474 :
1475 35 : bool hasDebuggerId() { return m_debuggerId.isJust(); }
1476 205 : String getDebuggerId(const String& defaultValue) { return m_debuggerId.isJust() ? m_debuggerId.fromJust() : defaultValue; }
1477 120 : void setDebuggerId(const String& value) { m_debuggerId = value; }
1478 :
1479 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1480 0 : String serialize() override { return toValue()->serialize(); }
1481 : std::unique_ptr<StackTraceId> clone() const;
1482 : std::unique_ptr<StringBuffer> toJSONString() const override;
1483 :
1484 : template<int STATE>
1485 : class StackTraceIdBuilder {
1486 : public:
1487 : enum {
1488 : NoFieldsSet = 0,
1489 : IdSet = 1 << 1,
1490 : AllFieldsSet = (IdSet | 0)};
1491 :
1492 :
1493 : StackTraceIdBuilder<STATE | IdSet>& setId(const String& value)
1494 : {
1495 : static_assert(!(STATE & IdSet), "property id should not be set yet");
1496 : m_result->setId(value);
1497 : return castState<IdSet>();
1498 : }
1499 :
1500 : StackTraceIdBuilder<STATE>& setDebuggerId(const String& value)
1501 : {
1502 50 : m_result->setDebuggerId(value);
1503 : return *this;
1504 : }
1505 :
1506 : std::unique_ptr<StackTraceId> build()
1507 : {
1508 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1509 : return std::move(m_result);
1510 : }
1511 :
1512 : private:
1513 : friend class StackTraceId;
1514 470 : StackTraceIdBuilder() : m_result(new StackTraceId()) { }
1515 :
1516 : template<int STEP> StackTraceIdBuilder<STATE | STEP>& castState()
1517 : {
1518 : return *reinterpret_cast<StackTraceIdBuilder<STATE | STEP>*>(this);
1519 : }
1520 :
1521 : std::unique_ptr<protocol::Runtime::StackTraceId> m_result;
1522 : };
1523 :
1524 : static StackTraceIdBuilder<0> create()
1525 : {
1526 235 : return StackTraceIdBuilder<0>();
1527 : }
1528 :
1529 : private:
1530 365 : StackTraceId()
1531 365 : {
1532 365 : }
1533 :
1534 : String m_id;
1535 : Maybe<String> m_debuggerId;
1536 : };
1537 :
1538 :
1539 : class BindingCalledNotification : public Serializable{
1540 : PROTOCOL_DISALLOW_COPY(BindingCalledNotification);
1541 : public:
1542 : static std::unique_ptr<BindingCalledNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1543 :
1544 105 : ~BindingCalledNotification() override { }
1545 :
1546 : String getName() { return m_name; }
1547 35 : void setName(const String& value) { m_name = value; }
1548 :
1549 : String getPayload() { return m_payload; }
1550 35 : void setPayload(const String& value) { m_payload = value; }
1551 :
1552 : int getExecutionContextId() { return m_executionContextId; }
1553 35 : void setExecutionContextId(int value) { m_executionContextId = value; }
1554 :
1555 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1556 105 : String serialize() override { return toValue()->serialize(); }
1557 : std::unique_ptr<BindingCalledNotification> clone() const;
1558 :
1559 : template<int STATE>
1560 : class BindingCalledNotificationBuilder {
1561 : public:
1562 : enum {
1563 : NoFieldsSet = 0,
1564 : NameSet = 1 << 1,
1565 : PayloadSet = 1 << 2,
1566 : ExecutionContextIdSet = 1 << 3,
1567 : AllFieldsSet = (NameSet | PayloadSet | ExecutionContextIdSet | 0)};
1568 :
1569 :
1570 : BindingCalledNotificationBuilder<STATE | NameSet>& setName(const String& value)
1571 : {
1572 : static_assert(!(STATE & NameSet), "property name should not be set yet");
1573 : m_result->setName(value);
1574 : return castState<NameSet>();
1575 : }
1576 :
1577 : BindingCalledNotificationBuilder<STATE | PayloadSet>& setPayload(const String& value)
1578 : {
1579 : static_assert(!(STATE & PayloadSet), "property payload should not be set yet");
1580 : m_result->setPayload(value);
1581 : return castState<PayloadSet>();
1582 : }
1583 :
1584 : BindingCalledNotificationBuilder<STATE | ExecutionContextIdSet>& setExecutionContextId(int value)
1585 : {
1586 : static_assert(!(STATE & ExecutionContextIdSet), "property executionContextId should not be set yet");
1587 : m_result->setExecutionContextId(value);
1588 : return castState<ExecutionContextIdSet>();
1589 : }
1590 :
1591 : std::unique_ptr<BindingCalledNotification> build()
1592 : {
1593 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1594 : return std::move(m_result);
1595 : }
1596 :
1597 : private:
1598 : friend class BindingCalledNotification;
1599 70 : BindingCalledNotificationBuilder() : m_result(new BindingCalledNotification()) { }
1600 :
1601 : template<int STEP> BindingCalledNotificationBuilder<STATE | STEP>& castState()
1602 : {
1603 : return *reinterpret_cast<BindingCalledNotificationBuilder<STATE | STEP>*>(this);
1604 : }
1605 :
1606 : std::unique_ptr<protocol::Runtime::BindingCalledNotification> m_result;
1607 : };
1608 :
1609 : static BindingCalledNotificationBuilder<0> create()
1610 : {
1611 35 : return BindingCalledNotificationBuilder<0>();
1612 : }
1613 :
1614 : private:
1615 35 : BindingCalledNotification()
1616 35 : {
1617 35 : m_executionContextId = 0;
1618 35 : }
1619 :
1620 : String m_name;
1621 : String m_payload;
1622 : int m_executionContextId;
1623 : };
1624 :
1625 :
1626 : class ConsoleAPICalledNotification : public Serializable{
1627 : PROTOCOL_DISALLOW_COPY(ConsoleAPICalledNotification);
1628 : public:
1629 : static std::unique_ptr<ConsoleAPICalledNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1630 :
1631 19905 : ~ConsoleAPICalledNotification() override { }
1632 :
1633 : struct TypeEnum {
1634 : static const char* Log;
1635 : static const char* Debug;
1636 : static const char* Info;
1637 : static const char* Error;
1638 : static const char* Warning;
1639 : static const char* Dir;
1640 : static const char* Dirxml;
1641 : static const char* Table;
1642 : static const char* Trace;
1643 : static const char* Clear;
1644 : static const char* StartGroup;
1645 : static const char* StartGroupCollapsed;
1646 : static const char* EndGroup;
1647 : static const char* Assert;
1648 : static const char* Profile;
1649 : static const char* ProfileEnd;
1650 : static const char* Count;
1651 : static const char* TimeEnd;
1652 : }; // TypeEnum
1653 :
1654 : String getType() { return m_type; }
1655 6635 : void setType(const String& value) { m_type = value; }
1656 :
1657 : protocol::Array<protocol::Runtime::RemoteObject>* getArgs() { return m_args.get(); }
1658 : void setArgs(std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> value) { m_args = std::move(value); }
1659 :
1660 : int getExecutionContextId() { return m_executionContextId; }
1661 6635 : void setExecutionContextId(int value) { m_executionContextId = value; }
1662 :
1663 : double getTimestamp() { return m_timestamp; }
1664 6635 : void setTimestamp(double value) { m_timestamp = value; }
1665 :
1666 : bool hasStackTrace() { return m_stackTrace.isJust(); }
1667 : protocol::Runtime::StackTrace* getStackTrace(protocol::Runtime::StackTrace* defaultValue) { return m_stackTrace.isJust() ? m_stackTrace.fromJust() : defaultValue; }
1668 : void setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_stackTrace = std::move(value); }
1669 :
1670 : bool hasContext() { return m_context.isJust(); }
1671 : String getContext(const String& defaultValue) { return m_context.isJust() ? m_context.fromJust() : defaultValue; }
1672 140 : void setContext(const String& value) { m_context = value; }
1673 :
1674 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1675 19905 : String serialize() override { return toValue()->serialize(); }
1676 : std::unique_ptr<ConsoleAPICalledNotification> clone() const;
1677 :
1678 : template<int STATE>
1679 : class ConsoleAPICalledNotificationBuilder {
1680 : public:
1681 : enum {
1682 : NoFieldsSet = 0,
1683 : TypeSet = 1 << 1,
1684 : ArgsSet = 1 << 2,
1685 : ExecutionContextIdSet = 1 << 3,
1686 : TimestampSet = 1 << 4,
1687 : AllFieldsSet = (TypeSet | ArgsSet | ExecutionContextIdSet | TimestampSet | 0)};
1688 :
1689 :
1690 : ConsoleAPICalledNotificationBuilder<STATE | TypeSet>& setType(const String& value)
1691 : {
1692 : static_assert(!(STATE & TypeSet), "property type should not be set yet");
1693 : m_result->setType(value);
1694 : return castState<TypeSet>();
1695 : }
1696 :
1697 : ConsoleAPICalledNotificationBuilder<STATE | ArgsSet>& setArgs(std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> value)
1698 : {
1699 : static_assert(!(STATE & ArgsSet), "property args should not be set yet");
1700 : m_result->setArgs(std::move(value));
1701 : return castState<ArgsSet>();
1702 : }
1703 :
1704 : ConsoleAPICalledNotificationBuilder<STATE | ExecutionContextIdSet>& setExecutionContextId(int value)
1705 : {
1706 : static_assert(!(STATE & ExecutionContextIdSet), "property executionContextId should not be set yet");
1707 : m_result->setExecutionContextId(value);
1708 : return castState<ExecutionContextIdSet>();
1709 : }
1710 :
1711 : ConsoleAPICalledNotificationBuilder<STATE | TimestampSet>& setTimestamp(double value)
1712 : {
1713 : static_assert(!(STATE & TimestampSet), "property timestamp should not be set yet");
1714 : m_result->setTimestamp(value);
1715 : return castState<TimestampSet>();
1716 : }
1717 :
1718 : ConsoleAPICalledNotificationBuilder<STATE>& setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value)
1719 : {
1720 : m_result->setStackTrace(std::move(value));
1721 : return *this;
1722 : }
1723 :
1724 : ConsoleAPICalledNotificationBuilder<STATE>& setContext(const String& value)
1725 : {
1726 : m_result->setContext(value);
1727 : return *this;
1728 : }
1729 :
1730 : std::unique_ptr<ConsoleAPICalledNotification> build()
1731 : {
1732 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1733 : return std::move(m_result);
1734 : }
1735 :
1736 : private:
1737 : friend class ConsoleAPICalledNotification;
1738 13270 : ConsoleAPICalledNotificationBuilder() : m_result(new ConsoleAPICalledNotification()) { }
1739 :
1740 : template<int STEP> ConsoleAPICalledNotificationBuilder<STATE | STEP>& castState()
1741 : {
1742 : return *reinterpret_cast<ConsoleAPICalledNotificationBuilder<STATE | STEP>*>(this);
1743 : }
1744 :
1745 : std::unique_ptr<protocol::Runtime::ConsoleAPICalledNotification> m_result;
1746 : };
1747 :
1748 : static ConsoleAPICalledNotificationBuilder<0> create()
1749 : {
1750 6635 : return ConsoleAPICalledNotificationBuilder<0>();
1751 : }
1752 :
1753 : private:
1754 6635 : ConsoleAPICalledNotification()
1755 6635 : {
1756 6635 : m_executionContextId = 0;
1757 6635 : m_timestamp = 0;
1758 6635 : }
1759 :
1760 : String m_type;
1761 : std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> m_args;
1762 : int m_executionContextId;
1763 : double m_timestamp;
1764 : Maybe<protocol::Runtime::StackTrace> m_stackTrace;
1765 : Maybe<String> m_context;
1766 : };
1767 :
1768 :
1769 : class ExceptionRevokedNotification : public Serializable{
1770 : PROTOCOL_DISALLOW_COPY(ExceptionRevokedNotification);
1771 : public:
1772 : static std::unique_ptr<ExceptionRevokedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1773 :
1774 140 : ~ExceptionRevokedNotification() override { }
1775 :
1776 : String getReason() { return m_reason; }
1777 70 : void setReason(const String& value) { m_reason = value; }
1778 :
1779 : int getExceptionId() { return m_exceptionId; }
1780 70 : void setExceptionId(int value) { m_exceptionId = value; }
1781 :
1782 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1783 210 : String serialize() override { return toValue()->serialize(); }
1784 : std::unique_ptr<ExceptionRevokedNotification> clone() const;
1785 :
1786 : template<int STATE>
1787 : class ExceptionRevokedNotificationBuilder {
1788 : public:
1789 : enum {
1790 : NoFieldsSet = 0,
1791 : ReasonSet = 1 << 1,
1792 : ExceptionIdSet = 1 << 2,
1793 : AllFieldsSet = (ReasonSet | ExceptionIdSet | 0)};
1794 :
1795 :
1796 : ExceptionRevokedNotificationBuilder<STATE | ReasonSet>& setReason(const String& value)
1797 : {
1798 : static_assert(!(STATE & ReasonSet), "property reason should not be set yet");
1799 : m_result->setReason(value);
1800 : return castState<ReasonSet>();
1801 : }
1802 :
1803 : ExceptionRevokedNotificationBuilder<STATE | ExceptionIdSet>& setExceptionId(int value)
1804 : {
1805 : static_assert(!(STATE & ExceptionIdSet), "property exceptionId should not be set yet");
1806 : m_result->setExceptionId(value);
1807 : return castState<ExceptionIdSet>();
1808 : }
1809 :
1810 : std::unique_ptr<ExceptionRevokedNotification> build()
1811 : {
1812 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1813 : return std::move(m_result);
1814 : }
1815 :
1816 : private:
1817 : friend class ExceptionRevokedNotification;
1818 140 : ExceptionRevokedNotificationBuilder() : m_result(new ExceptionRevokedNotification()) { }
1819 :
1820 : template<int STEP> ExceptionRevokedNotificationBuilder<STATE | STEP>& castState()
1821 : {
1822 : return *reinterpret_cast<ExceptionRevokedNotificationBuilder<STATE | STEP>*>(this);
1823 : }
1824 :
1825 : std::unique_ptr<protocol::Runtime::ExceptionRevokedNotification> m_result;
1826 : };
1827 :
1828 : static ExceptionRevokedNotificationBuilder<0> create()
1829 : {
1830 70 : return ExceptionRevokedNotificationBuilder<0>();
1831 : }
1832 :
1833 : private:
1834 : ExceptionRevokedNotification()
1835 70 : {
1836 70 : m_exceptionId = 0;
1837 : }
1838 :
1839 : String m_reason;
1840 : int m_exceptionId;
1841 : };
1842 :
1843 :
1844 : class ExceptionThrownNotification : public Serializable{
1845 : PROTOCOL_DISALLOW_COPY(ExceptionThrownNotification);
1846 : public:
1847 : static std::unique_ptr<ExceptionThrownNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1848 :
1849 350 : ~ExceptionThrownNotification() override { }
1850 :
1851 : double getTimestamp() { return m_timestamp; }
1852 175 : void setTimestamp(double value) { m_timestamp = value; }
1853 :
1854 : protocol::Runtime::ExceptionDetails* getExceptionDetails() { return m_exceptionDetails.get(); }
1855 : void setExceptionDetails(std::unique_ptr<protocol::Runtime::ExceptionDetails> value) { m_exceptionDetails = std::move(value); }
1856 :
1857 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1858 525 : String serialize() override { return toValue()->serialize(); }
1859 : std::unique_ptr<ExceptionThrownNotification> clone() const;
1860 :
1861 : template<int STATE>
1862 : class ExceptionThrownNotificationBuilder {
1863 : public:
1864 : enum {
1865 : NoFieldsSet = 0,
1866 : TimestampSet = 1 << 1,
1867 : ExceptionDetailsSet = 1 << 2,
1868 : AllFieldsSet = (TimestampSet | ExceptionDetailsSet | 0)};
1869 :
1870 :
1871 : ExceptionThrownNotificationBuilder<STATE | TimestampSet>& setTimestamp(double value)
1872 : {
1873 : static_assert(!(STATE & TimestampSet), "property timestamp should not be set yet");
1874 : m_result->setTimestamp(value);
1875 : return castState<TimestampSet>();
1876 : }
1877 :
1878 : ExceptionThrownNotificationBuilder<STATE | ExceptionDetailsSet>& setExceptionDetails(std::unique_ptr<protocol::Runtime::ExceptionDetails> value)
1879 : {
1880 : static_assert(!(STATE & ExceptionDetailsSet), "property exceptionDetails should not be set yet");
1881 : m_result->setExceptionDetails(std::move(value));
1882 : return castState<ExceptionDetailsSet>();
1883 : }
1884 :
1885 : std::unique_ptr<ExceptionThrownNotification> build()
1886 : {
1887 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1888 : return std::move(m_result);
1889 : }
1890 :
1891 : private:
1892 : friend class ExceptionThrownNotification;
1893 350 : ExceptionThrownNotificationBuilder() : m_result(new ExceptionThrownNotification()) { }
1894 :
1895 : template<int STEP> ExceptionThrownNotificationBuilder<STATE | STEP>& castState()
1896 : {
1897 : return *reinterpret_cast<ExceptionThrownNotificationBuilder<STATE | STEP>*>(this);
1898 : }
1899 :
1900 : std::unique_ptr<protocol::Runtime::ExceptionThrownNotification> m_result;
1901 : };
1902 :
1903 : static ExceptionThrownNotificationBuilder<0> create()
1904 : {
1905 175 : return ExceptionThrownNotificationBuilder<0>();
1906 : }
1907 :
1908 : private:
1909 : ExceptionThrownNotification()
1910 175 : {
1911 175 : m_timestamp = 0;
1912 : }
1913 :
1914 : double m_timestamp;
1915 : std::unique_ptr<protocol::Runtime::ExceptionDetails> m_exceptionDetails;
1916 : };
1917 :
1918 :
1919 : class ExecutionContextCreatedNotification : public Serializable{
1920 : PROTOCOL_DISALLOW_COPY(ExecutionContextCreatedNotification);
1921 : public:
1922 : static std::unique_ptr<ExecutionContextCreatedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1923 :
1924 1430 : ~ExecutionContextCreatedNotification() override { }
1925 :
1926 : protocol::Runtime::ExecutionContextDescription* getContext() { return m_context.get(); }
1927 : void setContext(std::unique_ptr<protocol::Runtime::ExecutionContextDescription> value) { m_context = std::move(value); }
1928 :
1929 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1930 2145 : String serialize() override { return toValue()->serialize(); }
1931 : std::unique_ptr<ExecutionContextCreatedNotification> clone() const;
1932 :
1933 : template<int STATE>
1934 : class ExecutionContextCreatedNotificationBuilder {
1935 : public:
1936 : enum {
1937 : NoFieldsSet = 0,
1938 : ContextSet = 1 << 1,
1939 : AllFieldsSet = (ContextSet | 0)};
1940 :
1941 :
1942 : ExecutionContextCreatedNotificationBuilder<STATE | ContextSet>& setContext(std::unique_ptr<protocol::Runtime::ExecutionContextDescription> value)
1943 : {
1944 : static_assert(!(STATE & ContextSet), "property context should not be set yet");
1945 : m_result->setContext(std::move(value));
1946 : return castState<ContextSet>();
1947 : }
1948 :
1949 : std::unique_ptr<ExecutionContextCreatedNotification> build()
1950 : {
1951 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1952 : return std::move(m_result);
1953 : }
1954 :
1955 : private:
1956 : friend class ExecutionContextCreatedNotification;
1957 715 : ExecutionContextCreatedNotificationBuilder() : m_result(new ExecutionContextCreatedNotification()) { }
1958 :
1959 : template<int STEP> ExecutionContextCreatedNotificationBuilder<STATE | STEP>& castState()
1960 : {
1961 : return *reinterpret_cast<ExecutionContextCreatedNotificationBuilder<STATE | STEP>*>(this);
1962 : }
1963 :
1964 : std::unique_ptr<protocol::Runtime::ExecutionContextCreatedNotification> m_result;
1965 : };
1966 :
1967 : static ExecutionContextCreatedNotificationBuilder<0> create()
1968 : {
1969 : return ExecutionContextCreatedNotificationBuilder<0>();
1970 : }
1971 :
1972 : private:
1973 : ExecutionContextCreatedNotification()
1974 715 : {
1975 : }
1976 :
1977 : std::unique_ptr<protocol::Runtime::ExecutionContextDescription> m_context;
1978 : };
1979 :
1980 :
1981 : class ExecutionContextDestroyedNotification : public Serializable{
1982 : PROTOCOL_DISALLOW_COPY(ExecutionContextDestroyedNotification);
1983 : public:
1984 : static std::unique_ptr<ExecutionContextDestroyedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1985 :
1986 50 : ~ExecutionContextDestroyedNotification() override { }
1987 :
1988 : int getExecutionContextId() { return m_executionContextId; }
1989 25 : void setExecutionContextId(int value) { m_executionContextId = value; }
1990 :
1991 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1992 75 : String serialize() override { return toValue()->serialize(); }
1993 : std::unique_ptr<ExecutionContextDestroyedNotification> clone() const;
1994 :
1995 : template<int STATE>
1996 : class ExecutionContextDestroyedNotificationBuilder {
1997 : public:
1998 : enum {
1999 : NoFieldsSet = 0,
2000 : ExecutionContextIdSet = 1 << 1,
2001 : AllFieldsSet = (ExecutionContextIdSet | 0)};
2002 :
2003 :
2004 : ExecutionContextDestroyedNotificationBuilder<STATE | ExecutionContextIdSet>& setExecutionContextId(int value)
2005 : {
2006 : static_assert(!(STATE & ExecutionContextIdSet), "property executionContextId should not be set yet");
2007 : m_result->setExecutionContextId(value);
2008 : return castState<ExecutionContextIdSet>();
2009 : }
2010 :
2011 : std::unique_ptr<ExecutionContextDestroyedNotification> build()
2012 : {
2013 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
2014 : return std::move(m_result);
2015 : }
2016 :
2017 : private:
2018 : friend class ExecutionContextDestroyedNotification;
2019 25 : ExecutionContextDestroyedNotificationBuilder() : m_result(new ExecutionContextDestroyedNotification()) { }
2020 :
2021 : template<int STEP> ExecutionContextDestroyedNotificationBuilder<STATE | STEP>& castState()
2022 : {
2023 : return *reinterpret_cast<ExecutionContextDestroyedNotificationBuilder<STATE | STEP>*>(this);
2024 : }
2025 :
2026 : std::unique_ptr<protocol::Runtime::ExecutionContextDestroyedNotification> m_result;
2027 : };
2028 :
2029 : static ExecutionContextDestroyedNotificationBuilder<0> create()
2030 : {
2031 : return ExecutionContextDestroyedNotificationBuilder<0>();
2032 : }
2033 :
2034 : private:
2035 : ExecutionContextDestroyedNotification()
2036 25 : {
2037 25 : m_executionContextId = 0;
2038 : }
2039 :
2040 : int m_executionContextId;
2041 : };
2042 :
2043 :
2044 : class InspectRequestedNotification : public Serializable{
2045 : PROTOCOL_DISALLOW_COPY(InspectRequestedNotification);
2046 : public:
2047 : static std::unique_ptr<InspectRequestedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
2048 :
2049 240 : ~InspectRequestedNotification() override { }
2050 :
2051 : protocol::Runtime::RemoteObject* getObject() { return m_object.get(); }
2052 : void setObject(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_object = std::move(value); }
2053 :
2054 : protocol::DictionaryValue* getHints() { return m_hints.get(); }
2055 : void setHints(std::unique_ptr<protocol::DictionaryValue> value) { m_hints = std::move(value); }
2056 :
2057 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
2058 240 : String serialize() override { return toValue()->serialize(); }
2059 : std::unique_ptr<InspectRequestedNotification> clone() const;
2060 :
2061 : template<int STATE>
2062 : class InspectRequestedNotificationBuilder {
2063 : public:
2064 : enum {
2065 : NoFieldsSet = 0,
2066 : ObjectSet = 1 << 1,
2067 : HintsSet = 1 << 2,
2068 : AllFieldsSet = (ObjectSet | HintsSet | 0)};
2069 :
2070 :
2071 : InspectRequestedNotificationBuilder<STATE | ObjectSet>& setObject(std::unique_ptr<protocol::Runtime::RemoteObject> value)
2072 : {
2073 : static_assert(!(STATE & ObjectSet), "property object should not be set yet");
2074 : m_result->setObject(std::move(value));
2075 : return castState<ObjectSet>();
2076 : }
2077 :
2078 : InspectRequestedNotificationBuilder<STATE | HintsSet>& setHints(std::unique_ptr<protocol::DictionaryValue> value)
2079 : {
2080 : static_assert(!(STATE & HintsSet), "property hints should not be set yet");
2081 : m_result->setHints(std::move(value));
2082 : return castState<HintsSet>();
2083 : }
2084 :
2085 : std::unique_ptr<InspectRequestedNotification> build()
2086 : {
2087 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
2088 : return std::move(m_result);
2089 : }
2090 :
2091 : private:
2092 : friend class InspectRequestedNotification;
2093 160 : InspectRequestedNotificationBuilder() : m_result(new InspectRequestedNotification()) { }
2094 :
2095 : template<int STEP> InspectRequestedNotificationBuilder<STATE | STEP>& castState()
2096 : {
2097 : return *reinterpret_cast<InspectRequestedNotificationBuilder<STATE | STEP>*>(this);
2098 : }
2099 :
2100 : std::unique_ptr<protocol::Runtime::InspectRequestedNotification> m_result;
2101 : };
2102 :
2103 : static InspectRequestedNotificationBuilder<0> create()
2104 : {
2105 80 : return InspectRequestedNotificationBuilder<0>();
2106 : }
2107 :
2108 : private:
2109 : InspectRequestedNotification()
2110 80 : {
2111 : }
2112 :
2113 : std::unique_ptr<protocol::Runtime::RemoteObject> m_object;
2114 : std::unique_ptr<protocol::DictionaryValue> m_hints;
2115 : };
2116 :
2117 :
2118 : // ------------- Backend interface.
2119 :
2120 3834 : class Backend {
2121 : public:
2122 3834 : virtual ~Backend() { }
2123 :
2124 35 : class AwaitPromiseCallback {
2125 : public:
2126 : virtual void sendSuccess(std::unique_ptr<protocol::Runtime::RemoteObject> result, Maybe<protocol::Runtime::ExceptionDetails> exceptionDetails) = 0;
2127 : virtual void sendFailure(const DispatchResponse&) = 0;
2128 : virtual void fallThrough() = 0;
2129 35 : virtual ~AwaitPromiseCallback() { }
2130 : };
2131 : virtual void awaitPromise(const String& in_promiseObjectId, Maybe<bool> in_returnByValue, Maybe<bool> in_generatePreview, std::unique_ptr<AwaitPromiseCallback> callback) = 0;
2132 745 : class CallFunctionOnCallback {
2133 : public:
2134 : virtual void sendSuccess(std::unique_ptr<protocol::Runtime::RemoteObject> result, Maybe<protocol::Runtime::ExceptionDetails> exceptionDetails) = 0;
2135 : virtual void sendFailure(const DispatchResponse&) = 0;
2136 : virtual void fallThrough() = 0;
2137 745 : virtual ~CallFunctionOnCallback() { }
2138 : };
2139 : virtual void callFunctionOn(const String& in_functionDeclaration, Maybe<String> in_objectId, Maybe<protocol::Array<protocol::Runtime::CallArgument>> in_arguments, Maybe<bool> in_silent, Maybe<bool> in_returnByValue, Maybe<bool> in_generatePreview, Maybe<bool> in_userGesture, Maybe<bool> in_awaitPromise, Maybe<int> in_executionContextId, Maybe<String> in_objectGroup, std::unique_ptr<CallFunctionOnCallback> callback) = 0;
2140 : virtual DispatchResponse compileScript(const String& in_expression, const String& in_sourceURL, bool in_persistScript, Maybe<int> in_executionContextId, Maybe<String>* out_scriptId, Maybe<protocol::Runtime::ExceptionDetails>* out_exceptionDetails) = 0;
2141 : virtual DispatchResponse disable() = 0;
2142 : virtual DispatchResponse discardConsoleEntries() = 0;
2143 : virtual DispatchResponse enable() = 0;
2144 8573 : class EvaluateCallback {
2145 : public:
2146 : virtual void sendSuccess(std::unique_ptr<protocol::Runtime::RemoteObject> result, Maybe<protocol::Runtime::ExceptionDetails> exceptionDetails) = 0;
2147 : virtual void sendFailure(const DispatchResponse&) = 0;
2148 : virtual void fallThrough() = 0;
2149 8573 : virtual ~EvaluateCallback() { }
2150 : };
2151 : virtual void evaluate(const String& in_expression, Maybe<String> in_objectGroup, Maybe<bool> in_includeCommandLineAPI, Maybe<bool> in_silent, Maybe<int> in_contextId, Maybe<bool> in_returnByValue, Maybe<bool> in_generatePreview, Maybe<bool> in_userGesture, Maybe<bool> in_awaitPromise, Maybe<bool> in_throwOnSideEffect, Maybe<double> in_timeout, std::unique_ptr<EvaluateCallback> callback) = 0;
2152 : virtual DispatchResponse getIsolateId(String* out_id) = 0;
2153 : virtual DispatchResponse getHeapUsage(double* out_usedSize, double* out_totalSize) = 0;
2154 : virtual DispatchResponse getProperties(const String& in_objectId, Maybe<bool> in_ownProperties, Maybe<bool> in_accessorPropertiesOnly, Maybe<bool> in_generatePreview, std::unique_ptr<protocol::Array<protocol::Runtime::PropertyDescriptor>>* out_result, Maybe<protocol::Array<protocol::Runtime::InternalPropertyDescriptor>>* out_internalProperties, Maybe<protocol::Runtime::ExceptionDetails>* out_exceptionDetails) = 0;
2155 : virtual DispatchResponse globalLexicalScopeNames(Maybe<int> in_executionContextId, std::unique_ptr<protocol::Array<String>>* out_names) = 0;
2156 : virtual DispatchResponse queryObjects(const String& in_prototypeObjectId, Maybe<String> in_objectGroup, std::unique_ptr<protocol::Runtime::RemoteObject>* out_objects) = 0;
2157 : virtual DispatchResponse releaseObject(const String& in_objectId) = 0;
2158 : virtual DispatchResponse releaseObjectGroup(const String& in_objectGroup) = 0;
2159 : virtual DispatchResponse runIfWaitingForDebugger() = 0;
2160 215 : class RunScriptCallback {
2161 : public:
2162 : virtual void sendSuccess(std::unique_ptr<protocol::Runtime::RemoteObject> result, Maybe<protocol::Runtime::ExceptionDetails> exceptionDetails) = 0;
2163 : virtual void sendFailure(const DispatchResponse&) = 0;
2164 : virtual void fallThrough() = 0;
2165 215 : virtual ~RunScriptCallback() { }
2166 : };
2167 : virtual void runScript(const String& in_scriptId, Maybe<int> in_executionContextId, Maybe<String> in_objectGroup, Maybe<bool> in_silent, Maybe<bool> in_includeCommandLineAPI, Maybe<bool> in_returnByValue, Maybe<bool> in_generatePreview, Maybe<bool> in_awaitPromise, std::unique_ptr<RunScriptCallback> callback) = 0;
2168 : virtual DispatchResponse setCustomObjectFormatterEnabled(bool in_enabled) = 0;
2169 : virtual DispatchResponse setMaxCallStackSizeToCapture(int in_size) = 0;
2170 40 : class TerminateExecutionCallback {
2171 : public:
2172 : virtual void sendSuccess() = 0;
2173 : virtual void sendFailure(const DispatchResponse&) = 0;
2174 : virtual void fallThrough() = 0;
2175 40 : virtual ~TerminateExecutionCallback() { }
2176 : };
2177 : virtual void terminateExecution(std::unique_ptr<TerminateExecutionCallback> callback) = 0;
2178 : virtual DispatchResponse addBinding(const String& in_name, Maybe<int> in_executionContextId) = 0;
2179 : virtual DispatchResponse removeBinding(const String& in_name) = 0;
2180 :
2181 : };
2182 :
2183 : // ------------- Frontend interface.
2184 :
2185 : class Frontend {
2186 : public:
2187 3834 : explicit Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
2188 : void bindingCalled(const String& name, const String& payload, int executionContextId);
2189 : void consoleAPICalled(const String& type, std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> args, int executionContextId, double timestamp, Maybe<protocol::Runtime::StackTrace> stackTrace = Maybe<protocol::Runtime::StackTrace>(), Maybe<String> context = Maybe<String>());
2190 : void exceptionRevoked(const String& reason, int exceptionId);
2191 : void exceptionThrown(double timestamp, std::unique_ptr<protocol::Runtime::ExceptionDetails> exceptionDetails);
2192 : void executionContextCreated(std::unique_ptr<protocol::Runtime::ExecutionContextDescription> context);
2193 : void executionContextDestroyed(int executionContextId);
2194 : void executionContextsCleared();
2195 : void inspectRequested(std::unique_ptr<protocol::Runtime::RemoteObject> object, std::unique_ptr<protocol::DictionaryValue> hints);
2196 :
2197 : void flush();
2198 : void sendRawNotification(const String&);
2199 : private:
2200 : FrontendChannel* m_frontendChannel;
2201 : };
2202 :
2203 : // ------------- Dispatcher.
2204 :
2205 : class Dispatcher {
2206 : public:
2207 : static void wire(UberDispatcher*, Backend*);
2208 :
2209 : private:
2210 : Dispatcher() { }
2211 : };
2212 :
2213 : // ------------- Metainfo.
2214 :
2215 : class Metainfo {
2216 : public:
2217 : using BackendClass = Backend;
2218 : using FrontendClass = Frontend;
2219 : using DispatcherClass = Dispatcher;
2220 : static const char domainName[];
2221 : static const char commandPrefix[];
2222 : static const char version[];
2223 : };
2224 :
2225 : } // namespace Runtime
2226 : } // namespace v8_inspector
2227 : } // namespace protocol
2228 :
2229 : #endif // !defined(v8_inspector_protocol_Runtime_h)
|