LCOV - code coverage report
Current view: top level - out/Release/gen/src/inspector/protocol - Runtime.h (source / functions) Hit Total Coverage
Test: app.info Lines: 184 219 84.0 %
Date: 2019-04-17 Functions: 84 123 68.3 %

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

Generated by: LCOV version 1.10