Line data Source code
1 : // This file is generated by TypeBuilder_h.template.
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_Debugger_h
8 : #define v8_inspector_protocol_Debugger_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 "src/inspector/protocol/Runtime.h"
14 : #include "include/inspector/Debugger.h"
15 :
16 : namespace v8_inspector {
17 : namespace protocol {
18 : namespace Debugger {
19 :
20 : // ------------- Forward and enum declarations.
21 : using BreakpointId = String;
22 : using CallFrameId = String;
23 : class Location;
24 : class ScriptPosition;
25 : class CallFrame;
26 : class Scope;
27 : class SearchMatch;
28 : class BreakLocation;
29 : class BreakpointResolvedNotification;
30 : class PausedNotification;
31 : using ResumedNotification = Object;
32 : class ScriptFailedToParseNotification;
33 : class ScriptParsedNotification;
34 :
35 : namespace ContinueToLocation {
36 : namespace TargetCallFramesEnum {
37 : extern const char* Any;
38 : extern const char* Current;
39 : } // TargetCallFramesEnum
40 : } // ContinueToLocation
41 :
42 : namespace SetPauseOnExceptions {
43 : namespace StateEnum {
44 : extern const char* None;
45 : extern const char* Uncaught;
46 : extern const char* All;
47 : } // StateEnum
48 : } // SetPauseOnExceptions
49 :
50 : namespace Paused {
51 : namespace ReasonEnum {
52 : extern const char* XHR;
53 : extern const char* DOM;
54 : extern const char* EventListener;
55 : extern const char* Exception;
56 : extern const char* Assert;
57 : extern const char* DebugCommand;
58 : extern const char* PromiseRejection;
59 : extern const char* OOM;
60 : extern const char* Other;
61 : extern const char* Ambiguous;
62 : } // ReasonEnum
63 : } // Paused
64 :
65 : // ------------- Type and builder declarations.
66 :
67 : class Location : public Serializable{
68 : PROTOCOL_DISALLOW_COPY(Location);
69 : public:
70 : static std::unique_ptr<Location> fromValue(protocol::Value* value, ErrorSupport* errors);
71 :
72 1218090 : ~Location() override { }
73 :
74 : String getScriptId() { return m_scriptId; }
75 : void setScriptId(const String& value) { m_scriptId = value; }
76 :
77 : int getLineNumber() { return m_lineNumber; }
78 607094 : void setLineNumber(int value) { m_lineNumber = value; }
79 :
80 : bool hasColumnNumber() { return m_columnNumber.isJust(); }
81 151502 : int getColumnNumber(int defaultValue) { return m_columnNumber.isJust() ? m_columnNumber.fromJust() : defaultValue; }
82 : void setColumnNumber(int value) { m_columnNumber = value; }
83 :
84 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
85 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
86 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
87 : String toJSON() const { return toValue()->toJSONString(); }
88 : std::unique_ptr<Location> clone() const;
89 :
90 : template<int STATE>
91 606714 : class LocationBuilder {
92 : public:
93 : enum {
94 : NoFieldsSet = 0,
95 : ScriptIdSet = 1 << 1,
96 : LineNumberSet = 1 << 2,
97 : AllFieldsSet = (ScriptIdSet | LineNumberSet | 0)};
98 :
99 :
100 : LocationBuilder<STATE | ScriptIdSet>& setScriptId(const String& value)
101 : {
102 : static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
103 : m_result->setScriptId(value);
104 : return castState<ScriptIdSet>();
105 : }
106 :
107 : LocationBuilder<STATE | LineNumberSet>& setLineNumber(int value)
108 : {
109 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
110 : m_result->setLineNumber(value);
111 : return castState<LineNumberSet>();
112 : }
113 :
114 : LocationBuilder<STATE>& setColumnNumber(int value)
115 : {
116 : m_result->setColumnNumber(value);
117 : return *this;
118 : }
119 :
120 : std::unique_ptr<Location> build()
121 : {
122 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
123 : return std::move(m_result);
124 : }
125 :
126 : private:
127 : friend class Location;
128 1213428 : LocationBuilder() : m_result(new Location()) { }
129 :
130 : template<int STEP> LocationBuilder<STATE | STEP>& castState()
131 : {
132 : return *reinterpret_cast<LocationBuilder<STATE | STEP>*>(this);
133 : }
134 :
135 : std::unique_ptr<protocol::Debugger::Location> m_result;
136 : };
137 :
138 : static LocationBuilder<0> create()
139 : {
140 606714 : return LocationBuilder<0>();
141 : }
142 :
143 : private:
144 : Location()
145 609045 : {
146 609045 : m_lineNumber = 0;
147 : }
148 :
149 : String m_scriptId;
150 : int m_lineNumber;
151 : Maybe<int> m_columnNumber;
152 : };
153 :
154 :
155 : class ScriptPosition : public Serializable{
156 : PROTOCOL_DISALLOW_COPY(ScriptPosition);
157 : public:
158 : static std::unique_ptr<ScriptPosition> fromValue(protocol::Value* value, ErrorSupport* errors);
159 :
160 190 : ~ScriptPosition() override { }
161 :
162 : int getLineNumber() { return m_lineNumber; }
163 : void setLineNumber(int value) { m_lineNumber = value; }
164 :
165 : int getColumnNumber() { return m_columnNumber; }
166 : void setColumnNumber(int value) { m_columnNumber = value; }
167 :
168 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
169 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
170 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
171 : String toJSON() const { return toValue()->toJSONString(); }
172 : std::unique_ptr<ScriptPosition> clone() const;
173 :
174 : template<int STATE>
175 : class ScriptPositionBuilder {
176 : public:
177 : enum {
178 : NoFieldsSet = 0,
179 : LineNumberSet = 1 << 1,
180 : ColumnNumberSet = 1 << 2,
181 : AllFieldsSet = (LineNumberSet | ColumnNumberSet | 0)};
182 :
183 :
184 : ScriptPositionBuilder<STATE | LineNumberSet>& setLineNumber(int value)
185 : {
186 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
187 : m_result->setLineNumber(value);
188 : return castState<LineNumberSet>();
189 : }
190 :
191 : ScriptPositionBuilder<STATE | ColumnNumberSet>& setColumnNumber(int value)
192 : {
193 : static_assert(!(STATE & ColumnNumberSet), "property columnNumber should not be set yet");
194 : m_result->setColumnNumber(value);
195 : return castState<ColumnNumberSet>();
196 : }
197 :
198 : std::unique_ptr<ScriptPosition> build()
199 : {
200 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
201 : return std::move(m_result);
202 : }
203 :
204 : private:
205 : friend class ScriptPosition;
206 : ScriptPositionBuilder() : m_result(new ScriptPosition()) { }
207 :
208 : template<int STEP> ScriptPositionBuilder<STATE | STEP>& castState()
209 : {
210 : return *reinterpret_cast<ScriptPositionBuilder<STATE | STEP>*>(this);
211 : }
212 :
213 : std::unique_ptr<protocol::Debugger::ScriptPosition> m_result;
214 : };
215 :
216 : static ScriptPositionBuilder<0> create()
217 : {
218 : return ScriptPositionBuilder<0>();
219 : }
220 :
221 : private:
222 : ScriptPosition()
223 95 : {
224 95 : m_lineNumber = 0;
225 95 : m_columnNumber = 0;
226 : }
227 :
228 : int m_lineNumber;
229 : int m_columnNumber;
230 : };
231 :
232 :
233 : class CallFrame : public Serializable{
234 : PROTOCOL_DISALLOW_COPY(CallFrame);
235 : public:
236 : static std::unique_ptr<CallFrame> fromValue(protocol::Value* value, ErrorSupport* errors);
237 :
238 441465 : ~CallFrame() override { }
239 :
240 : String getCallFrameId() { return m_callFrameId; }
241 : void setCallFrameId(const String& value) { m_callFrameId = value; }
242 :
243 : String getFunctionName() { return m_functionName; }
244 : void setFunctionName(const String& value) { m_functionName = value; }
245 :
246 : bool hasFunctionLocation() { return m_functionLocation.isJust(); }
247 : protocol::Debugger::Location* getFunctionLocation(protocol::Debugger::Location* defaultValue) { return m_functionLocation.isJust() ? m_functionLocation.fromJust() : defaultValue; }
248 : void setFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_functionLocation = std::move(value); }
249 :
250 : protocol::Debugger::Location* getLocation() { return m_location.get(); }
251 : void setLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_location = std::move(value); }
252 :
253 : String getUrl() { return m_url; }
254 : void setUrl(const String& value) { m_url = value; }
255 :
256 : protocol::Array<protocol::Debugger::Scope>* getScopeChain() { return m_scopeChain.get(); }
257 147155 : void setScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value) { m_scopeChain = std::move(value); }
258 :
259 : protocol::Runtime::RemoteObject* getThis() { return m_this.get(); }
260 : void setThis(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_this = std::move(value); }
261 :
262 : bool hasReturnValue() { return m_returnValue.isJust(); }
263 : protocol::Runtime::RemoteObject* getReturnValue(protocol::Runtime::RemoteObject* defaultValue) { return m_returnValue.isJust() ? m_returnValue.fromJust() : defaultValue; }
264 : void setReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_returnValue = std::move(value); }
265 :
266 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
267 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
268 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
269 : String toJSON() const { return toValue()->toJSONString(); }
270 : std::unique_ptr<CallFrame> clone() const;
271 :
272 : template<int STATE>
273 147155 : class CallFrameBuilder {
274 : public:
275 : enum {
276 : NoFieldsSet = 0,
277 : CallFrameIdSet = 1 << 1,
278 : FunctionNameSet = 1 << 2,
279 : LocationSet = 1 << 3,
280 : UrlSet = 1 << 4,
281 : ScopeChainSet = 1 << 5,
282 : ThisSet = 1 << 6,
283 : AllFieldsSet = (CallFrameIdSet | FunctionNameSet | LocationSet | UrlSet | ScopeChainSet | ThisSet | 0)};
284 :
285 :
286 : CallFrameBuilder<STATE | CallFrameIdSet>& setCallFrameId(const String& value)
287 : {
288 : static_assert(!(STATE & CallFrameIdSet), "property callFrameId should not be set yet");
289 : m_result->setCallFrameId(value);
290 : return castState<CallFrameIdSet>();
291 : }
292 :
293 : CallFrameBuilder<STATE | FunctionNameSet>& setFunctionName(const String& value)
294 : {
295 : static_assert(!(STATE & FunctionNameSet), "property functionName should not be set yet");
296 : m_result->setFunctionName(value);
297 : return castState<FunctionNameSet>();
298 : }
299 :
300 : CallFrameBuilder<STATE>& setFunctionLocation(std::unique_ptr<protocol::Debugger::Location> value)
301 : {
302 : m_result->setFunctionLocation(std::move(value));
303 : return *this;
304 : }
305 :
306 : CallFrameBuilder<STATE | LocationSet>& setLocation(std::unique_ptr<protocol::Debugger::Location> value)
307 : {
308 : static_assert(!(STATE & LocationSet), "property location should not be set yet");
309 : m_result->setLocation(std::move(value));
310 : return castState<LocationSet>();
311 : }
312 :
313 : CallFrameBuilder<STATE | UrlSet>& setUrl(const String& value)
314 : {
315 : static_assert(!(STATE & UrlSet), "property url should not be set yet");
316 : m_result->setUrl(value);
317 : return castState<UrlSet>();
318 : }
319 :
320 147155 : CallFrameBuilder<STATE | ScopeChainSet>& setScopeChain(std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> value)
321 : {
322 : static_assert(!(STATE & ScopeChainSet), "property scopeChain should not be set yet");
323 147155 : m_result->setScopeChain(std::move(value));
324 147155 : return castState<ScopeChainSet>();
325 : }
326 :
327 : CallFrameBuilder<STATE | ThisSet>& setThis(std::unique_ptr<protocol::Runtime::RemoteObject> value)
328 : {
329 : static_assert(!(STATE & ThisSet), "property this should not be set yet");
330 : m_result->setThis(std::move(value));
331 : return castState<ThisSet>();
332 : }
333 :
334 : CallFrameBuilder<STATE>& setReturnValue(std::unique_ptr<protocol::Runtime::RemoteObject> value)
335 : {
336 : m_result->setReturnValue(std::move(value));
337 : return *this;
338 : }
339 :
340 : std::unique_ptr<CallFrame> build()
341 : {
342 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
343 : return std::move(m_result);
344 : }
345 :
346 : private:
347 : friend class CallFrame;
348 294310 : CallFrameBuilder() : m_result(new CallFrame()) { }
349 :
350 : template<int STEP> CallFrameBuilder<STATE | STEP>& castState()
351 : {
352 : return *reinterpret_cast<CallFrameBuilder<STATE | STEP>*>(this);
353 : }
354 :
355 : std::unique_ptr<protocol::Debugger::CallFrame> m_result;
356 : };
357 :
358 : static CallFrameBuilder<0> create()
359 : {
360 147155 : return CallFrameBuilder<0>();
361 : }
362 :
363 : private:
364 : CallFrame()
365 147155 : {
366 : }
367 :
368 : String m_callFrameId;
369 : String m_functionName;
370 : Maybe<protocol::Debugger::Location> m_functionLocation;
371 : std::unique_ptr<protocol::Debugger::Location> m_location;
372 : String m_url;
373 : std::unique_ptr<protocol::Array<protocol::Debugger::Scope>> m_scopeChain;
374 : std::unique_ptr<protocol::Runtime::RemoteObject> m_this;
375 : Maybe<protocol::Runtime::RemoteObject> m_returnValue;
376 : };
377 :
378 :
379 : class Scope : public Serializable{
380 : PROTOCOL_DISALLOW_COPY(Scope);
381 : public:
382 : static std::unique_ptr<Scope> fromValue(protocol::Value* value, ErrorSupport* errors);
383 :
384 1119879 : ~Scope() override { }
385 :
386 : struct TypeEnum {
387 : static const char* Global;
388 : static const char* Local;
389 : static const char* With;
390 : static const char* Closure;
391 : static const char* Catch;
392 : static const char* Block;
393 : static const char* Script;
394 : static const char* Eval;
395 : static const char* Module;
396 : }; // TypeEnum
397 :
398 : String getType() { return m_type; }
399 : void setType(const String& value) { m_type = value; }
400 :
401 : protocol::Runtime::RemoteObject* getObject() { return m_object.get(); }
402 : void setObject(std::unique_ptr<protocol::Runtime::RemoteObject> value) { m_object = std::move(value); }
403 :
404 : bool hasName() { return m_name.isJust(); }
405 : String getName(const String& defaultValue) { return m_name.isJust() ? m_name.fromJust() : defaultValue; }
406 178092 : void setName(const String& value) { m_name = value; }
407 :
408 : bool hasStartLocation() { return m_startLocation.isJust(); }
409 : protocol::Debugger::Location* getStartLocation(protocol::Debugger::Location* defaultValue) { return m_startLocation.isJust() ? m_startLocation.fromJust() : defaultValue; }
410 : void setStartLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_startLocation = std::move(value); }
411 :
412 : bool hasEndLocation() { return m_endLocation.isJust(); }
413 : protocol::Debugger::Location* getEndLocation(protocol::Debugger::Location* defaultValue) { return m_endLocation.isJust() ? m_endLocation.fromJust() : defaultValue; }
414 : void setEndLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_endLocation = std::move(value); }
415 :
416 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
417 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
418 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
419 : String toJSON() const { return toValue()->toJSONString(); }
420 : std::unique_ptr<Scope> clone() const;
421 :
422 : template<int STATE>
423 373293 : class ScopeBuilder {
424 : public:
425 : enum {
426 : NoFieldsSet = 0,
427 : TypeSet = 1 << 1,
428 : ObjectSet = 1 << 2,
429 : AllFieldsSet = (TypeSet | ObjectSet | 0)};
430 :
431 :
432 : ScopeBuilder<STATE | TypeSet>& setType(const String& value)
433 : {
434 : static_assert(!(STATE & TypeSet), "property type should not be set yet");
435 : m_result->setType(value);
436 : return castState<TypeSet>();
437 : }
438 :
439 : ScopeBuilder<STATE | ObjectSet>& setObject(std::unique_ptr<protocol::Runtime::RemoteObject> value)
440 : {
441 : static_assert(!(STATE & ObjectSet), "property object should not be set yet");
442 : m_result->setObject(std::move(value));
443 : return castState<ObjectSet>();
444 : }
445 :
446 : ScopeBuilder<STATE>& setName(const String& value)
447 : {
448 : m_result->setName(value);
449 : return *this;
450 : }
451 :
452 : ScopeBuilder<STATE>& setStartLocation(std::unique_ptr<protocol::Debugger::Location> value)
453 : {
454 : m_result->setStartLocation(std::move(value));
455 : return *this;
456 : }
457 :
458 : ScopeBuilder<STATE>& setEndLocation(std::unique_ptr<protocol::Debugger::Location> value)
459 : {
460 : m_result->setEndLocation(std::move(value));
461 : return *this;
462 : }
463 :
464 : std::unique_ptr<Scope> build()
465 : {
466 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
467 : return std::move(m_result);
468 : }
469 :
470 : private:
471 : friend class Scope;
472 746586 : ScopeBuilder() : m_result(new Scope()) { }
473 :
474 : template<int STEP> ScopeBuilder<STATE | STEP>& castState()
475 : {
476 : return *reinterpret_cast<ScopeBuilder<STATE | STEP>*>(this);
477 : }
478 :
479 : std::unique_ptr<protocol::Debugger::Scope> m_result;
480 : };
481 :
482 : static ScopeBuilder<0> create()
483 : {
484 373293 : return ScopeBuilder<0>();
485 : }
486 :
487 : private:
488 : Scope()
489 373293 : {
490 : }
491 :
492 : String m_type;
493 : std::unique_ptr<protocol::Runtime::RemoteObject> m_object;
494 : Maybe<String> m_name;
495 : Maybe<protocol::Debugger::Location> m_startLocation;
496 : Maybe<protocol::Debugger::Location> m_endLocation;
497 : };
498 :
499 :
500 : class SearchMatch : public Serializable, public API::SearchMatch{
501 : PROTOCOL_DISALLOW_COPY(SearchMatch);
502 : public:
503 : static std::unique_ptr<SearchMatch> fromValue(protocol::Value* value, ErrorSupport* errors);
504 :
505 0 : ~SearchMatch() override { }
506 :
507 : double getLineNumber() { return m_lineNumber; }
508 0 : void setLineNumber(double value) { m_lineNumber = value; }
509 :
510 : String getLineContent() { return m_lineContent; }
511 : void setLineContent(const String& value) { m_lineContent = value; }
512 :
513 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
514 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
515 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
516 : String toJSON() const { return toValue()->toJSONString(); }
517 : std::unique_ptr<SearchMatch> clone() const;
518 : std::unique_ptr<StringBuffer> toJSONString() const override;
519 : void writeBinary(std::vector<uint8_t>* out) const override;
520 :
521 : template<int STATE>
522 0 : class SearchMatchBuilder {
523 : public:
524 : enum {
525 : NoFieldsSet = 0,
526 : LineNumberSet = 1 << 1,
527 : LineContentSet = 1 << 2,
528 : AllFieldsSet = (LineNumberSet | LineContentSet | 0)};
529 :
530 :
531 : SearchMatchBuilder<STATE | LineNumberSet>& setLineNumber(double value)
532 : {
533 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
534 : m_result->setLineNumber(value);
535 : return castState<LineNumberSet>();
536 : }
537 :
538 : SearchMatchBuilder<STATE | LineContentSet>& setLineContent(const String& value)
539 : {
540 : static_assert(!(STATE & LineContentSet), "property lineContent should not be set yet");
541 : m_result->setLineContent(value);
542 : return castState<LineContentSet>();
543 : }
544 :
545 : std::unique_ptr<SearchMatch> build()
546 : {
547 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
548 : return std::move(m_result);
549 : }
550 :
551 : private:
552 : friend class SearchMatch;
553 0 : SearchMatchBuilder() : m_result(new SearchMatch()) { }
554 :
555 : template<int STEP> SearchMatchBuilder<STATE | STEP>& castState()
556 : {
557 : return *reinterpret_cast<SearchMatchBuilder<STATE | STEP>*>(this);
558 : }
559 :
560 : std::unique_ptr<protocol::Debugger::SearchMatch> m_result;
561 : };
562 :
563 : static SearchMatchBuilder<0> create()
564 : {
565 0 : return SearchMatchBuilder<0>();
566 : }
567 :
568 : private:
569 : SearchMatch()
570 0 : {
571 0 : m_lineNumber = 0;
572 : }
573 :
574 : double m_lineNumber;
575 : String m_lineContent;
576 : };
577 :
578 :
579 : class BreakLocation : public Serializable{
580 : PROTOCOL_DISALLOW_COPY(BreakLocation);
581 : public:
582 : static std::unique_ptr<BreakLocation> fromValue(protocol::Value* value, ErrorSupport* errors);
583 :
584 12756 : ~BreakLocation() override { }
585 :
586 : String getScriptId() { return m_scriptId; }
587 : void setScriptId(const String& value) { m_scriptId = value; }
588 :
589 : int getLineNumber() { return m_lineNumber; }
590 4252 : void setLineNumber(int value) { m_lineNumber = value; }
591 :
592 : bool hasColumnNumber() { return m_columnNumber.isJust(); }
593 : int getColumnNumber(int defaultValue) { return m_columnNumber.isJust() ? m_columnNumber.fromJust() : defaultValue; }
594 : void setColumnNumber(int value) { m_columnNumber = value; }
595 :
596 : struct TypeEnum {
597 : static const char* DebuggerStatement;
598 : static const char* Call;
599 : static const char* Return;
600 : }; // TypeEnum
601 :
602 : bool hasType() { return m_type.isJust(); }
603 : String getType(const String& defaultValue) { return m_type.isJust() ? m_type.fromJust() : defaultValue; }
604 5010 : void setType(const String& value) { m_type = value; }
605 :
606 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
607 0 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
608 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
609 : String toJSON() const { return toValue()->toJSONString(); }
610 : std::unique_ptr<BreakLocation> clone() const;
611 :
612 : template<int STATE>
613 4252 : class BreakLocationBuilder {
614 : public:
615 : enum {
616 : NoFieldsSet = 0,
617 : ScriptIdSet = 1 << 1,
618 : LineNumberSet = 1 << 2,
619 : AllFieldsSet = (ScriptIdSet | LineNumberSet | 0)};
620 :
621 :
622 : BreakLocationBuilder<STATE | ScriptIdSet>& setScriptId(const String& value)
623 : {
624 : static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
625 : m_result->setScriptId(value);
626 : return castState<ScriptIdSet>();
627 : }
628 :
629 : BreakLocationBuilder<STATE | LineNumberSet>& setLineNumber(int value)
630 : {
631 : static_assert(!(STATE & LineNumberSet), "property lineNumber should not be set yet");
632 : m_result->setLineNumber(value);
633 : return castState<LineNumberSet>();
634 : }
635 :
636 : BreakLocationBuilder<STATE>& setColumnNumber(int value)
637 : {
638 : m_result->setColumnNumber(value);
639 : return *this;
640 : }
641 :
642 : BreakLocationBuilder<STATE>& setType(const String& value)
643 : {
644 : m_result->setType(value);
645 : return *this;
646 : }
647 :
648 : std::unique_ptr<BreakLocation> build()
649 : {
650 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
651 : return std::move(m_result);
652 : }
653 :
654 : private:
655 : friend class BreakLocation;
656 8504 : BreakLocationBuilder() : m_result(new BreakLocation()) { }
657 :
658 : template<int STEP> BreakLocationBuilder<STATE | STEP>& castState()
659 : {
660 : return *reinterpret_cast<BreakLocationBuilder<STATE | STEP>*>(this);
661 : }
662 :
663 : std::unique_ptr<protocol::Debugger::BreakLocation> m_result;
664 : };
665 :
666 : static BreakLocationBuilder<0> create()
667 : {
668 4252 : return BreakLocationBuilder<0>();
669 : }
670 :
671 : private:
672 : BreakLocation()
673 4252 : {
674 4252 : m_lineNumber = 0;
675 : }
676 :
677 : String m_scriptId;
678 : int m_lineNumber;
679 : Maybe<int> m_columnNumber;
680 : Maybe<String> m_type;
681 : };
682 :
683 :
684 : class BreakpointResolvedNotification : public Serializable{
685 : PROTOCOL_DISALLOW_COPY(BreakpointResolvedNotification);
686 : public:
687 : static std::unique_ptr<BreakpointResolvedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
688 :
689 210 : ~BreakpointResolvedNotification() override { }
690 :
691 : String getBreakpointId() { return m_breakpointId; }
692 : void setBreakpointId(const String& value) { m_breakpointId = value; }
693 :
694 : protocol::Debugger::Location* getLocation() { return m_location.get(); }
695 : void setLocation(std::unique_ptr<protocol::Debugger::Location> value) { m_location = std::move(value); }
696 :
697 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
698 210 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
699 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
700 : String toJSON() const { return toValue()->toJSONString(); }
701 : std::unique_ptr<BreakpointResolvedNotification> clone() const;
702 :
703 : template<int STATE>
704 70 : class BreakpointResolvedNotificationBuilder {
705 : public:
706 : enum {
707 : NoFieldsSet = 0,
708 : BreakpointIdSet = 1 << 1,
709 : LocationSet = 1 << 2,
710 : AllFieldsSet = (BreakpointIdSet | LocationSet | 0)};
711 :
712 :
713 : BreakpointResolvedNotificationBuilder<STATE | BreakpointIdSet>& setBreakpointId(const String& value)
714 : {
715 : static_assert(!(STATE & BreakpointIdSet), "property breakpointId should not be set yet");
716 : m_result->setBreakpointId(value);
717 : return castState<BreakpointIdSet>();
718 : }
719 :
720 : BreakpointResolvedNotificationBuilder<STATE | LocationSet>& setLocation(std::unique_ptr<protocol::Debugger::Location> value)
721 : {
722 : static_assert(!(STATE & LocationSet), "property location should not be set yet");
723 : m_result->setLocation(std::move(value));
724 : return castState<LocationSet>();
725 : }
726 :
727 : std::unique_ptr<BreakpointResolvedNotification> build()
728 : {
729 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
730 : return std::move(m_result);
731 : }
732 :
733 : private:
734 : friend class BreakpointResolvedNotification;
735 140 : BreakpointResolvedNotificationBuilder() : m_result(new BreakpointResolvedNotification()) { }
736 :
737 : template<int STEP> BreakpointResolvedNotificationBuilder<STATE | STEP>& castState()
738 : {
739 : return *reinterpret_cast<BreakpointResolvedNotificationBuilder<STATE | STEP>*>(this);
740 : }
741 :
742 : std::unique_ptr<protocol::Debugger::BreakpointResolvedNotification> m_result;
743 : };
744 :
745 : static BreakpointResolvedNotificationBuilder<0> create()
746 : {
747 70 : return BreakpointResolvedNotificationBuilder<0>();
748 : }
749 :
750 : private:
751 : BreakpointResolvedNotification()
752 70 : {
753 : }
754 :
755 : String m_breakpointId;
756 : std::unique_ptr<protocol::Debugger::Location> m_location;
757 : };
758 :
759 :
760 : class PausedNotification : public Serializable{
761 : PROTOCOL_DISALLOW_COPY(PausedNotification);
762 : public:
763 : static std::unique_ptr<PausedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
764 :
765 221832 : ~PausedNotification() override { }
766 :
767 : protocol::Array<protocol::Debugger::CallFrame>* getCallFrames() { return m_callFrames.get(); }
768 55458 : void setCallFrames(std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>> value) { m_callFrames = std::move(value); }
769 :
770 : struct ReasonEnum {
771 : static const char* XHR;
772 : static const char* DOM;
773 : static const char* EventListener;
774 : static const char* Exception;
775 : static const char* Assert;
776 : static const char* DebugCommand;
777 : static const char* PromiseRejection;
778 : static const char* OOM;
779 : static const char* Other;
780 : static const char* Ambiguous;
781 : }; // ReasonEnum
782 :
783 : String getReason() { return m_reason; }
784 : void setReason(const String& value) { m_reason = value; }
785 :
786 : bool hasData() { return m_data.isJust(); }
787 : protocol::DictionaryValue* getData(protocol::DictionaryValue* defaultValue) { return m_data.isJust() ? m_data.fromJust() : defaultValue; }
788 : void setData(std::unique_ptr<protocol::DictionaryValue> value) { m_data = std::move(value); }
789 :
790 : bool hasHitBreakpoints() { return m_hitBreakpoints.isJust(); }
791 : protocol::Array<String>* getHitBreakpoints(protocol::Array<String>* defaultValue) { return m_hitBreakpoints.isJust() ? m_hitBreakpoints.fromJust() : defaultValue; }
792 110916 : void setHitBreakpoints(std::unique_ptr<protocol::Array<String>> value) { m_hitBreakpoints = std::move(value); }
793 :
794 : bool hasAsyncStackTrace() { return m_asyncStackTrace.isJust(); }
795 : protocol::Runtime::StackTrace* getAsyncStackTrace(protocol::Runtime::StackTrace* defaultValue) { return m_asyncStackTrace.isJust() ? m_asyncStackTrace.fromJust() : defaultValue; }
796 : void setAsyncStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_asyncStackTrace = std::move(value); }
797 :
798 : bool hasAsyncStackTraceId() { return m_asyncStackTraceId.isJust(); }
799 : protocol::Runtime::StackTraceId* getAsyncStackTraceId(protocol::Runtime::StackTraceId* defaultValue) { return m_asyncStackTraceId.isJust() ? m_asyncStackTraceId.fromJust() : defaultValue; }
800 : void setAsyncStackTraceId(std::unique_ptr<protocol::Runtime::StackTraceId> value) { m_asyncStackTraceId = std::move(value); }
801 :
802 : bool hasAsyncCallStackTraceId() { return m_asyncCallStackTraceId.isJust(); }
803 : protocol::Runtime::StackTraceId* getAsyncCallStackTraceId(protocol::Runtime::StackTraceId* defaultValue) { return m_asyncCallStackTraceId.isJust() ? m_asyncCallStackTraceId.fromJust() : defaultValue; }
804 : void setAsyncCallStackTraceId(std::unique_ptr<protocol::Runtime::StackTraceId> value) { m_asyncCallStackTraceId = std::move(value); }
805 :
806 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
807 166374 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
808 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
809 : String toJSON() const { return toValue()->toJSONString(); }
810 : std::unique_ptr<PausedNotification> clone() const;
811 :
812 : template<int STATE>
813 55458 : class PausedNotificationBuilder {
814 : public:
815 : enum {
816 : NoFieldsSet = 0,
817 : CallFramesSet = 1 << 1,
818 : ReasonSet = 1 << 2,
819 : AllFieldsSet = (CallFramesSet | ReasonSet | 0)};
820 :
821 :
822 55458 : PausedNotificationBuilder<STATE | CallFramesSet>& setCallFrames(std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>> value)
823 : {
824 : static_assert(!(STATE & CallFramesSet), "property callFrames should not be set yet");
825 55458 : m_result->setCallFrames(std::move(value));
826 55458 : return castState<CallFramesSet>();
827 : }
828 :
829 : PausedNotificationBuilder<STATE | ReasonSet>& setReason(const String& value)
830 : {
831 : static_assert(!(STATE & ReasonSet), "property reason should not be set yet");
832 : m_result->setReason(value);
833 : return castState<ReasonSet>();
834 : }
835 :
836 : PausedNotificationBuilder<STATE>& setData(std::unique_ptr<protocol::DictionaryValue> value)
837 : {
838 : m_result->setData(std::move(value));
839 : return *this;
840 : }
841 :
842 : PausedNotificationBuilder<STATE>& setHitBreakpoints(std::unique_ptr<protocol::Array<String>> value)
843 : {
844 : m_result->setHitBreakpoints(std::move(value));
845 : return *this;
846 : }
847 :
848 : PausedNotificationBuilder<STATE>& setAsyncStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value)
849 : {
850 : m_result->setAsyncStackTrace(std::move(value));
851 : return *this;
852 : }
853 :
854 : PausedNotificationBuilder<STATE>& setAsyncStackTraceId(std::unique_ptr<protocol::Runtime::StackTraceId> value)
855 : {
856 : m_result->setAsyncStackTraceId(std::move(value));
857 : return *this;
858 : }
859 :
860 : PausedNotificationBuilder<STATE>& setAsyncCallStackTraceId(std::unique_ptr<protocol::Runtime::StackTraceId> value)
861 : {
862 : m_result->setAsyncCallStackTraceId(std::move(value));
863 : return *this;
864 : }
865 :
866 : std::unique_ptr<PausedNotification> build()
867 : {
868 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
869 : return std::move(m_result);
870 : }
871 :
872 : private:
873 : friend class PausedNotification;
874 110916 : PausedNotificationBuilder() : m_result(new PausedNotification()) { }
875 :
876 : template<int STEP> PausedNotificationBuilder<STATE | STEP>& castState()
877 : {
878 : return *reinterpret_cast<PausedNotificationBuilder<STATE | STEP>*>(this);
879 : }
880 :
881 : std::unique_ptr<protocol::Debugger::PausedNotification> m_result;
882 : };
883 :
884 : static PausedNotificationBuilder<0> create()
885 : {
886 55458 : return PausedNotificationBuilder<0>();
887 : }
888 :
889 : private:
890 : PausedNotification()
891 55458 : {
892 : }
893 :
894 : std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>> m_callFrames;
895 : String m_reason;
896 : Maybe<protocol::DictionaryValue> m_data;
897 : Maybe<protocol::Array<String>> m_hitBreakpoints;
898 : Maybe<protocol::Runtime::StackTrace> m_asyncStackTrace;
899 : Maybe<protocol::Runtime::StackTraceId> m_asyncStackTraceId;
900 : Maybe<protocol::Runtime::StackTraceId> m_asyncCallStackTraceId;
901 : };
902 :
903 :
904 : class ScriptFailedToParseNotification : public Serializable{
905 : PROTOCOL_DISALLOW_COPY(ScriptFailedToParseNotification);
906 : public:
907 : static std::unique_ptr<ScriptFailedToParseNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
908 :
909 558 : ~ScriptFailedToParseNotification() override { }
910 :
911 : String getScriptId() { return m_scriptId; }
912 : void setScriptId(const String& value) { m_scriptId = value; }
913 :
914 : String getUrl() { return m_url; }
915 : void setUrl(const String& value) { m_url = value; }
916 :
917 : int getStartLine() { return m_startLine; }
918 186 : void setStartLine(int value) { m_startLine = value; }
919 :
920 : int getStartColumn() { return m_startColumn; }
921 186 : void setStartColumn(int value) { m_startColumn = value; }
922 :
923 : int getEndLine() { return m_endLine; }
924 186 : void setEndLine(int value) { m_endLine = value; }
925 :
926 : int getEndColumn() { return m_endColumn; }
927 186 : void setEndColumn(int value) { m_endColumn = value; }
928 :
929 : int getExecutionContextId() { return m_executionContextId; }
930 186 : void setExecutionContextId(int value) { m_executionContextId = value; }
931 :
932 : String getHash() { return m_hash; }
933 : void setHash(const String& value) { m_hash = value; }
934 :
935 : bool hasExecutionContextAuxData() { return m_executionContextAuxData.isJust(); }
936 : protocol::DictionaryValue* getExecutionContextAuxData(protocol::DictionaryValue* defaultValue) { return m_executionContextAuxData.isJust() ? m_executionContextAuxData.fromJust() : defaultValue; }
937 : void setExecutionContextAuxData(std::unique_ptr<protocol::DictionaryValue> value) { m_executionContextAuxData = std::move(value); }
938 :
939 : bool hasSourceMapURL() { return m_sourceMapURL.isJust(); }
940 : String getSourceMapURL(const String& defaultValue) { return m_sourceMapURL.isJust() ? m_sourceMapURL.fromJust() : defaultValue; }
941 372 : void setSourceMapURL(const String& value) { m_sourceMapURL = value; }
942 :
943 : bool hasHasSourceURL() { return m_hasSourceURL.isJust(); }
944 : bool getHasSourceURL(bool defaultValue) { return m_hasSourceURL.isJust() ? m_hasSourceURL.fromJust() : defaultValue; }
945 : void setHasSourceURL(bool value) { m_hasSourceURL = value; }
946 :
947 : bool hasIsModule() { return m_isModule.isJust(); }
948 : bool getIsModule(bool defaultValue) { return m_isModule.isJust() ? m_isModule.fromJust() : defaultValue; }
949 : void setIsModule(bool value) { m_isModule = value; }
950 :
951 : bool hasLength() { return m_length.isJust(); }
952 : int getLength(int defaultValue) { return m_length.isJust() ? m_length.fromJust() : defaultValue; }
953 : void setLength(int value) { m_length = value; }
954 :
955 : bool hasStackTrace() { return m_stackTrace.isJust(); }
956 : protocol::Runtime::StackTrace* getStackTrace(protocol::Runtime::StackTrace* defaultValue) { return m_stackTrace.isJust() ? m_stackTrace.fromJust() : defaultValue; }
957 : void setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_stackTrace = std::move(value); }
958 :
959 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
960 558 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
961 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
962 : String toJSON() const { return toValue()->toJSONString(); }
963 : std::unique_ptr<ScriptFailedToParseNotification> clone() const;
964 :
965 : template<int STATE>
966 186 : class ScriptFailedToParseNotificationBuilder {
967 : public:
968 : enum {
969 : NoFieldsSet = 0,
970 : ScriptIdSet = 1 << 1,
971 : UrlSet = 1 << 2,
972 : StartLineSet = 1 << 3,
973 : StartColumnSet = 1 << 4,
974 : EndLineSet = 1 << 5,
975 : EndColumnSet = 1 << 6,
976 : ExecutionContextIdSet = 1 << 7,
977 : HashSet = 1 << 8,
978 : AllFieldsSet = (ScriptIdSet | UrlSet | StartLineSet | StartColumnSet | EndLineSet | EndColumnSet | ExecutionContextIdSet | HashSet | 0)};
979 :
980 :
981 : ScriptFailedToParseNotificationBuilder<STATE | ScriptIdSet>& setScriptId(const String& value)
982 : {
983 : static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
984 : m_result->setScriptId(value);
985 : return castState<ScriptIdSet>();
986 : }
987 :
988 : ScriptFailedToParseNotificationBuilder<STATE | UrlSet>& setUrl(const String& value)
989 : {
990 : static_assert(!(STATE & UrlSet), "property url should not be set yet");
991 : m_result->setUrl(value);
992 : return castState<UrlSet>();
993 : }
994 :
995 : ScriptFailedToParseNotificationBuilder<STATE | StartLineSet>& setStartLine(int value)
996 : {
997 : static_assert(!(STATE & StartLineSet), "property startLine should not be set yet");
998 : m_result->setStartLine(value);
999 : return castState<StartLineSet>();
1000 : }
1001 :
1002 : ScriptFailedToParseNotificationBuilder<STATE | StartColumnSet>& setStartColumn(int value)
1003 : {
1004 : static_assert(!(STATE & StartColumnSet), "property startColumn should not be set yet");
1005 : m_result->setStartColumn(value);
1006 : return castState<StartColumnSet>();
1007 : }
1008 :
1009 : ScriptFailedToParseNotificationBuilder<STATE | EndLineSet>& setEndLine(int value)
1010 : {
1011 : static_assert(!(STATE & EndLineSet), "property endLine should not be set yet");
1012 : m_result->setEndLine(value);
1013 : return castState<EndLineSet>();
1014 : }
1015 :
1016 : ScriptFailedToParseNotificationBuilder<STATE | EndColumnSet>& setEndColumn(int value)
1017 : {
1018 : static_assert(!(STATE & EndColumnSet), "property endColumn should not be set yet");
1019 : m_result->setEndColumn(value);
1020 : return castState<EndColumnSet>();
1021 : }
1022 :
1023 : ScriptFailedToParseNotificationBuilder<STATE | ExecutionContextIdSet>& setExecutionContextId(int value)
1024 : {
1025 : static_assert(!(STATE & ExecutionContextIdSet), "property executionContextId should not be set yet");
1026 : m_result->setExecutionContextId(value);
1027 : return castState<ExecutionContextIdSet>();
1028 : }
1029 :
1030 : ScriptFailedToParseNotificationBuilder<STATE | HashSet>& setHash(const String& value)
1031 : {
1032 : static_assert(!(STATE & HashSet), "property hash should not be set yet");
1033 : m_result->setHash(value);
1034 : return castState<HashSet>();
1035 : }
1036 :
1037 : ScriptFailedToParseNotificationBuilder<STATE>& setExecutionContextAuxData(std::unique_ptr<protocol::DictionaryValue> value)
1038 : {
1039 : m_result->setExecutionContextAuxData(std::move(value));
1040 : return *this;
1041 : }
1042 :
1043 : ScriptFailedToParseNotificationBuilder<STATE>& setSourceMapURL(const String& value)
1044 : {
1045 : m_result->setSourceMapURL(value);
1046 : return *this;
1047 : }
1048 :
1049 : ScriptFailedToParseNotificationBuilder<STATE>& setHasSourceURL(bool value)
1050 : {
1051 : m_result->setHasSourceURL(value);
1052 : return *this;
1053 : }
1054 :
1055 : ScriptFailedToParseNotificationBuilder<STATE>& setIsModule(bool value)
1056 : {
1057 : m_result->setIsModule(value);
1058 : return *this;
1059 : }
1060 :
1061 : ScriptFailedToParseNotificationBuilder<STATE>& setLength(int value)
1062 : {
1063 : m_result->setLength(value);
1064 : return *this;
1065 : }
1066 :
1067 : ScriptFailedToParseNotificationBuilder<STATE>& setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value)
1068 : {
1069 : m_result->setStackTrace(std::move(value));
1070 : return *this;
1071 : }
1072 :
1073 : std::unique_ptr<ScriptFailedToParseNotification> build()
1074 : {
1075 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1076 : return std::move(m_result);
1077 : }
1078 :
1079 : private:
1080 : friend class ScriptFailedToParseNotification;
1081 372 : ScriptFailedToParseNotificationBuilder() : m_result(new ScriptFailedToParseNotification()) { }
1082 :
1083 : template<int STEP> ScriptFailedToParseNotificationBuilder<STATE | STEP>& castState()
1084 : {
1085 : return *reinterpret_cast<ScriptFailedToParseNotificationBuilder<STATE | STEP>*>(this);
1086 : }
1087 :
1088 : std::unique_ptr<protocol::Debugger::ScriptFailedToParseNotification> m_result;
1089 : };
1090 :
1091 : static ScriptFailedToParseNotificationBuilder<0> create()
1092 : {
1093 186 : return ScriptFailedToParseNotificationBuilder<0>();
1094 : }
1095 :
1096 : private:
1097 : ScriptFailedToParseNotification()
1098 186 : {
1099 186 : m_startLine = 0;
1100 186 : m_startColumn = 0;
1101 186 : m_endLine = 0;
1102 186 : m_endColumn = 0;
1103 186 : m_executionContextId = 0;
1104 : }
1105 :
1106 : String m_scriptId;
1107 : String m_url;
1108 : int m_startLine;
1109 : int m_startColumn;
1110 : int m_endLine;
1111 : int m_endColumn;
1112 : int m_executionContextId;
1113 : String m_hash;
1114 : Maybe<protocol::DictionaryValue> m_executionContextAuxData;
1115 : Maybe<String> m_sourceMapURL;
1116 : Maybe<bool> m_hasSourceURL;
1117 : Maybe<bool> m_isModule;
1118 : Maybe<int> m_length;
1119 : Maybe<protocol::Runtime::StackTrace> m_stackTrace;
1120 : };
1121 :
1122 :
1123 : class ScriptParsedNotification : public Serializable{
1124 : PROTOCOL_DISALLOW_COPY(ScriptParsedNotification);
1125 : public:
1126 : static std::unique_ptr<ScriptParsedNotification> fromValue(protocol::Value* value, ErrorSupport* errors);
1127 :
1128 167724 : ~ScriptParsedNotification() override { }
1129 :
1130 : String getScriptId() { return m_scriptId; }
1131 : void setScriptId(const String& value) { m_scriptId = value; }
1132 :
1133 : String getUrl() { return m_url; }
1134 : void setUrl(const String& value) { m_url = value; }
1135 :
1136 : int getStartLine() { return m_startLine; }
1137 55908 : void setStartLine(int value) { m_startLine = value; }
1138 :
1139 : int getStartColumn() { return m_startColumn; }
1140 55908 : void setStartColumn(int value) { m_startColumn = value; }
1141 :
1142 : int getEndLine() { return m_endLine; }
1143 55908 : void setEndLine(int value) { m_endLine = value; }
1144 :
1145 : int getEndColumn() { return m_endColumn; }
1146 55908 : void setEndColumn(int value) { m_endColumn = value; }
1147 :
1148 : int getExecutionContextId() { return m_executionContextId; }
1149 55908 : void setExecutionContextId(int value) { m_executionContextId = value; }
1150 :
1151 : String getHash() { return m_hash; }
1152 : void setHash(const String& value) { m_hash = value; }
1153 :
1154 : bool hasExecutionContextAuxData() { return m_executionContextAuxData.isJust(); }
1155 : protocol::DictionaryValue* getExecutionContextAuxData(protocol::DictionaryValue* defaultValue) { return m_executionContextAuxData.isJust() ? m_executionContextAuxData.fromJust() : defaultValue; }
1156 : void setExecutionContextAuxData(std::unique_ptr<protocol::DictionaryValue> value) { m_executionContextAuxData = std::move(value); }
1157 :
1158 : bool hasIsLiveEdit() { return m_isLiveEdit.isJust(); }
1159 : bool getIsLiveEdit(bool defaultValue) { return m_isLiveEdit.isJust() ? m_isLiveEdit.fromJust() : defaultValue; }
1160 : void setIsLiveEdit(bool value) { m_isLiveEdit = value; }
1161 :
1162 : bool hasSourceMapURL() { return m_sourceMapURL.isJust(); }
1163 : String getSourceMapURL(const String& defaultValue) { return m_sourceMapURL.isJust() ? m_sourceMapURL.fromJust() : defaultValue; }
1164 111816 : void setSourceMapURL(const String& value) { m_sourceMapURL = value; }
1165 :
1166 : bool hasHasSourceURL() { return m_hasSourceURL.isJust(); }
1167 : bool getHasSourceURL(bool defaultValue) { return m_hasSourceURL.isJust() ? m_hasSourceURL.fromJust() : defaultValue; }
1168 : void setHasSourceURL(bool value) { m_hasSourceURL = value; }
1169 :
1170 : bool hasIsModule() { return m_isModule.isJust(); }
1171 : bool getIsModule(bool defaultValue) { return m_isModule.isJust() ? m_isModule.fromJust() : defaultValue; }
1172 : void setIsModule(bool value) { m_isModule = value; }
1173 :
1174 : bool hasLength() { return m_length.isJust(); }
1175 : int getLength(int defaultValue) { return m_length.isJust() ? m_length.fromJust() : defaultValue; }
1176 : void setLength(int value) { m_length = value; }
1177 :
1178 : bool hasStackTrace() { return m_stackTrace.isJust(); }
1179 : protocol::Runtime::StackTrace* getStackTrace(protocol::Runtime::StackTrace* defaultValue) { return m_stackTrace.isJust() ? m_stackTrace.fromJust() : defaultValue; }
1180 : void setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value) { m_stackTrace = std::move(value); }
1181 :
1182 : std::unique_ptr<protocol::DictionaryValue> toValue() const;
1183 167724 : String serializeToJSON() override { return toValue()->serializeToJSON(); }
1184 0 : std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
1185 : String toJSON() const { return toValue()->toJSONString(); }
1186 : std::unique_ptr<ScriptParsedNotification> clone() const;
1187 :
1188 : template<int STATE>
1189 : class ScriptParsedNotificationBuilder {
1190 : public:
1191 : enum {
1192 : NoFieldsSet = 0,
1193 : ScriptIdSet = 1 << 1,
1194 : UrlSet = 1 << 2,
1195 : StartLineSet = 1 << 3,
1196 : StartColumnSet = 1 << 4,
1197 : EndLineSet = 1 << 5,
1198 : EndColumnSet = 1 << 6,
1199 : ExecutionContextIdSet = 1 << 7,
1200 : HashSet = 1 << 8,
1201 : AllFieldsSet = (ScriptIdSet | UrlSet | StartLineSet | StartColumnSet | EndLineSet | EndColumnSet | ExecutionContextIdSet | HashSet | 0)};
1202 :
1203 :
1204 : ScriptParsedNotificationBuilder<STATE | ScriptIdSet>& setScriptId(const String& value)
1205 : {
1206 : static_assert(!(STATE & ScriptIdSet), "property scriptId should not be set yet");
1207 : m_result->setScriptId(value);
1208 : return castState<ScriptIdSet>();
1209 : }
1210 :
1211 : ScriptParsedNotificationBuilder<STATE | UrlSet>& setUrl(const String& value)
1212 : {
1213 : static_assert(!(STATE & UrlSet), "property url should not be set yet");
1214 : m_result->setUrl(value);
1215 : return castState<UrlSet>();
1216 : }
1217 :
1218 : ScriptParsedNotificationBuilder<STATE | StartLineSet>& setStartLine(int value)
1219 : {
1220 : static_assert(!(STATE & StartLineSet), "property startLine should not be set yet");
1221 : m_result->setStartLine(value);
1222 : return castState<StartLineSet>();
1223 : }
1224 :
1225 : ScriptParsedNotificationBuilder<STATE | StartColumnSet>& setStartColumn(int value)
1226 : {
1227 : static_assert(!(STATE & StartColumnSet), "property startColumn should not be set yet");
1228 : m_result->setStartColumn(value);
1229 : return castState<StartColumnSet>();
1230 : }
1231 :
1232 : ScriptParsedNotificationBuilder<STATE | EndLineSet>& setEndLine(int value)
1233 : {
1234 : static_assert(!(STATE & EndLineSet), "property endLine should not be set yet");
1235 : m_result->setEndLine(value);
1236 : return castState<EndLineSet>();
1237 : }
1238 :
1239 : ScriptParsedNotificationBuilder<STATE | EndColumnSet>& setEndColumn(int value)
1240 : {
1241 : static_assert(!(STATE & EndColumnSet), "property endColumn should not be set yet");
1242 : m_result->setEndColumn(value);
1243 : return castState<EndColumnSet>();
1244 : }
1245 :
1246 : ScriptParsedNotificationBuilder<STATE | ExecutionContextIdSet>& setExecutionContextId(int value)
1247 : {
1248 : static_assert(!(STATE & ExecutionContextIdSet), "property executionContextId should not be set yet");
1249 : m_result->setExecutionContextId(value);
1250 : return castState<ExecutionContextIdSet>();
1251 : }
1252 :
1253 : ScriptParsedNotificationBuilder<STATE | HashSet>& setHash(const String& value)
1254 : {
1255 : static_assert(!(STATE & HashSet), "property hash should not be set yet");
1256 : m_result->setHash(value);
1257 : return castState<HashSet>();
1258 : }
1259 :
1260 : ScriptParsedNotificationBuilder<STATE>& setExecutionContextAuxData(std::unique_ptr<protocol::DictionaryValue> value)
1261 : {
1262 : m_result->setExecutionContextAuxData(std::move(value));
1263 : return *this;
1264 : }
1265 :
1266 : ScriptParsedNotificationBuilder<STATE>& setIsLiveEdit(bool value)
1267 : {
1268 : m_result->setIsLiveEdit(value);
1269 : return *this;
1270 : }
1271 :
1272 : ScriptParsedNotificationBuilder<STATE>& setSourceMapURL(const String& value)
1273 : {
1274 : m_result->setSourceMapURL(value);
1275 : return *this;
1276 : }
1277 :
1278 : ScriptParsedNotificationBuilder<STATE>& setHasSourceURL(bool value)
1279 : {
1280 : m_result->setHasSourceURL(value);
1281 : return *this;
1282 : }
1283 :
1284 : ScriptParsedNotificationBuilder<STATE>& setIsModule(bool value)
1285 : {
1286 : m_result->setIsModule(value);
1287 : return *this;
1288 : }
1289 :
1290 : ScriptParsedNotificationBuilder<STATE>& setLength(int value)
1291 : {
1292 : m_result->setLength(value);
1293 : return *this;
1294 : }
1295 :
1296 : ScriptParsedNotificationBuilder<STATE>& setStackTrace(std::unique_ptr<protocol::Runtime::StackTrace> value)
1297 : {
1298 : m_result->setStackTrace(std::move(value));
1299 : return *this;
1300 : }
1301 :
1302 : std::unique_ptr<ScriptParsedNotification> build()
1303 : {
1304 : static_assert(STATE == AllFieldsSet, "state should be AllFieldsSet");
1305 : return std::move(m_result);
1306 : }
1307 :
1308 : private:
1309 : friend class ScriptParsedNotification;
1310 55908 : ScriptParsedNotificationBuilder() : m_result(new ScriptParsedNotification()) { }
1311 :
1312 : template<int STEP> ScriptParsedNotificationBuilder<STATE | STEP>& castState()
1313 : {
1314 : return *reinterpret_cast<ScriptParsedNotificationBuilder<STATE | STEP>*>(this);
1315 : }
1316 :
1317 : std::unique_ptr<protocol::Debugger::ScriptParsedNotification> m_result;
1318 : };
1319 :
1320 : static ScriptParsedNotificationBuilder<0> create()
1321 : {
1322 : return ScriptParsedNotificationBuilder<0>();
1323 : }
1324 :
1325 : private:
1326 55908 : ScriptParsedNotification()
1327 55908 : {
1328 55908 : m_startLine = 0;
1329 55908 : m_startColumn = 0;
1330 55908 : m_endLine = 0;
1331 55908 : m_endColumn = 0;
1332 55908 : m_executionContextId = 0;
1333 55908 : }
1334 :
1335 : String m_scriptId;
1336 : String m_url;
1337 : int m_startLine;
1338 : int m_startColumn;
1339 : int m_endLine;
1340 : int m_endColumn;
1341 : int m_executionContextId;
1342 : String m_hash;
1343 : Maybe<protocol::DictionaryValue> m_executionContextAuxData;
1344 : Maybe<bool> m_isLiveEdit;
1345 : Maybe<String> m_sourceMapURL;
1346 : Maybe<bool> m_hasSourceURL;
1347 : Maybe<bool> m_isModule;
1348 : Maybe<int> m_length;
1349 : Maybe<protocol::Runtime::StackTrace> m_stackTrace;
1350 : };
1351 :
1352 :
1353 : // ------------- Backend interface.
1354 :
1355 3879 : class Backend {
1356 : public:
1357 3879 : virtual ~Backend() { }
1358 :
1359 : virtual DispatchResponse continueToLocation(std::unique_ptr<protocol::Debugger::Location> in_location, Maybe<String> in_targetCallFrames) = 0;
1360 : virtual DispatchResponse disable() = 0;
1361 : virtual DispatchResponse enable(Maybe<double> in_maxScriptsCacheSize, String* out_debuggerId) = 0;
1362 : virtual DispatchResponse evaluateOnCallFrame(const String& in_callFrameId, const String& in_expression, Maybe<String> in_objectGroup, Maybe<bool> in_includeCommandLineAPI, Maybe<bool> in_silent, Maybe<bool> in_returnByValue, Maybe<bool> in_generatePreview, Maybe<bool> in_throwOnSideEffect, Maybe<double> in_timeout, std::unique_ptr<protocol::Runtime::RemoteObject>* out_result, Maybe<protocol::Runtime::ExceptionDetails>* out_exceptionDetails) = 0;
1363 : virtual DispatchResponse getPossibleBreakpoints(std::unique_ptr<protocol::Debugger::Location> in_start, Maybe<protocol::Debugger::Location> in_end, Maybe<bool> in_restrictToFunction, std::unique_ptr<protocol::Array<protocol::Debugger::BreakLocation>>* out_locations) = 0;
1364 : virtual DispatchResponse getScriptSource(const String& in_scriptId, String* out_scriptSource) = 0;
1365 : virtual DispatchResponse getStackTrace(std::unique_ptr<protocol::Runtime::StackTraceId> in_stackTraceId, std::unique_ptr<protocol::Runtime::StackTrace>* out_stackTrace) = 0;
1366 : virtual DispatchResponse pause() = 0;
1367 : virtual DispatchResponse pauseOnAsyncCall(std::unique_ptr<protocol::Runtime::StackTraceId> in_parentStackTraceId) = 0;
1368 : virtual DispatchResponse removeBreakpoint(const String& in_breakpointId) = 0;
1369 : virtual DispatchResponse restartFrame(const String& in_callFrameId, std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>* out_callFrames, Maybe<protocol::Runtime::StackTrace>* out_asyncStackTrace, Maybe<protocol::Runtime::StackTraceId>* out_asyncStackTraceId) = 0;
1370 : virtual DispatchResponse resume() = 0;
1371 : virtual DispatchResponse searchInContent(const String& in_scriptId, const String& in_query, Maybe<bool> in_caseSensitive, Maybe<bool> in_isRegex, std::unique_ptr<protocol::Array<protocol::Debugger::SearchMatch>>* out_result) = 0;
1372 : virtual DispatchResponse setAsyncCallStackDepth(int in_maxDepth) = 0;
1373 : virtual DispatchResponse setBlackboxPatterns(std::unique_ptr<protocol::Array<String>> in_patterns) = 0;
1374 : virtual DispatchResponse setBlackboxedRanges(const String& in_scriptId, std::unique_ptr<protocol::Array<protocol::Debugger::ScriptPosition>> in_positions) = 0;
1375 : virtual DispatchResponse setBreakpoint(std::unique_ptr<protocol::Debugger::Location> in_location, Maybe<String> in_condition, String* out_breakpointId, std::unique_ptr<protocol::Debugger::Location>* out_actualLocation) = 0;
1376 : virtual DispatchResponse setBreakpointByUrl(int in_lineNumber, Maybe<String> in_url, Maybe<String> in_urlRegex, Maybe<String> in_scriptHash, Maybe<int> in_columnNumber, Maybe<String> in_condition, String* out_breakpointId, std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* out_locations) = 0;
1377 : virtual DispatchResponse setBreakpointOnFunctionCall(const String& in_objectId, Maybe<String> in_condition, String* out_breakpointId) = 0;
1378 : virtual DispatchResponse setBreakpointsActive(bool in_active) = 0;
1379 : virtual DispatchResponse setPauseOnExceptions(const String& in_state) = 0;
1380 : virtual DispatchResponse setReturnValue(std::unique_ptr<protocol::Runtime::CallArgument> in_newValue) = 0;
1381 : virtual DispatchResponse setScriptSource(const String& in_scriptId, const String& in_scriptSource, Maybe<bool> in_dryRun, Maybe<protocol::Array<protocol::Debugger::CallFrame>>* out_callFrames, Maybe<bool>* out_stackChanged, Maybe<protocol::Runtime::StackTrace>* out_asyncStackTrace, Maybe<protocol::Runtime::StackTraceId>* out_asyncStackTraceId, Maybe<protocol::Runtime::ExceptionDetails>* out_exceptionDetails) = 0;
1382 : virtual DispatchResponse setSkipAllPauses(bool in_skip) = 0;
1383 : virtual DispatchResponse setVariableValue(int in_scopeNumber, const String& in_variableName, std::unique_ptr<protocol::Runtime::CallArgument> in_newValue, const String& in_callFrameId) = 0;
1384 : virtual DispatchResponse stepInto(Maybe<bool> in_breakOnAsyncCall) = 0;
1385 : virtual DispatchResponse stepOut() = 0;
1386 : virtual DispatchResponse stepOver() = 0;
1387 :
1388 : };
1389 :
1390 : // ------------- Frontend interface.
1391 :
1392 : class Frontend {
1393 : public:
1394 3879 : explicit Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
1395 : void breakpointResolved(const String& breakpointId, std::unique_ptr<protocol::Debugger::Location> location);
1396 : void paused(std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>> callFrames, const String& reason, Maybe<protocol::DictionaryValue> data = Maybe<protocol::DictionaryValue>(), Maybe<protocol::Array<String>> hitBreakpoints = Maybe<protocol::Array<String>>(), Maybe<protocol::Runtime::StackTrace> asyncStackTrace = Maybe<protocol::Runtime::StackTrace>(), Maybe<protocol::Runtime::StackTraceId> asyncStackTraceId = Maybe<protocol::Runtime::StackTraceId>(), Maybe<protocol::Runtime::StackTraceId> asyncCallStackTraceId = Maybe<protocol::Runtime::StackTraceId>());
1397 : void resumed();
1398 : void scriptFailedToParse(const String& scriptId, const String& url, int startLine, int startColumn, int endLine, int endColumn, int executionContextId, const String& hash, Maybe<protocol::DictionaryValue> executionContextAuxData = Maybe<protocol::DictionaryValue>(), Maybe<String> sourceMapURL = Maybe<String>(), Maybe<bool> hasSourceURL = Maybe<bool>(), Maybe<bool> isModule = Maybe<bool>(), Maybe<int> length = Maybe<int>(), Maybe<protocol::Runtime::StackTrace> stackTrace = Maybe<protocol::Runtime::StackTrace>());
1399 : void scriptParsed(const String& scriptId, const String& url, int startLine, int startColumn, int endLine, int endColumn, int executionContextId, const String& hash, Maybe<protocol::DictionaryValue> executionContextAuxData = Maybe<protocol::DictionaryValue>(), Maybe<bool> isLiveEdit = Maybe<bool>(), Maybe<String> sourceMapURL = Maybe<String>(), Maybe<bool> hasSourceURL = Maybe<bool>(), Maybe<bool> isModule = Maybe<bool>(), Maybe<int> length = Maybe<int>(), Maybe<protocol::Runtime::StackTrace> stackTrace = Maybe<protocol::Runtime::StackTrace>());
1400 :
1401 : void flush();
1402 : void sendRawNotification(String);
1403 : void sendRawNotification(std::vector<uint8_t>);
1404 : private:
1405 : FrontendChannel* m_frontendChannel;
1406 : };
1407 :
1408 : // ------------- Dispatcher.
1409 :
1410 : class Dispatcher {
1411 : public:
1412 : static void wire(UberDispatcher*, Backend*);
1413 :
1414 : private:
1415 : Dispatcher() { }
1416 : };
1417 :
1418 : // ------------- Metainfo.
1419 :
1420 : class Metainfo {
1421 : public:
1422 : using BackendClass = Backend;
1423 : using FrontendClass = Frontend;
1424 : using DispatcherClass = Dispatcher;
1425 : static const char domainName[];
1426 : static const char commandPrefix[];
1427 : static const char version[];
1428 : };
1429 :
1430 : } // namespace Debugger
1431 : } // namespace v8_inspector
1432 : } // namespace protocol
1433 :
1434 : #endif // !defined(v8_inspector_protocol_Debugger_h)
|