<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172655] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172655">172655</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-08-15 15:40:33 -0700 (Fri, 15 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
https://bugs.webkit.org/show_bug.cgi?id=131596

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Replace CodeGeneratorInspector.py with generate-inspector-protocol-bindings.py.
The new generator decouples parsing and typechecking a model of the protocol from
code generation. Each generated file is created by a different subclass of Generator.
Helper methods to compute various type signatures are shared among generators.

This patch introduces a test harness and a test suite that covers all functionality.

Aside from hooking up the new inspector bindings generator to the build system,
there are a few comingled changes that would be painful to split from the main
patch:

Convert protocol enumeration types from struct-namespaced enums to C++ scoped enums.

Move all runtimeCast(), assertValueHasExpectedType(), and RuntimeCastHelper methods to static
methods of BindingTraits specializations.

Together, these changes reduce duplication and make it possible to forward-declare
all protocol enum and object types, reducing weird ordering dependencies between domains.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.vcxproj/copy-files.cmd:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Add inspector scripts to solution filters.
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/ConsoleMessage.cpp: Convert to scoped enums.
(Inspector::messageSourceValue):
(Inspector::messageTypeValue):
(Inspector::messageLevelValue):
* inspector/InjectedScript.cpp: Convert to scoped enums and BindingTraits.
(Inspector::InjectedScript::getFunctionDetails):
(Inspector::InjectedScript::getProperties):
(Inspector::InjectedScript::getInternalProperties):
(Inspector::InjectedScript::wrapCallFrames):
(Inspector::InjectedScript::wrapObject):
(Inspector::InjectedScript::wrapTable):
* inspector/InjectedScriptBase.cpp: Convert InspectorValue::Type to a scoped enum.
(Inspector::InjectedScriptBase::makeEvalCall):
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::injectedScriptForObjectId):
* inspector/InspectorTypeBuilder.h:
(Inspector::TypeBuilder::Array::create):
(Inspector::TypeBuilder::StructItemTraits::pushRefPtr):
(Inspector::TypeBuilder::ArrayItemHelper&lt;String&gt;::Traits::pushRaw):
(Inspector::TypeBuilder::ArrayItemHelper&lt;int&gt;::Traits::pushRaw):
(Inspector::TypeBuilder::ArrayItemHelper&lt;double&gt;::Traits::pushRaw):
(Inspector::TypeBuilder::ArrayItemHelper&lt;bool&gt;::Traits::pushRaw):
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorValue&gt;::Traits::pushRefPtr):
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorObject&gt;::Traits::pushRefPtr):
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorArray&gt;::Traits::pushRefPtr):
(Inspector::TypeBuilder::PrimitiveBindingTraits::assertValueHasExpectedType):
(Inspector::TypeBuilder::BindingTraits&lt;TypeBuilder::Array&lt;T&gt;&gt;::runtimeCast):
(Inspector::TypeBuilder::BindingTraits&lt;TypeBuilder::Array&lt;T&gt;&gt;::assertValueHasExpectedType):
(Inspector::TypeBuilder::BindingTraits&lt;InspectorValue&gt;::assertValueHasExpectedType):
(Inspector::TypeBuilder::BindingTraits&lt;int&gt;::assertValueHasExpectedType):
(Inspector::TypeBuilder::ExactlyInt::ExactlyInt): Deleted. It was not used.
(Inspector::TypeBuilder::ExactlyInt::operator int): Deleted.
(Inspector::TypeBuilder::ExactlyInt::cast_to_int): Deleted.
(Inspector::TypeBuilder::ExactlyInt::cast_to_int&lt;int&gt;): Deleted.
(Inspector::TypeBuilder::int&gt;): Deleted.
(Inspector::TypeBuilder::RuntimeCastHelper::assertType): Deleted.
(Inspector::TypeBuilder::RuntimeCastHelper::assertAny): Deleted.
(Inspector::TypeBuilder::RuntimeCastHelper::assertInt): Deleted.
(Inspector::TypeBuilder::Array::runtimeCast): Deleted.
(Inspector::TypeBuilder::Array::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::StructItemTraits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;String&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;int&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;double&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;bool&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorValue&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorObject&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorArray&gt;::Traits::assertCorrectValue): Deleted.
(Inspector::TypeBuilder::ArrayItemHelper&lt;TypeBuilder::Array&lt;T&gt;&gt;::Traits::assertCorrectValue): Deleted.

* inspector/InspectorValues.cpp: Convert InspectorValue::Type to a scoped enum.
(Inspector::InspectorValue::writeJSON):
(Inspector::InspectorBasicValue::asBoolean):
(Inspector::InspectorBasicValue::asNumber):
(Inspector::InspectorBasicValue::writeJSON):
(Inspector::InspectorString::writeJSON):
(Inspector::InspectorObjectBase::InspectorObjectBase):
(Inspector::InspectorObjectBase::setArray): Take InspectorArrayBase.
(Inspector::InspectorObjectBase::setObject): Take InspectorObjectBase.
(Inspector::InspectorArrayBase::InspectorArrayBase):
* inspector/InspectorValues.h:

* inspector/agents/InspectorDebuggerAgent.cpp: Convert to scoped enums.
(Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(Inspector::InspectorDebuggerAgent::breakProgram):
* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::parse):
* inspector/agents/InspectorRuntimeAgent.h:

* inspector/scripts/CodeGeneratorInspector.py: Removed.
* inspector/scripts/codegen/__init__.py: Added.
* inspector/scripts/codegen/generate_backend_commands.py: Added.
(BackendCommandsGenerator):
(BackendCommandsGenerator.__init__):
(BackendCommandsGenerator.model):
(BackendCommandsGenerator.output_filename):
(BackendCommandsGenerator.generate_license):
(BackendCommandsGenerator.generate_output):
(BackendCommandsGenerator.generate_domain):
(BackendCommandsGenerator.generate_domain.is_anonymous_enum_member):
(BackendCommandsGenerator.generate_domain.generate_parameter_object):
* inspector/scripts/codegen/generate_backend_dispatcher_header.py: Added.
(BackendDispatcherHeaderGenerator):
(BackendDispatcherHeaderGenerator.__init__):
(BackendDispatcherHeaderGenerator.model):
(BackendDispatcherHeaderGenerator.output_filename):
(BackendDispatcherHeaderGenerator.generate_license):
(BackendDispatcherHeaderGenerator.generate_output):
(BackendDispatcherHeaderGenerator.generate_output.for):
(BackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
(BackendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter):
(BackendDispatcherHeaderGenerator._generate_handler_declaration_for_command):
(BackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command):
(BackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
(BackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command):
* inspector/scripts/codegen/generate_backend_dispatcher_implementation.py: Added.
(BackendDispatcherImplementationGenerator):
(BackendDispatcherImplementationGenerator.__init__):
(BackendDispatcherImplementationGenerator.model):
(BackendDispatcherImplementationGenerator.output_filename):
(BackendDispatcherImplementationGenerator.generate_license):
(BackendDispatcherImplementationGenerator.generate_output):
(BackendDispatcherImplementationGenerator._generate_handler_class_destructor_for_domain):
(BackendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
(BackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain):
(BackendDispatcherImplementationGenerator._generate_large_dispatcher_switch_implementation_for_domain):
(BackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
(BackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
* inspector/scripts/codegen/generate_frontend_dispatcher_header.py: Added.
(FrontendDispatcherHeaderGenerator):
(FrontendDispatcherHeaderGenerator.__init__):
(FrontendDispatcherHeaderGenerator.model):
(FrontendDispatcherHeaderGenerator.output_filename):
(FrontendDispatcherHeaderGenerator.generate_license):
(FrontendDispatcherHeaderGenerator.generate_output):
(FrontendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter):
(FrontendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
(FrontendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_event):
* inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py: Added.
(FrontendDispatcherImplementationGenerator):
(FrontendDispatcherImplementationGenerator.__init__):
(FrontendDispatcherImplementationGenerator.model):
(FrontendDispatcherImplementationGenerator.output_filename):
(FrontendDispatcherImplementationGenerator.generate_license):
(FrontendDispatcherImplementationGenerator.generate_output):
(FrontendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
(FrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event):
* inspector/scripts/codegen/generate_type_builder_header.py: Added.
(TypeBuilderHeaderGenerator):
(TypeBuilderHeaderGenerator.__init__):
(TypeBuilderHeaderGenerator.model):
(TypeBuilderHeaderGenerator.output_filename):
(TypeBuilderHeaderGenerator.generate_license):
(TypeBuilderHeaderGenerator.generate_output):
(TypeBuilderHeaderGenerator._generate_forward_declarations):
(_generate_typedefs):
(_generate_typedefs_for_domain):
(_generate_builders_for_domain):
(_generate_class_for_object_declaration):
(_generate_struct_for_enum_declaration):
(_generate_struct_for_anonymous_enum_member):
(_generate_struct_for_anonymous_enum_member.apply_indentation):
(_generate_struct_for_enum_type):
(_generate_builder_state_enum):
(_generate_builder_setter_for_member):
(_generate_unchecked_setter_for_member):
(_generate_forward_declarations_for_binding_traits):
* inspector/scripts/codegen/generate_type_builder_implementation.py: Added.
(TypeBuilderImplementationGenerator):
(TypeBuilderImplementationGenerator.__init__):
(TypeBuilderImplementationGenerator.model):
(TypeBuilderImplementationGenerator.output_filename):
(TypeBuilderImplementationGenerator.generate_license):
(TypeBuilderImplementationGenerator.generate_output):
(TypeBuilderImplementationGenerator._generate_enum_mapping):
(TypeBuilderImplementationGenerator._generate_open_field_names):
(TypeBuilderImplementationGenerator._generate_builders_for_domain):
(TypeBuilderImplementationGenerator._generate_runtime_cast_for_object_declaration):
(TypeBuilderImplementationGenerator._generate_assertion_for_object_declaration):
(TypeBuilderImplementationGenerator._generate_assertion_for_enum):
* inspector/scripts/codegen/generator.py: Added.
(ucfirst):
(Generator):
(Generator.__init__):
(Generator.model):
(Generator.generate_license):
(Generator.domains_to_generate):
(Generator.generate_output):
(Generator.output_filename):
(Generator.encoding_for_enum_value):
(Generator.assigned_enum_values):
(Generator.type_needs_runtime_casts):
(Generator.type_has_open_fields):
(Generator.type_needs_shape_assertions):
(Generator.calculate_types_requiring_shape_assertions):
(Generator.calculate_types_requiring_shape_assertions.gather_transitively_referenced_types):
(Generator._traverse_and_assign_enum_values):
(Generator._assign_encoding_for_enum_value):
(Generator.wrap_with_guard_for_domain):
(Generator.stylized_name_for_enum_value):
(Generator.stylized_name_for_enum_value.replaceCallback):
(Generator.keyed_get_method_for_type):
(Generator.keyed_set_method_for_type):
(Generator.type_builder_string_for_type):
(Generator.type_builder_string_for_type_member):
(Generator.type_string_for_unchecked_formal_in_parameter):
(Generator.type_string_for_checked_formal_event_parameter):
(Generator.type_string_for_type_member):
(Generator.type_string_for_type_with_name):
(Generator.type_string_for_formal_out_parameter):
(Generator.type_string_for_formal_async_parameter):
(Generator.type_string_for_stack_in_parameter):
(Generator.type_string_for_stack_out_parameter):
(Generator.assertion_method_for_type_member):
(Generator.assertion_method_for_type_member.assertion_method_for_type):
(Generator.cpp_name_for_primitive_type):
(Generator.js_name_for_parameter_type):
(Generator.should_use_wrapper_for_return_type):
(Generator.should_pass_by_copy_for_return_type):
* inspector/scripts/codegen/generator_templates.py: Added.
(GeneratorTemplates):
(void):
(HashMap):
(Builder):
(Inspector):
* inspector/scripts/codegen/models.py: Added.
(ucfirst):
(ParseException):
(TypecheckException):
(Framework):
(Framework.__init__):
(Framework.setting):
(Framework.fromString):
(Frameworks):
(TypeReference):
(TypeReference.__init__):
(TypeReference.referenced_name):
(Type):
(Type.__init__):
(Type.__eq__):
(Type.__hash__):
(Type.raw_name):
(Type.is_enum):
(Type.type_domain):
(Type.qualified_name):
(Type.resolve_type_references):
(PrimitiveType):
(PrimitiveType.__init__):
(PrimitiveType.__repr__):
(PrimitiveType.type_domain):
(PrimitiveType.qualified_name):
(AliasedType):
(AliasedType.__init__):
(AliasedType.__repr__):
(AliasedType.is_enum):
(AliasedType.type_domain):
(AliasedType.qualified_name):
(AliasedType.resolve_type_references):
(EnumType):
(EnumType.__init__):
(EnumType.__repr__):
(EnumType.is_enum):
(EnumType.type_domain):
(EnumType.enum_values):
(EnumType.qualified_name):
(EnumType.resolve_type_references):
(ArrayType):
(ArrayType.__init__):
(ArrayType.__repr__):
(ArrayType.type_domain):
(ArrayType.qualified_name):
(ArrayType.resolve_type_references):
(ObjectType):
(ObjectType.__init__):
(ObjectType.__repr__):
(ObjectType.type_domain):
(ObjectType.qualified_name):
(check_for_required_properties):
(Protocol):
(Protocol.__init__):
(Protocol.parse_specification):
(Protocol.parse_domain):
(Protocol.parse_type_declaration):
(Protocol.parse_type_member):
(Protocol.parse_command):
(Protocol.parse_event):
(Protocol.parse_call_or_return_parameter):
(Protocol.resolve_types):
(Protocol.lookup_type_for_declaration):
(Protocol.lookup_type_reference):
(Domain):
(Domain.__init__):
(Domain.resolve_type_references):
(Domains):
(TypeDeclaration):
(TypeDeclaration.__init__):
(TypeDeclaration.resolve_type_references):
(TypeMember):
(TypeMember.__init__):
(TypeMember.resolve_type_references):
(Parameter):
(Parameter.__init__):
(Parameter.resolve_type_references):
(Command):
(Command.__init__):
(Command.resolve_type_references):
(Event):
(Event.__init__):
(Event.resolve_type_references):
* inspector/scripts/generate-inspector-protocol-bindings.py: Added.
(IncrementalFileWriter):
(IncrementalFileWriter.__init__):
(IncrementalFileWriter.write):
(IncrementalFileWriter.close):
(generate_from_specification):
(generate_from_specification.load_specification):
* inspector/scripts/tests/commands-with-async-attribute.json: Added.
* inspector/scripts/tests/commands-with-optional-call-return-parameters.json: Added.
* inspector/scripts/tests/domains-with-varying-command-sizes.json: Added.
* inspector/scripts/tests/events-with-optional-parameters.json: Added.
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result: Added.
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: Added.
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: Added.
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result: Added.
* inspector/scripts/tests/fail-on-duplicate-type-declarations.json-error: Added.
* inspector/scripts/tests/fail-on-enum-with-no-values.json-error: Added.
* inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json-error: Added.
* inspector/scripts/tests/fail-on-type-with-lowercase-name.json-error: Added.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json-error: Added.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json-error: Added.
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result: Added.
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: Added.
* inspector/scripts/tests/expected/type-declaration-array-type.json-result: Added.
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result: Added.
* inspector/scripts/tests/expected/type-declaration-object-type.json-result: Added.
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: Added.
* inspector/scripts/tests/fail-on-duplicate-type-declarations.json: Added.
* inspector/scripts/tests/fail-on-enum-with-no-values.json: Added.
* inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json: Added.
* inspector/scripts/tests/fail-on-type-with-lowercase-name.json: Added.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json: Added.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json: Added.
* inspector/scripts/tests/same-type-id-different-domain.json: Added.
* inspector/scripts/tests/type-declaration-aliased-primitive-type.json: Added.
* inspector/scripts/tests/type-declaration-array-type.json: Added.
* inspector/scripts/tests/type-declaration-enum-type.json: Added.
* inspector/scripts/tests/type-declaration-object-type.json: Added.
* inspector/scripts/tests/type-requiring-runtime-casts.json: Added.

Source/WebCore:

Aside from hooking up the new inspector bindings generator to the build system,
there are a few comingled changes that would be painful to split from the main
patch. Together, these changes make it possible to forward-declare all protocol
enumerations as scoped enums, reducing weird ordering dependencies between domains.

All runtimeCast() methods are now static methods of BindingTraits specializations,
rather than as static methods of the type builder classes.

All protocol enumeration types are scoped enums rather than struct-namespaced enums.

Remove some implicit protocol type and enumeration definitions because they trigger
compiler bugs or introduce unnecessary complexity in the bindings generator.

No new tests, no behavior changed.

* CMakeLists.txt:
* DerivedSources.make: Update script dependencies and the bindings generator script name.

* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::inspectImpl): Convert to BindingTraits.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::detectOrigin):
(WebCore::InspectorCSSAgent::buildArrayForRegions):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::resourceTypeJson):
(WebCore::InspectorPageAgent::cachedResourceTypeJson):
(WebCore::InspectorPageAgent::getScriptExecutionStatus): Convert to scoped enums.

(WebCore::InspectorPageAgent::buildObjectForFrameTree): Extract FrameResourceTree::Resources
into its own explicitly-defined object type. The new generator does not support implicitly
defining object types as elements of arrays.
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp: Disambiguate between internal and protocol types.
(WebCore::buildInspectorObjectForSessionState):
(WebCore::buildInspectorObjectForSegmentState):
(WebCore::InspectorReplayAgent::sessionState):
(WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
(WebCore::InspectorReplayAgent::frameNavigated):
(WebCore::InspectorReplayAgent::frameDetached):
(WebCore::InspectorReplayAgent::willDispatchEvent):
(WebCore::InspectorReplayAgent::startCapturing):
(WebCore::InspectorReplayAgent::stopCapturing):
(WebCore::InspectorReplayAgent::replayToPosition):
(WebCore::InspectorReplayAgent::replayToCompletion):
(WebCore::InspectorReplayAgent::pausePlayback):
(WebCore::InspectorReplayAgent::cancelPlayback):
(WebCore::InspectorReplayAgent::switchSession):
(WebCore::InspectorReplayAgent::insertSessionSegment):
(WebCore::InspectorReplayAgent::removeSessionSegment):
(WebCore::InspectorReplayAgent::currentReplayState):
(WebCore::InspectorReplayAgent::getAvailableSessions):
(WebCore::InspectorReplayAgent::getSessionData):
(WebCore::InspectorReplayAgent::getSegmentData):
* inspector/InspectorReplayAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willSendRequest):
* inspector/InspectorStyleSheet.cpp: Convert to scoped enums. Extract CSSProperty::Status
because scoped enums defined in a class scope trigger compiler bugs in GCC 4.8.
(WebCore::buildMediaObject):
(WebCore::InspectorStyle::styleWithProperties): Work around compiler disagreements.
(WebCore::InspectorStyleSheet::create):
(WebCore::InspectorStyleSheet::InspectorStyleSheet):
(WebCore::InspectorStyleSheetForInlineStyle::create):
(WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
* inspector/InspectorStyleSheet.h:

* inspector/InspectorTimelineAgent.cpp: Convert to scoped enums and BindingTraits.
(WebCore::toProtocol):
(WebCore::InspectorTimelineAgent::addRecordToTimeline):
(WebCore::InspectorTimelineAgent::sendEvent):

* inspector/protocol/CSS.json: Extract CSSProperty::Status.
* inspector/protocol/Page.json: Extract FrameResourceTree::Resources.

Source/WebInspectorUI:

Also apply type extraction refactorings to old protocol versions for consistency.

* Versions/Inspector-iOS-6.0.json:
* Versions/Inspector-iOS-7.0.json:

Tools:

* Scripts/run-inspector-generator-tests: Added.
(main):
* Scripts/webkitpy/inspector/__init__.py: Added.
* Scripts/webkitpy/inspector/main.py: Added.
(InspectorGeneratorTests):
(InspectorGeneratorTests.__init__):
(InspectorGeneratorTests.generate_from_json):
(InspectorGeneratorTests.write_error_file):
(InspectorGeneratorTests.detect_changes):
(InspectorGeneratorTests.run_tests):
(InspectorGeneratorTests.main):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreDerivedSourcesmake">trunk/Source/JavaScriptCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojcopyfilescmd">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorConsoleMessagecpp">trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptcpp">trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptBasecpp">trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp">trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInspectorTypeBuilderh">trunk/Source/JavaScriptCore/inspector/InspectorTypeBuilder.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInspectorValuescpp">trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInspectorValuesh">trunk/Source/JavaScriptCore/inspector/InspectorValues.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreinspectorCommandLineAPIHostcpp">trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgenth">trunk/Source/WebCore/inspector/InspectorCSSAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgenth">trunk/Source/WebCore/inspector/InspectorPageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorReplayAgentcpp">trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorReplayAgenth">trunk/Source/WebCore/inspector/InspectorReplayAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheetcpp">trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheeth">trunk/Source/WebCore/inspector/InspectorStyleSheet.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorprotocolCSSjson">trunk/Source/WebCore/inspector/protocol/CSS.json</a></li>
<li><a href="#trunkSourceWebCoreinspectorprotocolPagejson">trunk/Source/WebCore/inspector/protocol/Page.json</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIVersionsInspectoriOS60json">trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json</a></li>
<li><a href="#trunkSourceWebInspectorUIVersionsInspectoriOS70json">trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/JavaScriptCore/inspector/scripts/codegen/</li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegen__init__py">trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_commandspy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_type_builder_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_type_builder_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengeneratorpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerator_templatespy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegenmodelspy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/models.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsgenerateinspectorprotocolbindingspy">trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py</a></li>
<li>trunk/Source/JavaScriptCore/inspector/scripts/tests/</li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestscommandswithasyncattributejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-async-attribute.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestscommandswithoptionalcallreturnparametersjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-optional-call-return-parameters.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsdomainswithvaryingcommandsizesjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/domains-with-varying-command-sizes.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestseventswithoptionalparametersjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/events-with-optional-parameters.json</a></li>
<li>trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/</li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedcommandswithasyncattributejsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedcommandswithoptionalcallreturnparametersjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpecteddomainswithvaryingcommandsizesjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedeventswithoptionalparametersjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonduplicatetypedeclarationsjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-duplicate-type-declarations.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonenumwithnovaluesjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-enum-with-no-values.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonstringtypedoptionalparameterflagjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-parameter-flag.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonstringtypedoptionaltypememberjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-type-member.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailontypedeclarationusingtypereferencejsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-declaration-using-type-reference.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailontypewithlowercasenamejsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-with-lowercase-name.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonunknowntypereferenceintypedeclarationjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonunknowntypereferenceintypememberjsonerror">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-member.json-error</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedsametypeiddifferentdomainjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedshadowedoptionaltypesettersjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationaliasedprimitivetypejsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationarraytypejsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationenumtypejsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationobjecttypejsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtyperequiringruntimecastsjsonresult">trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonduplicatetypedeclarationsjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-duplicate-type-declarations.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonenumwithnovaluesjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-enum-with-no-values.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonstringtypedoptionalparameterflagjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-parameter-flag.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonstringtypedoptionaltypememberjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-type-member.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailontypedeclarationusingtypereferencejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailontypewithlowercasenamejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-with-lowercase-name.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonunknowntypereferenceintypedeclarationjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsfailonunknowntypereferenceintypememberjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestssametypeiddifferentdomainjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/same-type-id-different-domain.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptstestsshadowedoptionaltypesettersjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/shadowed-optional-type-setters.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationaliasedprimitivetypejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-aliased-primitive-type.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationarraytypejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-array-type.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationenumtypejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-enum-type.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationobjecttypejson">trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsteststyperequiringruntimecastsjson">trunk/Source/JavaScriptCore/inspector/scripts/tests/type-requiring-runtime-casts.json</a></li>
<li><a href="#trunkToolsScriptsruninspectorgeneratortests">trunk/Tools/Scripts/run-inspector-generator-tests</a></li>
<li>trunk/Tools/Scripts/webkitpy/inspector/</li>
<li><a href="#trunkToolsScriptswebkitpyinspector__init__py">trunk/Tools/Scripts/webkitpy/inspector/__init__.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyinspectormainpy">trunk/Tools/Scripts/webkitpy/inspector/main.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsCodeGeneratorInspectorpy">trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptsCodeGeneratorInspectorStringspy">trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -907,6 +907,21 @@
</span><span class="cx"> 
</span><span class="cx"> set(JavaScriptCore_INSPECTOR_SCRIPTS_DIR &quot;${JAVASCRIPTCORE_DIR}/inspector/scripts&quot;)
</span><span class="cx"> 
</span><ins>+set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_commands.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_dispatcher_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_dispatcher_implementation.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_frontend_dispatcher_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_frontend_dispatcher_implementation.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_type_builder_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_type_builder_implementation.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
+)
+
</ins><span class="cx"> set(JavaScriptCore_INSPECTOR_DOMAINS
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Console.json
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/inspector/protocol/Debugger.json
</span><span class="lines">@@ -933,9 +948,8 @@
</span><span class="cx">            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
</span><span class="cx">            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorJSBackendCommands.js
</span><span class="cx">     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
</span><del>-    DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py
-            ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py
-    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir &quot;${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector&quot; --output_cpp_dir &quot;${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector&quot; --output_js_dir &quot;${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol&quot; --output_type JavaScript --write_always
</del><ins>+    DEPENDS ${JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS}
+    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir &quot;${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}&quot; --framework JavaScriptCore ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json &amp;&amp; mkdir -p ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector &amp;&amp; cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector &amp;&amp; mkdir -p ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol &amp;&amp; cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol
</ins><span class="cx">     VERBATIM)
</span><span class="cx"> file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,3 +1,365 @@
</span><ins>+2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
+        https://bugs.webkit.org/show_bug.cgi?id=131596
+
+        Reviewed by Joseph Pecoraro.
+
+        Replace CodeGeneratorInspector.py with generate-inspector-protocol-bindings.py.
+        The new generator decouples parsing and typechecking a model of the protocol from
+        code generation. Each generated file is created by a different subclass of Generator.
+        Helper methods to compute various type signatures are shared among generators.
+
+        This patch introduces a test harness and a test suite that covers all functionality.
+
+        Aside from hooking up the new inspector bindings generator to the build system,
+        there are a few comingled changes that would be painful to split from the main
+        patch:
+
+        Convert protocol enumeration types from struct-namespaced enums to C++ scoped enums.
+
+        Move all runtimeCast(), assertValueHasExpectedType(), and RuntimeCastHelper methods to static
+        methods of BindingTraits specializations.
+
+        Together, these changes reduce duplication and make it possible to forward-declare
+        all protocol enum and object types, reducing weird ordering dependencies between domains.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * JavaScriptCore.vcxproj/copy-files.cmd:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Add inspector scripts to solution filters.
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/ConsoleMessage.cpp: Convert to scoped enums.
+        (Inspector::messageSourceValue):
+        (Inspector::messageTypeValue):
+        (Inspector::messageLevelValue):
+        * inspector/InjectedScript.cpp: Convert to scoped enums and BindingTraits.
+        (Inspector::InjectedScript::getFunctionDetails):
+        (Inspector::InjectedScript::getProperties):
+        (Inspector::InjectedScript::getInternalProperties):
+        (Inspector::InjectedScript::wrapCallFrames):
+        (Inspector::InjectedScript::wrapObject):
+        (Inspector::InjectedScript::wrapTable):
+        * inspector/InjectedScriptBase.cpp: Convert InspectorValue::Type to a scoped enum.
+        (Inspector::InjectedScriptBase::makeEvalCall):
+        * inspector/InjectedScriptManager.cpp:
+        (Inspector::InjectedScriptManager::injectedScriptForObjectId):
+        * inspector/InspectorTypeBuilder.h:
+        (Inspector::TypeBuilder::Array::create):
+        (Inspector::TypeBuilder::StructItemTraits::pushRefPtr):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;String&gt;::Traits::pushRaw):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;int&gt;::Traits::pushRaw):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;double&gt;::Traits::pushRaw):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;bool&gt;::Traits::pushRaw):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorValue&gt;::Traits::pushRefPtr):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorObject&gt;::Traits::pushRefPtr):
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorArray&gt;::Traits::pushRefPtr):
+        (Inspector::TypeBuilder::PrimitiveBindingTraits::assertValueHasExpectedType):
+        (Inspector::TypeBuilder::BindingTraits&lt;TypeBuilder::Array&lt;T&gt;&gt;::runtimeCast):
+        (Inspector::TypeBuilder::BindingTraits&lt;TypeBuilder::Array&lt;T&gt;&gt;::assertValueHasExpectedType):
+        (Inspector::TypeBuilder::BindingTraits&lt;InspectorValue&gt;::assertValueHasExpectedType):
+        (Inspector::TypeBuilder::BindingTraits&lt;int&gt;::assertValueHasExpectedType):
+        (Inspector::TypeBuilder::ExactlyInt::ExactlyInt): Deleted. It was not used.
+        (Inspector::TypeBuilder::ExactlyInt::operator int): Deleted.
+        (Inspector::TypeBuilder::ExactlyInt::cast_to_int): Deleted.
+        (Inspector::TypeBuilder::ExactlyInt::cast_to_int&lt;int&gt;): Deleted.
+        (Inspector::TypeBuilder::int&gt;): Deleted.
+        (Inspector::TypeBuilder::RuntimeCastHelper::assertType): Deleted.
+        (Inspector::TypeBuilder::RuntimeCastHelper::assertAny): Deleted.
+        (Inspector::TypeBuilder::RuntimeCastHelper::assertInt): Deleted.
+        (Inspector::TypeBuilder::Array::runtimeCast): Deleted.
+        (Inspector::TypeBuilder::Array::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::StructItemTraits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;String&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;int&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;double&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;bool&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorValue&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorObject&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;InspectorArray&gt;::Traits::assertCorrectValue): Deleted.
+        (Inspector::TypeBuilder::ArrayItemHelper&lt;TypeBuilder::Array&lt;T&gt;&gt;::Traits::assertCorrectValue): Deleted.
+
+        * inspector/InspectorValues.cpp: Convert InspectorValue::Type to a scoped enum.
+        (Inspector::InspectorValue::writeJSON):
+        (Inspector::InspectorBasicValue::asBoolean):
+        (Inspector::InspectorBasicValue::asNumber):
+        (Inspector::InspectorBasicValue::writeJSON):
+        (Inspector::InspectorString::writeJSON):
+        (Inspector::InspectorObjectBase::InspectorObjectBase):
+        (Inspector::InspectorObjectBase::setArray): Take InspectorArrayBase.
+        (Inspector::InspectorObjectBase::setObject): Take InspectorObjectBase.
+        (Inspector::InspectorArrayBase::InspectorArrayBase):
+        * inspector/InspectorValues.h:
+
+        * inspector/agents/InspectorDebuggerAgent.cpp: Convert to scoped enums.
+        (Inspector::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+        (Inspector::InspectorDebuggerAgent::breakProgram):
+        * inspector/agents/InspectorDebuggerAgent.h:
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::InspectorRuntimeAgent::parse):
+        * inspector/agents/InspectorRuntimeAgent.h:
+
+        * inspector/scripts/CodeGeneratorInspector.py: Removed.
+        * inspector/scripts/codegen/__init__.py: Added.
+        * inspector/scripts/codegen/generate_backend_commands.py: Added.
+        (BackendCommandsGenerator):
+        (BackendCommandsGenerator.__init__):
+        (BackendCommandsGenerator.model):
+        (BackendCommandsGenerator.output_filename):
+        (BackendCommandsGenerator.generate_license):
+        (BackendCommandsGenerator.generate_output):
+        (BackendCommandsGenerator.generate_domain):
+        (BackendCommandsGenerator.generate_domain.is_anonymous_enum_member):
+        (BackendCommandsGenerator.generate_domain.generate_parameter_object):
+        * inspector/scripts/codegen/generate_backend_dispatcher_header.py: Added.
+        (BackendDispatcherHeaderGenerator):
+        (BackendDispatcherHeaderGenerator.__init__):
+        (BackendDispatcherHeaderGenerator.model):
+        (BackendDispatcherHeaderGenerator.output_filename):
+        (BackendDispatcherHeaderGenerator.generate_license):
+        (BackendDispatcherHeaderGenerator.generate_output):
+        (BackendDispatcherHeaderGenerator.generate_output.for):
+        (BackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
+        (BackendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter):
+        (BackendDispatcherHeaderGenerator._generate_handler_declaration_for_command):
+        (BackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command):
+        (BackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
+        (BackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command):
+        * inspector/scripts/codegen/generate_backend_dispatcher_implementation.py: Added.
+        (BackendDispatcherImplementationGenerator):
+        (BackendDispatcherImplementationGenerator.__init__):
+        (BackendDispatcherImplementationGenerator.model):
+        (BackendDispatcherImplementationGenerator.output_filename):
+        (BackendDispatcherImplementationGenerator.generate_license):
+        (BackendDispatcherImplementationGenerator.generate_output):
+        (BackendDispatcherImplementationGenerator._generate_handler_class_destructor_for_domain):
+        (BackendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
+        (BackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain):
+        (BackendDispatcherImplementationGenerator._generate_large_dispatcher_switch_implementation_for_domain):
+        (BackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
+        (BackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
+        * inspector/scripts/codegen/generate_frontend_dispatcher_header.py: Added.
+        (FrontendDispatcherHeaderGenerator):
+        (FrontendDispatcherHeaderGenerator.__init__):
+        (FrontendDispatcherHeaderGenerator.model):
+        (FrontendDispatcherHeaderGenerator.output_filename):
+        (FrontendDispatcherHeaderGenerator.generate_license):
+        (FrontendDispatcherHeaderGenerator.generate_output):
+        (FrontendDispatcherHeaderGenerator._generate_anonymous_enum_for_parameter):
+        (FrontendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
+        (FrontendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_event):
+        * inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py: Added.
+        (FrontendDispatcherImplementationGenerator):
+        (FrontendDispatcherImplementationGenerator.__init__):
+        (FrontendDispatcherImplementationGenerator.model):
+        (FrontendDispatcherImplementationGenerator.output_filename):
+        (FrontendDispatcherImplementationGenerator.generate_license):
+        (FrontendDispatcherImplementationGenerator.generate_output):
+        (FrontendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
+        (FrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event):
+        * inspector/scripts/codegen/generate_type_builder_header.py: Added.
+        (TypeBuilderHeaderGenerator):
+        (TypeBuilderHeaderGenerator.__init__):
+        (TypeBuilderHeaderGenerator.model):
+        (TypeBuilderHeaderGenerator.output_filename):
+        (TypeBuilderHeaderGenerator.generate_license):
+        (TypeBuilderHeaderGenerator.generate_output):
+        (TypeBuilderHeaderGenerator._generate_forward_declarations):
+        (_generate_typedefs):
+        (_generate_typedefs_for_domain):
+        (_generate_builders_for_domain):
+        (_generate_class_for_object_declaration):
+        (_generate_struct_for_enum_declaration):
+        (_generate_struct_for_anonymous_enum_member):
+        (_generate_struct_for_anonymous_enum_member.apply_indentation):
+        (_generate_struct_for_enum_type):
+        (_generate_builder_state_enum):
+        (_generate_builder_setter_for_member):
+        (_generate_unchecked_setter_for_member):
+        (_generate_forward_declarations_for_binding_traits):
+        * inspector/scripts/codegen/generate_type_builder_implementation.py: Added.
+        (TypeBuilderImplementationGenerator):
+        (TypeBuilderImplementationGenerator.__init__):
+        (TypeBuilderImplementationGenerator.model):
+        (TypeBuilderImplementationGenerator.output_filename):
+        (TypeBuilderImplementationGenerator.generate_license):
+        (TypeBuilderImplementationGenerator.generate_output):
+        (TypeBuilderImplementationGenerator._generate_enum_mapping):
+        (TypeBuilderImplementationGenerator._generate_open_field_names):
+        (TypeBuilderImplementationGenerator._generate_builders_for_domain):
+        (TypeBuilderImplementationGenerator._generate_runtime_cast_for_object_declaration):
+        (TypeBuilderImplementationGenerator._generate_assertion_for_object_declaration):
+        (TypeBuilderImplementationGenerator._generate_assertion_for_enum):
+        * inspector/scripts/codegen/generator.py: Added.
+        (ucfirst):
+        (Generator):
+        (Generator.__init__):
+        (Generator.model):
+        (Generator.generate_license):
+        (Generator.domains_to_generate):
+        (Generator.generate_output):
+        (Generator.output_filename):
+        (Generator.encoding_for_enum_value):
+        (Generator.assigned_enum_values):
+        (Generator.type_needs_runtime_casts):
+        (Generator.type_has_open_fields):
+        (Generator.type_needs_shape_assertions):
+        (Generator.calculate_types_requiring_shape_assertions):
+        (Generator.calculate_types_requiring_shape_assertions.gather_transitively_referenced_types):
+        (Generator._traverse_and_assign_enum_values):
+        (Generator._assign_encoding_for_enum_value):
+        (Generator.wrap_with_guard_for_domain):
+        (Generator.stylized_name_for_enum_value):
+        (Generator.stylized_name_for_enum_value.replaceCallback):
+        (Generator.keyed_get_method_for_type):
+        (Generator.keyed_set_method_for_type):
+        (Generator.type_builder_string_for_type):
+        (Generator.type_builder_string_for_type_member):
+        (Generator.type_string_for_unchecked_formal_in_parameter):
+        (Generator.type_string_for_checked_formal_event_parameter):
+        (Generator.type_string_for_type_member):
+        (Generator.type_string_for_type_with_name):
+        (Generator.type_string_for_formal_out_parameter):
+        (Generator.type_string_for_formal_async_parameter):
+        (Generator.type_string_for_stack_in_parameter):
+        (Generator.type_string_for_stack_out_parameter):
+        (Generator.assertion_method_for_type_member):
+        (Generator.assertion_method_for_type_member.assertion_method_for_type):
+        (Generator.cpp_name_for_primitive_type):
+        (Generator.js_name_for_parameter_type):
+        (Generator.should_use_wrapper_for_return_type):
+        (Generator.should_pass_by_copy_for_return_type):
+        * inspector/scripts/codegen/generator_templates.py: Added.
+        (GeneratorTemplates):
+        (void):
+        (HashMap):
+        (Builder):
+        (Inspector):
+        * inspector/scripts/codegen/models.py: Added.
+        (ucfirst):
+        (ParseException):
+        (TypecheckException):
+        (Framework):
+        (Framework.__init__):
+        (Framework.setting):
+        (Framework.fromString):
+        (Frameworks):
+        (TypeReference):
+        (TypeReference.__init__):
+        (TypeReference.referenced_name):
+        (Type):
+        (Type.__init__):
+        (Type.__eq__):
+        (Type.__hash__):
+        (Type.raw_name):
+        (Type.is_enum):
+        (Type.type_domain):
+        (Type.qualified_name):
+        (Type.resolve_type_references):
+        (PrimitiveType):
+        (PrimitiveType.__init__):
+        (PrimitiveType.__repr__):
+        (PrimitiveType.type_domain):
+        (PrimitiveType.qualified_name):
+        (AliasedType):
+        (AliasedType.__init__):
+        (AliasedType.__repr__):
+        (AliasedType.is_enum):
+        (AliasedType.type_domain):
+        (AliasedType.qualified_name):
+        (AliasedType.resolve_type_references):
+        (EnumType):
+        (EnumType.__init__):
+        (EnumType.__repr__):
+        (EnumType.is_enum):
+        (EnumType.type_domain):
+        (EnumType.enum_values):
+        (EnumType.qualified_name):
+        (EnumType.resolve_type_references):
+        (ArrayType):
+        (ArrayType.__init__):
+        (ArrayType.__repr__):
+        (ArrayType.type_domain):
+        (ArrayType.qualified_name):
+        (ArrayType.resolve_type_references):
+        (ObjectType):
+        (ObjectType.__init__):
+        (ObjectType.__repr__):
+        (ObjectType.type_domain):
+        (ObjectType.qualified_name):
+        (check_for_required_properties):
+        (Protocol):
+        (Protocol.__init__):
+        (Protocol.parse_specification):
+        (Protocol.parse_domain):
+        (Protocol.parse_type_declaration):
+        (Protocol.parse_type_member):
+        (Protocol.parse_command):
+        (Protocol.parse_event):
+        (Protocol.parse_call_or_return_parameter):
+        (Protocol.resolve_types):
+        (Protocol.lookup_type_for_declaration):
+        (Protocol.lookup_type_reference):
+        (Domain):
+        (Domain.__init__):
+        (Domain.resolve_type_references):
+        (Domains):
+        (TypeDeclaration):
+        (TypeDeclaration.__init__):
+        (TypeDeclaration.resolve_type_references):
+        (TypeMember):
+        (TypeMember.__init__):
+        (TypeMember.resolve_type_references):
+        (Parameter):
+        (Parameter.__init__):
+        (Parameter.resolve_type_references):
+        (Command):
+        (Command.__init__):
+        (Command.resolve_type_references):
+        (Event):
+        (Event.__init__):
+        (Event.resolve_type_references):
+        * inspector/scripts/generate-inspector-protocol-bindings.py: Added.
+        (IncrementalFileWriter):
+        (IncrementalFileWriter.__init__):
+        (IncrementalFileWriter.write):
+        (IncrementalFileWriter.close):
+        (generate_from_specification):
+        (generate_from_specification.load_specification):
+        * inspector/scripts/tests/commands-with-async-attribute.json: Added.
+        * inspector/scripts/tests/commands-with-optional-call-return-parameters.json: Added.
+        * inspector/scripts/tests/domains-with-varying-command-sizes.json: Added.
+        * inspector/scripts/tests/events-with-optional-parameters.json: Added.
+        * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: Added.
+        * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: Added.
+        * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: Added.
+        * inspector/scripts/tests/expected/events-with-optional-parameters.json-result: Added.
+        * inspector/scripts/tests/fail-on-duplicate-type-declarations.json-error: Added.
+        * inspector/scripts/tests/fail-on-enum-with-no-values.json-error: Added.
+        * inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json-error: Added.
+        * inspector/scripts/tests/fail-on-type-with-lowercase-name.json-error: Added.
+        * inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json-error: Added.
+        * inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json-error: Added.
+        * inspector/scripts/tests/expected/same-type-id-different-domain.json-result: Added.
+        * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: Added.
+        * inspector/scripts/tests/expected/type-declaration-array-type.json-result: Added.
+        * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: Added.
+        * inspector/scripts/tests/expected/type-declaration-object-type.json-result: Added.
+        * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: Added.
+        * inspector/scripts/tests/fail-on-duplicate-type-declarations.json: Added.
+        * inspector/scripts/tests/fail-on-enum-with-no-values.json: Added.
+        * inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json: Added.
+        * inspector/scripts/tests/fail-on-type-with-lowercase-name.json: Added.
+        * inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json: Added.
+        * inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json: Added.
+        * inspector/scripts/tests/same-type-id-different-domain.json: Added.
+        * inspector/scripts/tests/type-declaration-aliased-primitive-type.json: Added.
+        * inspector/scripts/tests/type-declaration-array-type.json: Added.
+        * inspector/scripts/tests/type-declaration-enum-type.json: Added.
+        * inspector/scripts/tests/type-declaration-object-type.json: Added.
+        * inspector/scripts/tests/type-requiring-runtime-casts.json: Added.
+
</ins><span class="cx"> 2014-08-15  Matthew Mirman  &lt;mmirman@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Made native inlining errors not segfault. 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources.make (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources.make        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/DerivedSources.make        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -122,8 +122,19 @@
</span><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> INSPECTOR_GENERATOR_SCRIPTS = \
</span><del>-        $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py \
-        $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspectorStrings.py \
</del><ins>+        $(JavaScriptCore)/inspector/scripts/codegen/__init__.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_backend_commands.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_backend_dispatcher_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_frontend_dispatcher_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_type_builder_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_type_builder_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generator_templates.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generator.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/models.py \
+        $(JavaScriptCore)/inspector/scripts/generate-combined-inspector-json.py \
+        $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py \
</ins><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> all : \
</span><span class="lines">@@ -144,7 +155,7 @@
</span><span class="cx"> 
</span><span class="cx"> # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
</span><span class="cx"> InspectorJSFrontendDispatchers.h : InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS)
</span><del>-        $(PYTHON) $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py ./InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type JavaScript
</del><ins>+        $(PYTHON) $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py --framework JavaScriptCore --outputDir . ./InspectorJS.json
</ins><span class="cx"> 
</span><span class="cx"> InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore)/inspector/scripts/jsmin.py $(JavaScriptCore)/inspector/scripts/xxd.pl
</span><span class="cx">         echo &quot;//# sourceURL=__WebInspectorInjectedScript__&quot; &gt; ./InjectedScriptSource.min.js
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1614,6 +1614,61 @@
</span><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;None Include=&quot;..\bytecode\BytecodeList.json&quot; /&gt;
</span><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_commands.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_type_builder_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_type_builder_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generator.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generator_templates.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\models.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\__init__.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\cssmin.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\generate-combined-inspector-json.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\generate-inspector-protocol-bindings.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\inline-and-minify-stylesheets-and-scripts.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\jsmin.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\commands-with-async-attribute.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\commands-with-optional-call-return-parameters.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\domains-with-varying-command-sizes.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\events-with-optional-parameters.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\commands-with-async-attribute.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\commands-with-optional-call-return-parameters.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\domains-with-varying-command-sizes.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\events-with-optional-parameters.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-duplicate-type-declarations.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-enum-with-no-values.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-string-typed-optional-parameter-flag.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-string-typed-optional-type-member.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-type-declaration-using-type-reference.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-type-with-lowercase-name.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-unknown-type-reference-in-type-declaration.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-unknown-type-reference-in-type-member.json-error&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\same-type-id-different-domain.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\shadowed-optional-type-setters.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-aliased-primitive-type.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-array-type.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-enum-type.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-object-type.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-requiring-runtime-casts.json-result&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-duplicate-type-declarations.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-enum-with-no-values.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-string-typed-optional-parameter-flag.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-string-typed-optional-type-member.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-type-declaration-using-type-reference.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-type-with-lowercase-name.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-unknown-type-reference-in-type-declaration.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-unknown-type-reference-in-type-member.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\same-type-id-different-domain.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\shadowed-optional-type-setters.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-aliased-primitive-type.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-array-type.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-enum-type.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-object-type.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-requiring-runtime-casts.json&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\xxd.pl&quot; /&gt;
</ins><span class="cx">     &lt;None Include=&quot;JavaScriptCorePostBuild.cmd&quot;&gt;
</span><span class="cx">       &lt;FileType&gt;Document&lt;/FileType&gt;
</span><span class="cx">     &lt;/None&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -67,6 +67,18 @@
</span><span class="cx">     &lt;Filter Include=&quot;llvm&quot;&gt;
</span><span class="cx">       &lt;UniqueIdentifier&gt;{852e9415-245c-4012-aeb8-38ca9efb73b8}&lt;/UniqueIdentifier&gt;
</span><span class="cx">     &lt;/Filter&gt;
</span><ins>+    &lt;Filter Include=&quot;inspector\scripts&quot;&gt;
+      &lt;UniqueIdentifier&gt;{a29d27c0-2c34-482b-87cc-21e7ef290c88}&lt;/UniqueIdentifier&gt;
+    &lt;/Filter&gt;
+    &lt;Filter Include=&quot;inspector\scripts\codegen&quot;&gt;
+      &lt;UniqueIdentifier&gt;{17e304e8-c0e8-4b18-88fa-62b86eba9959}&lt;/UniqueIdentifier&gt;
+    &lt;/Filter&gt;
+    &lt;Filter Include=&quot;inspector\scripts\tests&quot;&gt;
+      &lt;UniqueIdentifier&gt;{0a034c97-3947-47c4-8085-2ddc8aa1ade0}&lt;/UniqueIdentifier&gt;
+    &lt;/Filter&gt;
+    &lt;Filter Include=&quot;inspector\scripts\tests\expected&quot;&gt;
+      &lt;UniqueIdentifier&gt;{6be9d367-0091-4ebb-b96c-4ef83790362b}&lt;/UniqueIdentifier&gt;
+    &lt;/Filter&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\API\JSBase.cpp&quot;&gt;
</span><span class="lines">@@ -4041,6 +4053,171 @@
</span><span class="cx">     &lt;None Include=&quot;..\bytecode\BytecodeList.json&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;bytecode&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><ins>+    &lt;None Include=&quot;..\inspector\scripts\cssmin.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\generate-combined-inspector-json.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\generate-inspector-protocol-bindings.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\inline-and-minify-stylesheets-and-scripts.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\jsmin.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\xxd.pl&quot;&gt;
+      &lt;Filter&gt;inspector\scripts&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\__init__.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_commands.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_header.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_implementation.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_header.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_implementation.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_type_builder_header.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_type_builder_implementation.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generator.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generator_templates.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\models.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\commands-with-async-attribute.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\commands-with-optional-call-return-parameters.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\domains-with-varying-command-sizes.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\events-with-optional-parameters.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-duplicate-type-declarations.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-enum-with-no-values.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-string-typed-optional-parameter-flag.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-string-typed-optional-type-member.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-type-declaration-using-type-reference.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-type-with-lowercase-name.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-unknown-type-reference-in-type-declaration.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\fail-on-unknown-type-reference-in-type-member.json-error&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\same-type-id-different-domain.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\shadowed-optional-type-setters.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-aliased-primitive-type.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-array-type.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-enum-type.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-declaration-object-type.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\expected\type-requiring-runtime-casts.json-result&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests\expected&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\commands-with-async-attribute.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\commands-with-optional-call-return-parameters.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\domains-with-varying-command-sizes.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\events-with-optional-parameters.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-duplicate-type-declarations.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-enum-with-no-values.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-string-typed-optional-parameter-flag.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-string-typed-optional-type-member.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-type-declaration-using-type-reference.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-type-with-lowercase-name.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-unknown-type-reference-in-type-declaration.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\fail-on-unknown-type-reference-in-type-member.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\same-type-id-different-domain.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\shadowed-optional-type-setters.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-aliased-primitive-type.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-array-type.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-enum-type.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-declaration-object-type.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\tests\type-requiring-runtime-casts.json&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\tests&lt;/Filter&gt;
+    &lt;/None&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;MASM Include=&quot;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\LowLevelInterpreterWin.asm&quot;&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojcopyfilescmd"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> echo Copying Inspector scripts as if they were private headers...
</span><span class="cx"> for %%d in (
</span><span class="cx">     inspector\scripts
</span><ins>+        inspector\scripts\codegen
</ins><span class="cx"> ) do (
</span><span class="cx">     xcopy /y /d ..\%%d\* &quot;%PrivateHeadersDirectory%&quot; &gt;NUL
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1635,8 +1635,6 @@
</span><span class="cx">                 A532438A18568335002ED692 /* InspectorJSFrontendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438418568317002ED692 /* InspectorJSFrontendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A532438B18568335002ED692 /* InspectorJSTypeBuilders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438518568317002ED692 /* InspectorJSTypeBuilders.cpp */; };
</span><span class="cx">                 A532438C18568335002ED692 /* InspectorJSTypeBuilders.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438618568317002ED692 /* InspectorJSTypeBuilders.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */ = {isa = PBXBuildFile; fileRef = A532438F185696E6002ED692 /* CodeGeneratorInspector.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324391185696E6002ED692 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A53243981856A489002ED692 /* InspectorJS.json in Headers */ = {isa = PBXBuildFile; fileRef = A53243951856A475002ED692 /* InspectorJS.json */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A53CE08518BC1A5600BEDF76 /* ConsolePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A53CE08118BC1A5600BEDF76 /* ConsolePrototype.cpp */; };
</span><span class="lines">@@ -2062,6 +2060,17 @@
</span><span class="cx">                 C2FCAE1217A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */; };
</span><span class="cx">                 C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FE18A316BAEC4000AF3061 /* StructureRareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CBF192844960013FBEA /* generate-inspector-protocol-bindings.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CCE192844CC0013FBEA /* generate_backend_commands.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC3192844CC0013FBEA /* generate_backend_commands.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CCF192844CC0013FBEA /* generate_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC4192844CC0013FBEA /* generate_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD0192844CC0013FBEA /* generate_backend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC5192844CC0013FBEA /* generate_backend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD1192844CC0013FBEA /* generate_frontend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC6192844CC0013FBEA /* generate_frontend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD2192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC7192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD3192844CC0013FBEA /* generate_type_builder_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC8192844CC0013FBEA /* generate_type_builder_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD4192844CC0013FBEA /* generate_type_builder_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC9192844CC0013FBEA /* generate_type_builder_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD5192844CC0013FBEA /* generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCA192844CC0013FBEA /* generator_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD6192844CC0013FBEA /* generator.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCB192844CC0013FBEA /* generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                C4703CD7192844CC0013FBEA /* models.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCC192844CC0013FBEA /* models.py */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; };
</span><span class="cx">                 E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E3A570DF9278C00D90B34 /* VM.cpp */; };
</span><span class="lines">@@ -3312,8 +3321,6 @@
</span><span class="cx">                 A532438518568317002ED692 /* InspectorJSTypeBuilders.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSTypeBuilders.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A532438618568317002ED692 /* InspectorJSTypeBuilders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorJSTypeBuilders.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A532438D185696CA002ED692 /* protocol */ = {isa = PBXFileReference; lastKnownFileType = folder; path = protocol; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A532438F185696E6002ED692 /* CodeGeneratorInspector.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CodeGeneratorInspector.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CodeGeneratorInspectorStrings.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 A5324391185696E6002ED692 /* generate-combined-inspector-json.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = &quot;generate-combined-inspector-json.py&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A53243951856A475002ED692 /* InspectorJS.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = InspectorJS.json; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A53243961856A475002ED692 /* InspectorJSBackendCommands.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InspectorJSBackendCommands.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3729,6 +3736,18 @@
</span><span class="cx">                 C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeLivenessAnalysis.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeLivenessAnalysis.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C2FE18A316BAEC4000AF3061 /* StructureRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureRareData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                C4703CBF192844960013FBEA /* generate-inspector-protocol-bindings.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = &quot;generate-inspector-protocol-bindings.py&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC2192844CC0013FBEA /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = __init__.py; path = __init__.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC3192844CC0013FBEA /* generate_backend_commands.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_backend_commands.py; path = generate_backend_commands.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC4192844CC0013FBEA /* generate_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_backend_dispatcher_header.py; path = generate_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC5192844CC0013FBEA /* generate_backend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_backend_dispatcher_implementation.py; path = generate_backend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC6192844CC0013FBEA /* generate_frontend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_frontend_dispatcher_header.py; path = generate_frontend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC7192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_frontend_dispatcher_implementation.py; path = generate_frontend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC8192844CC0013FBEA /* generate_type_builder_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_type_builder_header.py; path = generate_type_builder_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CC9192844CC0013FBEA /* generate_type_builder_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate_type_builder_implementation.py; path = generate_type_builder_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CCA192844CC0013FBEA /* generator_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generator_templates.py; path = generator_templates.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CCB192844CC0013FBEA /* generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generator.py; path = generator.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4703CCC192844CC0013FBEA /* models.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = models.py; path = models.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 D21202280AD4310C00ED79B6 /* DateConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DateConversion.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D21202290AD4310C00ED79B6 /* DateConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DateConversion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E124A8F50E555775003091F1 /* OpaqueJSString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueJSString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5578,10 +5597,10 @@
</span><span class="cx">                 A532438E185696CE002ED692 /* scripts */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                A532438F185696E6002ED692 /* CodeGeneratorInspector.py */,
-                                A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */,
</del><ins>+                                C4703CC1192844A40013FBEA /* codegen */,
</ins><span class="cx">                                 A5840E26187C980700843B10 /* cssmin.py */,
</span><span class="cx">                                 A5324391185696E6002ED692 /* generate-combined-inspector-json.py */,
</span><ins>+                                C4703CBF192844960013FBEA /* generate-inspector-protocol-bindings.py */,
</ins><span class="cx">                                 A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */,
</span><span class="cx">                                 A513E5C4185F92DC007E95AD /* jsmin.py */,
</span><span class="cx">                                 A513E5C5185F92F0007E95AD /* xxd.pl */,
</span><span class="lines">@@ -5699,6 +5718,24 @@
</span><span class="cx">                         path = builtins;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                C4703CC1192844A40013FBEA /* codegen */ = {
+                        isa = PBXGroup;
+                        children = (
+                                C4703CC2192844CC0013FBEA /* __init__.py */,
+                                C4703CC3192844CC0013FBEA /* generate_backend_commands.py */,
+                                C4703CC4192844CC0013FBEA /* generate_backend_dispatcher_header.py */,
+                                C4703CC5192844CC0013FBEA /* generate_backend_dispatcher_implementation.py */,
+                                C4703CC6192844CC0013FBEA /* generate_frontend_dispatcher_header.py */,
+                                C4703CC7192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py */,
+                                C4703CC8192844CC0013FBEA /* generate_type_builder_header.py */,
+                                C4703CC9192844CC0013FBEA /* generate_type_builder_implementation.py */,
+                                C4703CCA192844CC0013FBEA /* generator_templates.py */,
+                                C4703CCB192844CC0013FBEA /* generator.py */,
+                                C4703CCC192844CC0013FBEA /* models.py */,
+                        );
+                        path = codegen;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx"> /* End PBXGroup section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXHeadersBuildPhase section */
</span><span class="lines">@@ -5987,6 +6024,19 @@
</span><span class="cx">                                 2AABCDE718EF294200002096 /* GCLogging.h in Headers */,
</span><span class="cx">                                 FE5248F9191442D900B7FDE4 /* VariableWatchpointSetInlines.h in Headers */,
</span><span class="cx">                                 C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */,
</span><ins>+                                A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
+                                A5840E27187C981E00843B10 /* cssmin.py in Headers */,
+                                C4703CD3192844CC0013FBEA /* generate_type_builder_header.py in Headers */,
+                                C4703CD2192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py in Headers */,
+                                C4703CD1192844CC0013FBEA /* generate_frontend_dispatcher_header.py in Headers */,
+                                C4703CD5192844CC0013FBEA /* generator_templates.py in Headers */,
+                                C4703CD6192844CC0013FBEA /* generator.py in Headers */,
+                                C4703CCF192844CC0013FBEA /* generate_backend_dispatcher_header.py in Headers */,
+                                C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */,
+                                C4703CD0192844CC0013FBEA /* generate_backend_dispatcher_implementation.py in Headers */,
+                                C4703CCE192844CC0013FBEA /* generate_backend_commands.py in Headers */,
+                                C4703CD4192844CC0013FBEA /* generate_type_builder_implementation.py in Headers */,
+                                C4703CD7192844CC0013FBEA /* models.py in Headers */,
</ins><span class="cx">                                 2AACE63D18CA5A0300ED0191 /* GCActivityCallback.h in Headers */,
</span><span class="cx">                                 2A83638618D7D0EE0000EBCC /* EdenGCActivityCallback.h in Headers */,
</span><span class="cx">                                 2A83638A18D7D0FE0000EBCC /* FullGCActivityCallback.h in Headers */,
</span><span class="lines">@@ -6046,8 +6096,6 @@
</span><span class="cx">                                 0FD8A31417D4326C00CA2C40 /* CodeBlockSet.h in Headers */,
</span><span class="cx">                                 0F96EBB316676EF6008BADE3 /* CodeBlockWithJITType.h in Headers */,
</span><span class="cx">                                 A77F1822164088B200640A47 /* CodeCache.h in Headers */,
</span><del>-                                A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
-                                A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
</del><span class="cx">                                 86E116B10FE75AC800B512BC /* CodeLocation.h in Headers */,
</span><span class="cx">                                 0FBD7E691447999600481315 /* CodeOrigin.h in Headers */,
</span><span class="cx">                                 0F21C27D14BE727A00ADC64B /* CodeSpecializationKind.h in Headers */,
</span><span class="lines">@@ -6078,7 +6126,6 @@
</span><span class="cx">                                 C218D1401655CFD50062BB81 /* CopyWorkList.h in Headers */,
</span><span class="cx">                                 2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
</span><span class="cx">                                 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
</span><del>-                                A5840E27187C981E00843B10 /* cssmin.py in Headers */,
</del><span class="cx">                                 0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
</span><span class="cx">                                 0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
</span><span class="cx">                                 BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
</span><span class="lines">@@ -6319,7 +6366,6 @@
</span><span class="cx">                                 0F2B66AF17B6B54500A7AE3F /* GCIncomingRefCountedSetInlines.h in Headers */,
</span><span class="cx">                                 C2239D1B16262BDD005AC5FD /* GCThread.h in Headers */,
</span><span class="cx">                                 C21122E215DD9AB300790E3A /* GCThreadSharedData.h in Headers */,
</span><del>-                                A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
</del><span class="cx">                                 0F2B66E017B6B5AB00A7AE3F /* GenericTypedArrayView.h in Headers */,
</span><span class="cx">                                 0F1FE51C1922A3BC006987C5 /* AbortReason.h in Headers */,
</span><span class="cx">                                 0F2B66E117B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorConsoleMessagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Console::ConsoleMessage::Source::Enum messageSourceValue(MessageSource source)
</del><ins>+static Inspector::TypeBuilder::Console::ConsoleMessage::Source messageSourceValue(MessageSource source)
</ins><span class="cx"> {
</span><span class="cx">     switch (source) {
</span><span class="cx">     case MessageSource::XML: return Inspector::TypeBuilder::Console::ConsoleMessage::Source::XML;
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     return Inspector::TypeBuilder::Console::ConsoleMessage::Source::Other;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Console::ConsoleMessage::Type::Enum messageTypeValue(MessageType type)
</del><ins>+static Inspector::TypeBuilder::Console::ConsoleMessage::Type messageTypeValue(MessageType type)
</ins><span class="cx"> {
</span><span class="cx">     switch (type) {
</span><span class="cx">     case MessageType::Log: return Inspector::TypeBuilder::Console::ConsoleMessage::Type::Log;
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">     return Inspector::TypeBuilder::Console::ConsoleMessage::Type::Log;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Console::ConsoleMessage::Level::Enum messageLevelValue(MessageLevel level)
</del><ins>+static Inspector::TypeBuilder::Console::ConsoleMessage::Level messageLevelValue(MessageLevel level)
</ins><span class="cx"> {
</span><span class="cx">     switch (level) {
</span><span class="cx">     case MessageLevel::Log: return Inspector::TypeBuilder::Console::ConsoleMessage::Level::Log;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -100,13 +100,13 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorValue&gt; resultValue;
</span><span class="cx">     makeCall(function, &amp;resultValue);
</span><del>-    if (!resultValue || resultValue-&gt;type() != InspectorValue::TypeObject) {
</del><ins>+    if (!resultValue || resultValue-&gt;type() != InspectorValue::Type::Object) {
</ins><span class="cx">         if (!resultValue-&gt;asString(errorString))
</span><span class="cx">             *errorString = ASCIILiteral(&quot;Internal error&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    *result = Inspector::TypeBuilder::Debugger::FunctionDetails::runtimeCast(resultValue);
</del><ins>+    *result = BindingTraits&lt;Inspector::TypeBuilder::Debugger::FunctionDetails&gt;::runtimeCast(resultValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedScript::getProperties(ErrorString* errorString, const String&amp; objectId, bool ownProperties, RefPtr&lt;Array&lt;Inspector::TypeBuilder::Runtime::PropertyDescriptor&gt;&gt;* properties)
</span><span class="lines">@@ -117,12 +117,12 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorValue&gt; result;
</span><span class="cx">     makeCall(function, &amp;result);
</span><del>-    if (!result || result-&gt;type() != InspectorValue::TypeArray) {
</del><ins>+    if (!result || result-&gt;type() != InspectorValue::Type::Array) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Internal error&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    *properties = Array&lt;Inspector::TypeBuilder::Runtime::PropertyDescriptor&gt;::runtimeCast(result);
</del><ins>+    *properties = BindingTraits&lt;Array&lt;Inspector::TypeBuilder::Runtime::PropertyDescriptor&gt;&gt;::runtimeCast(result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedScript::getInternalProperties(ErrorString* errorString, const String&amp; objectId, RefPtr&lt;Array&lt;Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor&gt;&gt;* properties)
</span><span class="lines">@@ -132,12 +132,12 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorValue&gt; result;
</span><span class="cx">     makeCall(function, &amp;result);
</span><del>-    if (!result || result-&gt;type() != InspectorValue::TypeArray) {
</del><ins>+    if (!result || result-&gt;type() != InspectorValue::Type::Array) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Internal error&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Array&lt;Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor&gt;&gt; array = Array&lt;Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor&gt;::runtimeCast(result);
</del><ins>+    auto array = BindingTraits&lt;Array&lt;Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor&gt;&gt;::runtimeCast(result);
</ins><span class="cx">     if (array-&gt;length() &gt; 0)
</span><span class="cx">         *properties = array;
</span><span class="cx"> }
</span><span class="lines">@@ -152,8 +152,8 @@
</span><span class="cx">     Deprecated::ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadException);
</span><span class="cx">     ASSERT(!hadException);
</span><span class="cx">     RefPtr&lt;InspectorValue&gt; result = callFramesValue.toInspectorValue(scriptState());
</span><del>-    if (result-&gt;type() == InspectorValue::TypeArray)
-        return Array&lt;Inspector::TypeBuilder::Debugger::CallFrame&gt;::runtimeCast(result);
</del><ins>+    if (result-&gt;type() == InspectorValue::Type::Array)
+        return BindingTraits&lt;Array&lt;Inspector::TypeBuilder::Debugger::CallFrame&gt;&gt;::runtimeCast(result);
</ins><span class="cx"> 
</span><span class="cx">     return Array&lt;Inspector::TypeBuilder::Debugger::CallFrame&gt;::create();
</span><span class="cx"> }
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorObject&gt; rawResult = r.toInspectorValue(scriptState())-&gt;asObject();
</span><del>-    return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult);
</del><ins>+    return BindingTraits&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt;::runtimeCast(rawResult);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt; InjectedScript::wrapTable(const Deprecated::ScriptValue&amp; table, const Deprecated::ScriptValue&amp; columns) const
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;InspectorObject&gt; rawResult = r.toInspectorValue(scriptState())-&gt;asObject();
</span><del>-    return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult);
</del><ins>+    return BindingTraits&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt;::runtimeCast(rawResult);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Deprecated::ScriptValue InjectedScript::findObjectById(const String&amp; objectId) const
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (result-&gt;type() == InspectorValue::TypeString) {
</del><ins>+    if (result-&gt;type() == InspectorValue::Type::String) {
</ins><span class="cx">         result-&gt;asString(errorString);
</span><span class="cx">         ASSERT(errorString-&gt;length());
</span><span class="cx">         return;
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj);
</del><ins>+    *objectResult = BindingTraits&lt;TypeBuilder::Runtime::RemoteObject&gt;::runtimeCast(resultObj);
</ins><span class="cx">     *wasThrown = wasThrownVal;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String&amp; objectId)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InspectorValue&gt; parsedObjectId = InspectorValue::parseJSON(objectId);
</span><del>-    if (parsedObjectId &amp;&amp; parsedObjectId-&gt;type() == InspectorValue::TypeObject) {
</del><ins>+    if (parsedObjectId &amp;&amp; parsedObjectId-&gt;type() == InspectorValue::Type::Object) {
</ins><span class="cx">         long injectedScriptId = 0;
</span><span class="cx">         bool success = parsedObjectId-&gt;asObject()-&gt;getNumber(ASCIILiteral(&quot;injectedScriptId&quot;), &amp;injectedScriptId);
</span><span class="cx">         if (success)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInspectorTypeBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InspectorTypeBuilder.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InspectorTypeBuilder.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InspectorTypeBuilder.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -63,54 +63,6 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(OptOutput);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-
-// A small transient wrapper around int type, that can be used as a funciton parameter type
-// cleverly disallowing C++ implicit casts from float or double.
-class ExactlyInt {
-public:
-    template&lt;typename T&gt;
-    ExactlyInt(T t) : m_value(cast_to_int&lt;T&gt;(t)) { }
-    ExactlyInt() { }
-
-    operator int() { return m_value; }
-
-private:
-    int m_value;
-
-    template&lt;typename T&gt;
-    static int cast_to_int(T) { return T::default_case_cast_is_not_supported(); }
-};
-
-template&lt;&gt;
-inline int ExactlyInt::cast_to_int&lt;int&gt;(int i) { return i; }
-
-template&lt;&gt;
-inline int ExactlyInt::cast_to_int&lt;unsigned int&gt;(unsigned int i) { return i; }
-
-#if !ASSERT_DISABLED
-class RuntimeCastHelper {
-public:
-    template&lt;InspectorValue::Type TYPE&gt;
-    static void assertType(InspectorValue* value)
-    {
-        ASSERT(value-&gt;type() == TYPE);
-    }
-
-    static void assertAny(InspectorValue*)
-    {
-    }
-
-    static void assertInt(InspectorValue* value)
-    {
-        double v;
-        bool castRes = value-&gt;asNumber(&amp;v);
-        ASSERT_UNUSED(castRes, castRes);
-        ASSERT(static_cast&lt;double&gt;(static_cast&lt;int&gt;(v)) == v);
-    }
-};
-#endif
-
-
</del><span class="cx"> // This class provides &quot;Traits&quot; type for the input type T. It is programmed using C++ template specialization
</span><span class="cx"> // technique. By default it simply takes &quot;ItemTraits&quot; type from T, but it doesn't work with the base types.
</span><span class="cx"> template&lt;typename T&gt;
</span><span class="lines">@@ -144,29 +96,6 @@
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(new Array&lt;T&gt;());
</span><span class="cx">     }
</span><del>-
-    static PassRefPtr&lt;Array&lt;T&gt;&gt; runtimeCast(PassRefPtr&lt;InspectorValue&gt; value)
-    {
-        RefPtr&lt;InspectorArray&gt; array;
-        bool castRes = value-&gt;asArray(&amp;array);
-        ASSERT_UNUSED(castRes, castRes);
-#if !ASSERT_DISABLED
-        assertCorrectValue(array.get());
-#endif // !ASSERT_DISABLED
-        COMPILE_ASSERT(sizeof(Array&lt;T&gt;) == sizeof(InspectorArray), type_cast_problem);
-        return static_cast&lt;Array&lt;T&gt;*&gt;(static_cast&lt;InspectorArrayBase*&gt;(array.get()));
-    }
-
-#if !ASSERT_DISABLED
-    static void assertCorrectValue(InspectorValue* value)
-    {
-        RefPtr&lt;InspectorArray&gt; array;
-        bool castRes = value-&gt;asArray(&amp;array);
-        ASSERT_UNUSED(castRes, castRes);
-        for (unsigned i = 0; i &lt; array-&gt;length(); i++)
-            ArrayItemHelper&lt;T&gt;::Traits::template assertCorrectValue&lt;T&gt;(array-&gt;get(i).get());
-    }
-#endif // !ASSERT_DISABLED
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct StructItemTraits {
</span><span class="lines">@@ -174,14 +103,6 @@
</span><span class="cx">     {
</span><span class="cx">         array-&gt;pushValue(value);
</span><span class="cx">     }
</span><del>-
-#if !ASSERT_DISABLED
-    template&lt;typename T&gt;
-    static void assertCorrectValue(InspectorValue* value)
-    {
-        T::assertCorrectValue(value);
-    }
-#endif // !ASSERT_DISABLED
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><span class="lines">@@ -191,14 +112,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushString(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertType&lt;InspectorValue::TypeString&gt;(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -209,14 +122,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushInt(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertInt(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -227,14 +132,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushNumber(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertType&lt;InspectorValue::TypeNumber&gt;(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -245,14 +142,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushBoolean(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertType&lt;InspectorValue::TypeBoolean&gt;(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -263,14 +152,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushValue(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertAny(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -281,14 +162,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushValue(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertType&lt;InspectorValue::TypeObject&gt;(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -299,14 +172,6 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushArray(value);
</span><span class="cx">         }
</span><del>-
-#if !ASSERT_DISABLED
-        template&lt;typename T&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            RuntimeCastHelper::assertType&lt;InspectorValue::TypeArray&gt;(value);
-        }
-#endif // !ASSERT_DISABLED
</del><span class="cx">     };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -317,19 +182,92 @@
</span><span class="cx">         {
</span><span class="cx">             array-&gt;pushValue(value);
</span><span class="cx">         }
</span><ins>+    };
+};
</ins><span class="cx"> 
</span><ins>+// Helper methods for TypeBuilder and other Inspector types are provided by
+// specializations of BindingTraits&lt;T&gt;. Some are generated for protocol types.
+
+template&lt;typename T&gt;
+struct BindingTraits {
+    typedef T BindingType;
+
+    static InspectorValue::Type typeTag();
+    static PassRefPtr&lt;T&gt; runtimeCast(PassRefPtr&lt;InspectorObject&gt;);
</ins><span class="cx"> #if !ASSERT_DISABLED
</span><del>-        template&lt;typename S&gt;
-        static void assertCorrectValue(InspectorValue* value)
-        {
-            S::assertCorrectValue(value);
-        }
</del><ins>+    static void assertValueHasExpectedType(InspectorValue*);
</ins><span class="cx"> #endif // !ASSERT_DISABLED
</span><del>-    };
</del><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;InspectorValue::Type TYPE&gt;
+struct PrimitiveBindingTraits {
+#if !ASSERT_DISABLED
+    static void assertValueHasExpectedType(InspectorValue* value)
+    {
+        ASSERT(value-&gt;type() == TYPE);
+    }
+#endif // !ASSERT_DISABLED
+};
+
+template&lt;typename T&gt;
+struct BindingTraits&lt;TypeBuilder::Array&lt;T&gt;&gt; {
+    static PassRefPtr&lt;Array&lt;T&gt;&gt; runtimeCast(PassRefPtr&lt;InspectorValue&gt; value)
+    {
+        RefPtr&lt;InspectorArray&gt; array;
+        bool castRes = value-&gt;asArray(&amp;array);
+        ASSERT_UNUSED(castRes, castRes);
+#if !ASSERT_DISABLED
+        assertValueHasExpectedType(array.get());
+#endif // !ASSERT_DISABLED
+        COMPILE_ASSERT(sizeof(Array&lt;T&gt;) == sizeof(InspectorArray), type_cast_problem);
+        return static_cast&lt;Array&lt;T&gt;*&gt;(static_cast&lt;InspectorArrayBase*&gt;(array.get()));
+    }
+
+#if !ASSERT_DISABLED
+    static void assertValueHasExpectedType(InspectorValue* value)
+    {
+        RefPtr&lt;InspectorArray&gt; array;
+        bool castRes = value-&gt;asArray(&amp;array);
+        ASSERT_UNUSED(castRes, castRes);
+        for (unsigned i = 0; i &lt; array-&gt;length(); i++)
+            BindingTraits&lt;T&gt;::assertValueHasExpectedType(array-&gt;get(i).get());
+    }
+#endif // !ASSERT_DISABLED
+};
+
+template&lt;&gt;
+struct BindingTraits&lt;InspectorValue&gt; {
+#if !ASSERT_DISABLED
+    static void assertValueHasExpectedType(InspectorValue*)
+    {
+    }
+#endif // !ASSERT_DISABLED
+};
+
+template&lt;&gt; struct BindingTraits&lt;InspectorArray&gt; : public PrimitiveBindingTraits&lt;InspectorValue::Type::Array&gt; { };
+template&lt;&gt; struct BindingTraits&lt;InspectorObject&gt; : public PrimitiveBindingTraits&lt;InspectorValue::Type::Object&gt; { };
+template&lt;&gt; struct BindingTraits&lt;String&gt; : public PrimitiveBindingTraits&lt;InspectorValue::Type::String&gt; { };
+template&lt;&gt; struct BindingTraits&lt;bool&gt; : public PrimitiveBindingTraits&lt;InspectorValue::Type::Boolean&gt; { };
+template&lt;&gt; struct BindingTraits&lt;double&gt; : public PrimitiveBindingTraits&lt;InspectorValue::Type::Number&gt; { };
+
+// FIXME: Add an Inspector::Type tag for int so we can remove this special case.
+template&lt;&gt;
+struct BindingTraits&lt;int&gt; {
+#if !ASSERT_DISABLED
+    static void assertValueHasExpectedType(InspectorValue* value)
+    {
+        double v;
+        bool castRes = value-&gt;asNumber(&amp;v);
+        ASSERT_UNUSED(castRes, castRes);
+        ASSERT(static_cast&lt;double&gt;(static_cast&lt;int&gt;(v)) == v);
+    }
+#endif // !ASSERT_DISABLED
+};
+
</ins><span class="cx"> } // namespace TypeBuilder
</span><span class="cx"> 
</span><ins>+using TypeBuilder::BindingTraits;
+
</ins><span class="cx"> } // namespace Inspector
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInspectorValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InspectorValues.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -579,13 +579,13 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorValue::writeJSON(StringBuilder* output) const
</span><span class="cx"> {
</span><del>-    ASSERT(m_type == TypeNull);
</del><ins>+    ASSERT(m_type == Type::Null);
</ins><span class="cx">     output-&gt;append(nullString, 4);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asBoolean(bool* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeBoolean)
</del><ins>+    if (type() != Type::Boolean)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = m_boolValue;
</span><span class="cx">     return true;
</span><span class="lines">@@ -593,7 +593,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(double* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = m_doubleValue;
</span><span class="cx">     return true;
</span><span class="lines">@@ -601,7 +601,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(float* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;float&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -609,7 +609,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(int* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;int&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -617,7 +617,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(unsigned* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;unsigned&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -625,7 +625,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(long* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;long&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(long long* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;long long&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(unsigned long* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;unsigned long&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -649,7 +649,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InspectorBasicValue::asNumber(unsigned long long* output) const
</span><span class="cx"> {
</span><del>-    if (type() != TypeNumber)
</del><ins>+    if (type() != Type::Number)
</ins><span class="cx">         return false;
</span><span class="cx">     *output = static_cast&lt;unsigned long long&gt;(m_doubleValue);
</span><span class="cx">     return true;
</span><span class="lines">@@ -657,13 +657,13 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorBasicValue::writeJSON(StringBuilder* output) const
</span><span class="cx"> {
</span><del>-    ASSERT(type() == TypeBoolean || type() == TypeNumber);
-    if (type() == TypeBoolean) {
</del><ins>+    ASSERT(type() == Type::Boolean || type() == Type::Number);
+    if (type() == Type::Boolean) {
</ins><span class="cx">         if (m_boolValue)
</span><span class="cx">             output-&gt;append(trueString, 4);
</span><span class="cx">         else
</span><span class="cx">             output-&gt;append(falseString, 5);
</span><del>-    } else if (type() == TypeNumber) {
</del><ins>+    } else if (type() == Type::Number) {
</ins><span class="cx">         NumberToLStringBuffer buffer;
</span><span class="cx">         if (!std::isfinite(m_doubleValue)) {
</span><span class="cx">             output-&gt;append(nullString, 4);
</span><span class="lines">@@ -693,7 +693,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorString::writeJSON(StringBuilder* output) const
</span><span class="cx"> {
</span><del>-    ASSERT(type() == TypeString);
</del><ins>+    ASSERT(type() == Type::String);
</ins><span class="cx">     doubleQuoteString(m_stringValue, output);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -786,7 +786,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorObjectBase::InspectorObjectBase()
</span><del>-    : InspectorValue(TypeObject)
</del><ins>+    : InspectorValue(Type::Object)
</ins><span class="cx">     , m_data()
</span><span class="cx">     , m_order()
</span><span class="cx"> {
</span><span class="lines">@@ -821,7 +821,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InspectorArrayBase::InspectorArrayBase()
</span><del>-    : InspectorValue(TypeArray)
</del><ins>+    : InspectorValue(Type::Array)
</ins><span class="cx">     , m_data()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInspectorValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InspectorValues.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InspectorValues.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/InspectorValues.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -41,29 +41,32 @@
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><span class="cx"> class InspectorArray;
</span><ins>+class InspectorArrayBase;
</ins><span class="cx"> class InspectorObject;
</span><ins>+class InspectorObjectBase;
</ins><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE InspectorValue : public RefCounted&lt;InspectorValue&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static const int maxDepth = 1000;
</span><span class="cx"> 
</span><del>-    InspectorValue() : m_type(TypeNull) { }
</del><ins>+    InspectorValue()
+        : m_type(Type::Null) { }
</ins><span class="cx">     virtual ~InspectorValue() { }
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;InspectorValue&gt; null();
</span><span class="cx"> 
</span><del>-    typedef enum {
-        TypeNull = 0,
-        TypeBoolean,
-        TypeNumber,
-        TypeString,
-        TypeObject,
-        TypeArray
-    } Type;
</del><ins>+    enum class Type {
+        Null = 0,
+        Boolean,
+        Number,
+        String,
+        Object,
+        Array
+    };
</ins><span class="cx"> 
</span><span class="cx">     Type type() const { return m_type; }
</span><span class="cx"> 
</span><del>-    bool isNull() const { return m_type == TypeNull; }
</del><ins>+    bool isNull() const { return m_type == Type::Null; }
</ins><span class="cx"> 
</span><span class="cx">     virtual bool asBoolean(bool* output) const;
</span><span class="cx">     virtual bool asNumber(double* output) const;
</span><span class="lines">@@ -113,10 +116,18 @@
</span><span class="cx">     virtual void writeJSON(StringBuilder* output) const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit InspectorBasicValue(bool value) : InspectorValue(TypeBoolean), m_boolValue(value) { }
-    explicit InspectorBasicValue(int value) : InspectorValue(TypeNumber), m_doubleValue((double)value) { }
-    explicit InspectorBasicValue(double value) : InspectorValue(TypeNumber), m_doubleValue(value) { }
</del><ins>+    explicit InspectorBasicValue(bool value)
+        : InspectorValue(Type::Boolean)
+        , m_boolValue(value) { }
</ins><span class="cx"> 
</span><ins>+    explicit InspectorBasicValue(int value)
+        : InspectorValue(Type::Number)
+        , m_doubleValue(static_cast&lt;double&gt;(value)) { }
+
+    explicit InspectorBasicValue(double value)
+        : InspectorValue(Type::Number)
+        , m_doubleValue(value) { }
+
</ins><span class="cx">     union {
</span><span class="cx">         bool m_boolValue;
</span><span class="cx">         double m_doubleValue;
</span><span class="lines">@@ -133,9 +144,14 @@
</span><span class="cx">     virtual void writeJSON(StringBuilder* output) const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit InspectorString(const String&amp; value) : InspectorValue(TypeString), m_stringValue(value) { }
-    explicit InspectorString(const char* value) : InspectorValue(TypeString), m_stringValue(value) { }
</del><ins>+    explicit InspectorString(const String&amp; value)
+        : InspectorValue(Type::String)
+        , m_stringValue(value) { }
</ins><span class="cx"> 
</span><ins>+    explicit InspectorString(const char* value)
+        : InspectorValue(Type::String)
+        , m_stringValue(value) { }
+
</ins><span class="cx">     String m_stringValue;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -159,8 +175,8 @@
</span><span class="cx">     void setNumber(const String&amp; name, double);
</span><span class="cx">     void setString(const String&amp; name, const String&amp;);
</span><span class="cx">     void setValue(const String&amp; name, PassRefPtr&lt;InspectorValue&gt;);
</span><del>-    void setObject(const String&amp; name, PassRefPtr&lt;InspectorObject&gt;);
-    void setArray(const String&amp; name, PassRefPtr&lt;InspectorArray&gt;);
</del><ins>+    void setObject(const String&amp; name, PassRefPtr&lt;InspectorObjectBase&gt;);
+    void setArray(const String&amp; name, PassRefPtr&lt;InspectorArrayBase&gt;);
</ins><span class="cx"> 
</span><span class="cx">     iterator find(const String&amp; name);
</span><span class="cx">     const_iterator find(const String&amp; name) const;
</span><span class="lines">@@ -317,14 +333,14 @@
</span><span class="cx">         m_order.append(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InspectorObjectBase::setObject(const String&amp; name, PassRefPtr&lt;InspectorObject&gt; value)
</del><ins>+inline void InspectorObjectBase::setObject(const String&amp; name, PassRefPtr&lt;InspectorObjectBase&gt; value)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(value);
</span><span class="cx">     if (m_data.set(name, value).isNewEntry)
</span><span class="cx">         m_order.append(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InspectorObjectBase::setArray(const String&amp; name, PassRefPtr&lt;InspectorArray&gt; value)
</del><ins>+inline void InspectorObjectBase::setArray(const String&amp; name, PassRefPtr&lt;InspectorArrayBase&gt; value)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(value);
</span><span class="cx">     if (m_data.set(name, value).isNewEntry)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -429,7 +429,7 @@
</span><span class="cx">     injectedScript.getFunctionDetails(errorString, functionId, &amp;details);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr&lt;InspectorObject&gt; data)
</del><ins>+void InspectorDebuggerAgent::schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr&lt;InspectorObject&gt; data)
</ins><span class="cx"> {
</span><span class="cx">     if (m_javaScriptPauseScheduled)
</span><span class="cx">         return;
</span><span class="lines">@@ -680,7 +680,7 @@
</span><span class="cx">     m_frontendDispatcher-&gt;resumed();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr&lt;InspectorObject&gt; data)
</del><ins>+void InspectorDebuggerAgent::breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr&lt;InspectorObject&gt; data)
</ins><span class="cx"> {
</span><span class="cx">     m_breakReason = breakReason;
</span><span class="cx">     m_breakAuxData = data;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -91,9 +91,9 @@
</span><span class="cx">     
</span><span class="cx">     void handleConsoleAssert();
</span><span class="cx"> 
</span><del>-    void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr&lt;InspectorObject&gt; data);
</del><ins>+    void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr&lt;InspectorObject&gt; data);
</ins><span class="cx">     void cancelPauseOnNextStatement();
</span><del>-    void breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr&lt;InspectorObject&gt; data);
</del><ins>+    void breakProgram(InspectorDebuggerFrontendDispatcher::Reason breakReason, PassRefPtr&lt;InspectorObject&gt; data);
</ins><span class="cx">     void scriptExecutionBlockedByCSP(const String&amp; directiveText);
</span><span class="cx"> 
</span><span class="cx">     class Listener {
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     BreakpointIdentifierToDebugServerBreakpointIDsMap m_breakpointIdentifierToDebugServerBreakpointIDs;
</span><span class="cx">     BreakpointIdentifierToBreakpointMap m_javaScriptBreakpoints;
</span><span class="cx">     JSC::BreakpointID m_continueToLocationBreakpointID;
</span><del>-    InspectorDebuggerFrontendDispatcher::Reason::Enum m_breakReason;
</del><ins>+    InspectorDebuggerFrontendDispatcher::Reason m_breakReason;
</ins><span class="cx">     RefPtr&lt;InspectorObject&gt; m_breakAuxData;
</span><span class="cx">     bool m_enabled;
</span><span class="cx">     bool m_javaScriptPauseScheduled;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     return result.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorRuntimeAgent::parse(ErrorString*, const String&amp; expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput&lt;String&gt;* message, RefPtr&lt;Inspector::TypeBuilder::Runtime::ErrorRange&gt;&amp; range)
</del><ins>+void InspectorRuntimeAgent::parse(ErrorString*, const String&amp; expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType* result, Inspector::TypeBuilder::OptOutput&lt;String&gt;* message, RefPtr&lt;Inspector::TypeBuilder::Runtime::ErrorRange&gt;&amp; range)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = globalVM();
</span><span class="cx">     JSLockHolder lock(vm);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void enable(ErrorString*) override { m_enabled = true; }
</span><span class="cx">     virtual void disable(ErrorString*) override { m_enabled = false; }
</span><del>-    virtual void parse(ErrorString*, const String&amp; expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType::Enum* result, Inspector::TypeBuilder::OptOutput&lt;String&gt;* message, RefPtr&lt;Inspector::TypeBuilder::Runtime::ErrorRange&gt;&amp;) override final;
</del><ins>+    virtual void parse(ErrorString*, const String&amp; expression, Inspector::TypeBuilder::Runtime::SyntaxErrorType* result, Inspector::TypeBuilder::OptOutput&lt;String&gt;* message, RefPtr&lt;Inspector::TypeBuilder::Runtime::ErrorRange&gt;&amp;) override final;
</ins><span class="cx">     virtual void evaluate(ErrorString*, const String&amp; expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, RefPtr&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt;&amp; result, Inspector::TypeBuilder::OptOutput&lt;bool&gt;* wasThrown) override final;
</span><span class="cx">     virtual void callFunctionOn(ErrorString*, const String&amp; objectId, const String&amp; expression, const RefPtr&lt;Inspector::InspectorArray&gt;* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt;&amp; result, Inspector::TypeBuilder::OptOutput&lt;bool&gt;* wasThrown) override final;
</span><span class="cx">     virtual void releaseObject(ErrorString*, const ErrorString&amp; objectId) override final;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsCodeGeneratorInspectorpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,2614 +0,0 @@
</span><del>-#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. All rights reserved.
-# Copyright (c) 2012 Intel Corporation. All rights reserved.
-# Copyright (c) 2013 Apple Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os.path
-import sys
-import string
-import optparse
-import re
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
-import CodeGeneratorInspectorStrings
-
-
-DOMAIN_DEFINE_NAME_MAP = {
-    &quot;Database&quot;: &quot;SQL_DATABASE&quot;,
-    &quot;IndexedDB&quot;: &quot;INDEXED_DATABASE&quot;,
-    &quot;Replay&quot;: &quot;WEB_REPLAY&quot;,
-}
-
-
-# Manually-filled map of type name replacements.
-TYPE_NAME_FIX_MAP = {
-    &quot;RGBA&quot;: &quot;Rgba&quot;,  # RGBA is reported to be conflicting with a define name in Windows CE.
-    &quot;&quot;: &quot;Empty&quot;,
-}
-
-
-TYPES_WITH_RUNTIME_CAST_SET = frozenset([&quot;Runtime.RemoteObject&quot;, &quot;Runtime.PropertyDescriptor&quot;, &quot;Runtime.InternalPropertyDescriptor&quot;,
-                                         &quot;Debugger.FunctionDetails&quot;, &quot;Debugger.CallFrame&quot;,
-                                         &quot;Canvas.TraceLog&quot;, &quot;Canvas.ResourceInfo&quot;, &quot;Canvas.ResourceState&quot;,
-                                         # This should be a temporary hack. TimelineEvent should be created via generated C++ API.
-                                         &quot;Timeline.TimelineEvent&quot;])
-
-TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset([&quot;Timeline.TimelineEvent&quot;,
-                                            # InspectorStyleSheet not only creates this property but wants to read it and modify it.
-                                            &quot;CSS.CSSProperty&quot;,
-                                            # InspectorResourceAgent needs to update mime-type.
-                                            &quot;Network.Response&quot;])
-
-EXACTLY_INT_SUPPORTED = False
-
-INSPECTOR_TYPES_GENERATOR_CONFIG_MAP = {
-    &quot;JavaScript&quot;: {
-        &quot;prefix&quot;: &quot;JS&quot;,
-        &quot;typebuilder_dependency&quot;: &quot;&quot;,
-        &quot;export_macro&quot;: &quot;JS_EXPORT_PRIVATE&quot;,
-    },
-    &quot;Web&quot;: {
-        &quot;prefix&quot;: &quot;Web&quot;,
-        &quot;typebuilder_dependency&quot;: &quot;#include &lt;inspector/InspectorJSTypeBuilders.h&gt;&quot;,
-        &quot;export_macro&quot;: &quot;&quot;,
-    },
-}
-
-cmdline_parser = optparse.OptionParser(usage=&quot;usage: %prog [options] &lt;Inspector.json&gt;&quot;)
-cmdline_parser.add_option(&quot;--output_h_dir&quot;)
-cmdline_parser.add_option(&quot;--output_cpp_dir&quot;)
-cmdline_parser.add_option(&quot;--output_js_dir&quot;)
-cmdline_parser.add_option(&quot;--output_type&quot;)  # JavaScript, Web
-cmdline_parser.add_option(&quot;--write_always&quot;, action=&quot;store_true&quot;)
-cmdline_parser.add_option(&quot;--no_verification&quot;, action=&quot;store_true&quot;)
-
-try:
-    arg_options, arg_values = cmdline_parser.parse_args()
-    if (len(arg_values) &lt; 1):
-        raise Exception(&quot;At least one plain argument expected&quot;)
-
-    input_json_filename = arg_values[0]
-    dependency_json_filenames = arg_values[1:]
-
-    output_header_dirname = arg_options.output_h_dir
-    output_cpp_dirname = arg_options.output_cpp_dir
-    output_js_dirname = arg_options.output_js_dir
-    output_type = arg_options.output_type
-
-    write_always = arg_options.write_always
-    verification = not arg_options.no_verification
-    if not output_header_dirname:
-        raise Exception(&quot;Output .h directory must be specified&quot;)
-    if not output_cpp_dirname:
-        raise Exception(&quot;Output .cpp directory must be specified&quot;)
-    if not output_js_dirname:
-        raise Exception(&quot;Output .js directory must be specified&quot;)
-    if output_type not in INSPECTOR_TYPES_GENERATOR_CONFIG_MAP.keys():
-        raise Exception(&quot;Unknown output type. Allowed types are: %s&quot; % INSPECTOR_TYPES_GENERATOR_CONFIG_MAP.keys())
-except Exception:
-    # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
-    exc = sys.exc_info()[1]
-    sys.stderr.write(&quot;Failed to parse command-line arguments: %s\n\n&quot; % exc)
-    sys.stderr.write(&quot;Usage: &lt;script&gt; Inspector.json --output_h_dir &lt;output_header_dir&gt; --output_cpp_dir &lt;output_cpp_dir&gt; --output_js_dir &lt;output_js_dir&gt; [--write_always] [--no_verification]\n&quot;)
-    exit(1)
-
-
-def dash_to_camelcase(word):
-    return ''.join(x.capitalize() or '-' for x in word.split('-'))
-
-
-def fix_camel_case(name):
-    refined = re.sub(r'-(\w)', lambda pat: pat.group(1).upper(), name)
-    refined = to_title_case(refined)
-    return re.sub(r'(?i)HTML|XML|WML|API|GC|XHR|DOM|CSS', lambda pat: pat.group(0).upper(), refined)
-
-
-def to_title_case(name):
-    return name[:1].upper() + name[1:]
-
-
-class Capitalizer:
-    @staticmethod
-    def lower_camel_case_to_upper(str):
-        if len(str) &gt; 0 and str[0].islower():
-            str = str[0].upper() + str[1:]
-        return str
-
-    @staticmethod
-    def upper_camel_case_to_lower(str):
-        pos = 0
-        while pos &lt; len(str) and str[pos].isupper():
-            pos += 1
-        if pos == 0:
-            return str
-        if pos == 1:
-            return str[0].lower() + str[1:]
-        if pos &lt; len(str):
-            pos -= 1
-        possible_abbreviation = str[0:pos]
-        if possible_abbreviation not in Capitalizer.ABBREVIATION:
-            raise Exception(&quot;Unknown abbreviation %s&quot; % possible_abbreviation)
-        str = possible_abbreviation.lower() + str[pos:]
-        return str
-
-    @staticmethod
-    def camel_case_to_capitalized_with_underscores(str):
-        if len(str) == 0:
-            return str
-        output = Capitalizer.split_camel_case_(str)
-        return &quot;_&quot;.join(output).upper()
-
-    @staticmethod
-    def split_camel_case_(str):
-        output = []
-        pos_being = 0
-        pos = 1
-        has_oneletter = False
-        while pos &lt; len(str):
-            if str[pos].isupper():
-                output.append(str[pos_being:pos].upper())
-                if pos - pos_being == 1:
-                    has_oneletter = True
-                pos_being = pos
-            pos += 1
-        output.append(str[pos_being:])
-        if has_oneletter:
-            array_pos = 0
-            while array_pos &lt; len(output) - 1:
-                if len(output[array_pos]) == 1:
-                    array_pos_end = array_pos + 1
-                    while array_pos_end &lt; len(output) and len(output[array_pos_end]) == 1:
-                        array_pos_end += 1
-                    if array_pos_end - array_pos &gt; 1:
-                        possible_abbreviation = &quot;&quot;.join(output[array_pos:array_pos_end])
-                        if possible_abbreviation.upper() in Capitalizer.ABBREVIATION:
-                            output[array_pos:array_pos_end] = [possible_abbreviation]
-                        else:
-                            array_pos = array_pos_end - 1
-                array_pos += 1
-        return output
-
-    ABBREVIATION = frozenset([&quot;XHR&quot;, &quot;DOM&quot;, &quot;CSS&quot;])
-
-VALIDATOR_IFDEF_NAME = &quot;!ASSERT_DISABLED&quot;
-
-
-class DomainNameFixes:
-    @classmethod
-    def get_fixed_data(cls, domain_name):
-        field_name_res = Capitalizer.upper_camel_case_to_lower(domain_name) + &quot;Agent&quot;
-
-        class Res(object):
-            skip_js_bind = domain_name in cls.skip_js_bind_domains
-
-            @staticmethod
-            def get_guard():
-                if domain_name in DOMAIN_DEFINE_NAME_MAP:
-                    define_name = DOMAIN_DEFINE_NAME_MAP[domain_name]
-
-                    class Guard:
-                        @staticmethod
-                        def generate_open(output):
-                            output.append(&quot;#if ENABLE(%s)\n&quot; % define_name)
-
-                        @staticmethod
-                        def generate_close(output):
-                            output.append(&quot;#endif // ENABLE(%s)\n&quot; % define_name)
-
-                    return Guard
-
-        return Res
-
-    skip_js_bind_domains = set([&quot;DOMDebugger&quot;])
-
-
-class RawTypes(object):
-    @staticmethod
-    def get(json_type):
-        if json_type == &quot;boolean&quot;:
-            return RawTypes.Bool
-        elif json_type == &quot;string&quot;:
-            return RawTypes.String
-        elif json_type == &quot;array&quot;:
-            return RawTypes.Array
-        elif json_type == &quot;object&quot;:
-            return RawTypes.Object
-        elif json_type == &quot;integer&quot;:
-            return RawTypes.Int
-        elif json_type == &quot;number&quot;:
-            return RawTypes.Number
-        elif json_type == &quot;any&quot;:
-            return RawTypes.Any
-        else:
-            raise Exception(&quot;Unknown type: %s&quot; % json_type)
-
-    # For output parameter all values are passed by pointer except RefPtr-based types.
-    class OutputPassModel:
-        class ByPointer:
-            @staticmethod
-            def get_argument_prefix():
-                return &quot;&amp;&quot;
-
-            @staticmethod
-            def get_parameter_type_suffix():
-                return &quot;*&quot;
-
-        class ByReference:
-            @staticmethod
-            def get_argument_prefix():
-                return &quot;&quot;
-
-            @staticmethod
-            def get_parameter_type_suffix():
-                return &quot;&amp;&quot;
-
-    class BaseType(object):
-        need_internal_runtime_cast_ = False
-
-        @classmethod
-        def request_raw_internal_runtime_cast(cls):
-            if not cls.need_internal_runtime_cast_:
-                cls.need_internal_runtime_cast_ = True
-
-        @classmethod
-        def get_raw_validator_call_text(cls):
-            return &quot;RuntimeCastHelper::assertType&lt;Inspector::InspectorValue::Type%s&gt;&quot; % cls.get_validate_method_params().template_type
-
-    class String(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;String&quot;
-
-        get_setter_name = get_getter_name
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;\&quot;\&quot;&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;string&quot;
-
-        @staticmethod
-        def get_validate_method_params():
-            class ValidateMethodParams:
-                template_type = &quot;String&quot;
-            return ValidateMethodParams
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByPointer
-
-        @staticmethod
-        def is_heavy_value():
-            return True
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;String&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.String
-
-    class Int(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Int&quot;
-
-        @staticmethod
-        def get_setter_name():
-            return &quot;Number&quot;
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;0&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;number&quot;
-
-        @classmethod
-        def get_raw_validator_call_text(cls):
-            return &quot;RuntimeCastHelper::assertInt&quot;
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByPointer
-
-        @staticmethod
-        def is_heavy_value():
-            return False
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;int&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Int
-
-    class Number(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Double&quot;
-
-        @staticmethod
-        def get_setter_name():
-            return &quot;Number&quot;
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;0&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;number&quot;
-
-        @staticmethod
-        def get_validate_method_params():
-            class ValidateMethodParams:
-                template_type = &quot;Number&quot;
-            return ValidateMethodParams
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByPointer
-
-        @staticmethod
-        def is_heavy_value():
-            return False
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;double&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Number
-
-    class Bool(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Boolean&quot;
-
-        get_setter_name = get_getter_name
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;false&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;boolean&quot;
-
-        @staticmethod
-        def get_validate_method_params():
-            class ValidateMethodParams:
-                template_type = &quot;Boolean&quot;
-            return ValidateMethodParams
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByPointer
-
-        @staticmethod
-        def is_heavy_value():
-            return False
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;bool&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Bool
-
-    class Object(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Object&quot;
-
-        @staticmethod
-        def get_setter_name():
-            return &quot;Value&quot;
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;InspectorObject::create()&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;object&quot;
-
-        @staticmethod
-        def get_output_argument_prefix():
-            return &quot;&quot;
-
-        @staticmethod
-        def get_validate_method_params():
-            class ValidateMethodParams:
-                template_type = &quot;Object&quot;
-            return ValidateMethodParams
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByReference
-
-        @staticmethod
-        def is_heavy_value():
-            return True
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;Inspector::InspectorObject&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Object
-
-    class Any(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Value&quot;
-
-        get_setter_name = get_getter_name
-
-        @staticmethod
-        def get_c_initializer():
-            raise Exception(&quot;Unsupported&quot;)
-
-        @staticmethod
-        def get_js_bind_type():
-            raise Exception(&quot;Unsupported&quot;)
-
-        @staticmethod
-        def get_raw_validator_call_text():
-            return &quot;RuntimeCastHelper::assertAny&quot;
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByReference
-
-        @staticmethod
-        def is_heavy_value():
-            return True
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;Inspector::InspectorValue&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Any
-
-    class Array(BaseType):
-        @staticmethod
-        def get_getter_name():
-            return &quot;Array&quot;
-
-        @staticmethod
-        def get_setter_name():
-            return &quot;Value&quot;
-
-        @staticmethod
-        def get_c_initializer():
-            return &quot;InspectorArray::create()&quot;
-
-        @staticmethod
-        def get_js_bind_type():
-            return &quot;object&quot;
-
-        @staticmethod
-        def get_output_argument_prefix():
-            return &quot;&quot;
-
-        @staticmethod
-        def get_validate_method_params():
-            class ValidateMethodParams:
-                template_type = &quot;Array&quot;
-            return ValidateMethodParams
-
-        @staticmethod
-        def get_output_pass_model():
-            return RawTypes.OutputPassModel.ByReference
-
-        @staticmethod
-        def is_heavy_value():
-            return True
-
-        @staticmethod
-        def get_array_item_raw_c_type_text():
-            return &quot;Inspector::InspectorArray&quot;
-
-        @staticmethod
-        def get_raw_type_model():
-            return TypeModel.Array
-
-
-def replace_right_shift(input_str):
-    return input_str.replace(&quot;&gt;&gt;&quot;, &quot;&gt; &gt;&quot;)
-
-
-class CommandReturnPassModel:
-    class ByReference:
-        def __init__(self, var_type, set_condition):
-            self.var_type = var_type
-            self.set_condition = set_condition
-
-        def get_return_var_type(self):
-            return self.var_type
-
-        @staticmethod
-        def get_output_argument_prefix():
-            return &quot;&quot;
-
-        @staticmethod
-        def get_output_to_raw_expression():
-            return &quot;%s&quot;
-
-        def get_output_parameter_type(self):
-            return self.var_type + &quot;&amp;&quot;
-
-        def get_set_return_condition(self):
-            return self.set_condition
-
-    class ByPointer:
-        def __init__(self, var_type):
-            self.var_type = var_type
-
-        def get_return_var_type(self):
-            return self.var_type
-
-        @staticmethod
-        def get_output_argument_prefix():
-            return &quot;&amp;&quot;
-
-        @staticmethod
-        def get_output_to_raw_expression():
-            return &quot;%s&quot;
-
-        def get_output_parameter_type(self):
-            return self.var_type + &quot;*&quot;
-
-        @staticmethod
-        def get_set_return_condition():
-            return None
-
-    class OptOutput:
-        def __init__(self, var_type):
-            self.var_type = var_type
-
-        def get_return_var_type(self):
-            return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;&quot; % self.var_type
-
-        @staticmethod
-        def get_output_argument_prefix():
-            return &quot;&amp;&quot;
-
-        @staticmethod
-        def get_output_to_raw_expression():
-            return &quot;%s.getValue()&quot;
-
-        def get_output_parameter_type(self):
-            return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;*&quot; % self.var_type
-
-        @staticmethod
-        def get_set_return_condition():
-            return &quot;%s.isAssigned()&quot;
-
-
-class TypeModel:
-    class RefPtrBased(object):
-        def __init__(self, class_name):
-            self.class_name = class_name
-            self.optional = False
-
-        def get_optional(self):
-            result = TypeModel.RefPtrBased(self.class_name)
-            result.optional = True
-            return result
-
-        def get_command_return_pass_model(self):
-            if self.optional:
-                set_condition = &quot;%s&quot;
-            else:
-                set_condition = None
-            return CommandReturnPassModel.ByReference(replace_right_shift(&quot;RefPtr&lt;%s&gt;&quot; % self.class_name), set_condition)
-
-        def get_input_param_type_text(self):
-            return replace_right_shift(&quot;PassRefPtr&lt;%s&gt;&quot; % self.class_name)
-
-        @staticmethod
-        def get_event_setter_expression_pattern():
-            return &quot;%s&quot;
-
-    class Enum(object):
-        def __init__(self, base_type_name):
-            self.type_name = base_type_name + &quot;::Enum&quot;
-
-        def get_optional(base_self):
-            class EnumOptional:
-                @classmethod
-                def get_optional(cls):
-                    return cls
-
-                @staticmethod
-                def get_command_return_pass_model():
-                    return CommandReturnPassModel.OptOutput(base_self.type_name)
-
-                @staticmethod
-                def get_input_param_type_text():
-                    return base_self.type_name + &quot;*&quot;
-
-                @staticmethod
-                def get_event_setter_expression_pattern():
-                    raise Exception(&quot;TODO&quot;)
-            return EnumOptional
-
-        def get_command_return_pass_model(self):
-            return CommandReturnPassModel.ByPointer(self.type_name)
-
-        def get_input_param_type_text(self):
-            return self.type_name
-
-        @staticmethod
-        def get_event_setter_expression_pattern():
-            return &quot;%s&quot;
-
-    class ValueType(object):
-        def __init__(self, type_name, is_heavy):
-            self.type_name = type_name
-            self.is_heavy = is_heavy
-
-        def get_optional(self):
-            return self.ValueOptional(self)
-
-        def get_command_return_pass_model(self):
-            return CommandReturnPassModel.ByPointer(self.type_name)
-
-        def get_input_param_type_text(self):
-            if self.is_heavy:
-                return &quot;const %s&amp;&quot; % self.type_name
-            else:
-                return self.type_name
-
-        def get_opt_output_type_(self):
-            return self.type_name
-
-        @staticmethod
-        def get_event_setter_expression_pattern():
-            return &quot;%s&quot;
-
-        class ValueOptional:
-            def __init__(self, base):
-                self.base = base
-
-            def get_optional(self):
-                return self
-
-            def get_command_return_pass_model(self):
-                return CommandReturnPassModel.OptOutput(self.base.get_opt_output_type_())
-
-            def get_input_param_type_text(self):
-                return &quot;const %s* const&quot; % self.base.type_name
-
-            @staticmethod
-            def get_event_setter_expression_pattern():
-                return &quot;*%s&quot;
-
-    class ExactlyInt(ValueType):
-        def __init__(self):
-            TypeModel.ValueType.__init__(self, &quot;int&quot;, False)
-
-        def get_input_param_type_text(self):
-            return &quot;Inspector::TypeBuilder::ExactlyInt&quot;
-
-        def get_opt_output_type_(self):
-            return &quot;Inspector::TypeBuilder::ExactlyInt&quot;
-
-    @classmethod
-    def init_class(cls):
-        cls.Bool = cls.ValueType(&quot;bool&quot;, False)
-        if EXACTLY_INT_SUPPORTED:
-            cls.Int = cls.ExactlyInt()
-        else:
-            cls.Int = cls.ValueType(&quot;int&quot;, False)
-        cls.Number = cls.ValueType(&quot;double&quot;, False)
-        cls.String = cls.ValueType(&quot;String&quot;, True,)
-        cls.Object = cls.RefPtrBased(&quot;Inspector::InspectorObject&quot;)
-        cls.Array = cls.RefPtrBased(&quot;Inspector::InspectorArray&quot;)
-        cls.Any = cls.RefPtrBased(&quot;Inspector::InspectorValue&quot;)
-
-TypeModel.init_class()
-
-
-# Collection of InspectorObject class methods that are likely to be overloaded in generated class.
-# We must explicitly import all overloaded methods or they won't be available to user.
-INSPECTOR_OBJECT_SETTER_NAMES = frozenset([&quot;setValue&quot;, &quot;setBoolean&quot;, &quot;setNumber&quot;, &quot;setString&quot;, &quot;setValue&quot;, &quot;setObject&quot;, &quot;setArray&quot;])
-
-
-def fix_type_name(json_name):
-    if json_name in TYPE_NAME_FIX_MAP:
-        fixed = TYPE_NAME_FIX_MAP[json_name]
-
-        class Result(object):
-            class_name = fixed
-
-            @staticmethod
-            def output_comment(writer):
-                writer.newline(&quot;// Type originally was named '%s'.\n&quot; % json_name)
-    else:
-
-        class Result(object):
-            class_name = json_name
-
-            @staticmethod
-            def output_comment(writer):
-                pass
-
-    return Result
-
-
-class Writer:
-    def __init__(self, output, indent):
-        self.output = output
-        self.indent = indent
-
-    def newline(self, str):
-        if (self.indent):
-            self.output.append(self.indent)
-        self.output.append(str)
-
-    def append(self, str):
-        self.output.append(str)
-
-    def newline_multiline(self, str):
-        parts = str.split('\n')
-        self.newline(parts[0])
-        for p in parts[1:]:
-            self.output.append('\n')
-            if p:
-                self.newline(p)
-
-    def append_multiline(self, str):
-        parts = str.split('\n')
-        self.append(parts[0])
-        for p in parts[1:]:
-            self.output.append('\n')
-            if p:
-                self.newline(p)
-
-    def get_indent(self):
-        return self.indent
-
-    def get_indented(self, additional_indent):
-        return Writer(self.output, self.indent + additional_indent)
-
-    def insert_writer(self, additional_indent):
-        new_output = []
-        self.output.append(new_output)
-        return Writer(new_output, self.indent + additional_indent)
-
-
-class EnumConstants:
-    map_ = {}
-    constants_ = []
-
-    @classmethod
-    def add_constant(cls, value):
-        if value in cls.map_:
-            return cls.map_[value]
-        else:
-            pos = len(cls.map_)
-            cls.map_[value] = pos
-            cls.constants_.append(value)
-            return pos
-
-    @classmethod
-    def get_enum_constant_code(cls):
-        output = []
-        for item in cls.constants_:
-            output.append(&quot;    \&quot;&quot; + item + &quot;\&quot;&quot;)
-        return &quot;,\n&quot;.join(output) + &quot;\n&quot;
-
-
-# Typebuilder code is generated in several passes: first typedefs, then other classes.
-# Manual pass management is needed because we cannot have forward declarations for typedefs.
-class TypeBuilderPass:
-    TYPEDEF = &quot;typedef&quot;
-    MAIN = &quot;main&quot;
-
-
-class TypeBindings:
-    @staticmethod
-    def create_named_type_declaration(json_typable, context_domain_name, type_data):
-        json_type = type_data.get_json_type()
-
-        class Helper:
-            is_ad_hoc = False
-            full_name_prefix_for_use = &quot;Inspector::TypeBuilder::&quot; + context_domain_name + &quot;::&quot;
-            full_name_prefix_for_impl = &quot;Inspector::TypeBuilder::&quot; + context_domain_name + &quot;::&quot;
-
-            @staticmethod
-            def write_doc(writer):
-                if &quot;description&quot; in json_type:
-                    writer.newline(&quot;/* &quot;)
-                    writer.append(json_type[&quot;description&quot;])
-                    writer.append(&quot; */\n&quot;)
-
-            @staticmethod
-            def add_to_forward_listener(forward_listener):
-                forward_listener.add_type_data(type_data)
-
-
-        fixed_type_name = fix_type_name(json_type[&quot;id&quot;])
-        return TypeBindings.create_type_declaration_(json_typable, context_domain_name, fixed_type_name, Helper)
-
-    @staticmethod
-    def create_ad_hoc_type_declaration(json_typable, context_domain_name, ad_hoc_type_context):
-        class Helper:
-            is_ad_hoc = True
-            full_name_prefix_for_use = ad_hoc_type_context.container_relative_name_prefix
-            full_name_prefix_for_impl = ad_hoc_type_context.container_full_name_prefix
-
-            @staticmethod
-            def write_doc(writer):
-                pass
-
-            @staticmethod
-            def add_to_forward_listener(forward_listener):
-                pass
-        fixed_type_name = ad_hoc_type_context.get_type_name_fix()
-        return TypeBindings.create_type_declaration_(json_typable, context_domain_name, fixed_type_name, Helper)
-
-    @staticmethod
-    def create_type_declaration_(json_typable, context_domain_name, fixed_type_name, helper):
-        if json_typable[&quot;type&quot;] == &quot;string&quot;:
-            if &quot;enum&quot; in json_typable:
-
-                class EnumBinding:
-                    need_user_runtime_cast_ = False
-                    need_internal_runtime_cast_ = False
-
-                    @classmethod
-                    def resolve_inner(cls, resolve_context):
-                        pass
-
-                    @classmethod
-                    def request_user_runtime_cast(cls, request):
-                        if request:
-                            cls.need_user_runtime_cast_ = True
-                            request.acknowledge()
-
-                    @classmethod
-                    def request_internal_runtime_cast(cls):
-                        cls.need_internal_runtime_cast_ = True
-
-                    @classmethod
-                    def get_code_generator(enum_binding_cls):
-                        #FIXME: generate ad-hoc enums too once we figure out how to better implement them in C++.
-                        comment_out = helper.is_ad_hoc
-
-                        class CodeGenerator:
-                            @staticmethod
-                            def generate_type_builder(writer, generate_context):
-                                enum = json_typable[&quot;enum&quot;]
-                                helper.write_doc(writer)
-                                enum_name = fixed_type_name.class_name
-                                fixed_type_name.output_comment(writer)
-                                writer.newline(&quot;struct &quot;)
-                                writer.append(enum_name)
-                                writer.append(&quot; {\n&quot;)
-                                writer.newline(&quot;    enum Enum {\n&quot;)
-                                for enum_item in enum:
-                                    enum_pos = EnumConstants.add_constant(enum_item)
-
-                                    item_c_name = fix_camel_case(enum_item)
-                                    if item_c_name in TYPE_NAME_FIX_MAP:
-                                        item_c_name = TYPE_NAME_FIX_MAP[item_c_name]
-                                    writer.newline(&quot;        &quot;)
-                                    writer.append(item_c_name)
-                                    writer.append(&quot; = &quot;)
-                                    writer.append(&quot;%s&quot; % enum_pos)
-                                    writer.append(&quot;,\n&quot;)
-                                writer.newline(&quot;    };\n&quot;)
-                                if enum_binding_cls.need_user_runtime_cast_:
-                                    raise Exception(&quot;Not yet implemented&quot;)
-
-                                if enum_binding_cls.need_internal_runtime_cast_:
-                                    writer.append(&quot;#if %s\n&quot; % VALIDATOR_IFDEF_NAME)
-                                    writer.newline(&quot;    static void assertCorrectValue(Inspector::InspectorValue* value);\n&quot;)
-                                    writer.append(&quot;#endif  // %s\n&quot; % VALIDATOR_IFDEF_NAME)
-
-                                    validator_writer = generate_context.validator_writer
-
-                                    domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
-                                    domain_guard = domain_fixes.get_guard()
-                                    if domain_guard:
-                                        domain_guard.generate_open(validator_writer)
-
-                                    validator_writer.newline(&quot;void %s%s::assertCorrectValue(Inspector::InspectorValue* value)\n&quot; % (helper.full_name_prefix_for_impl, enum_name))
-                                    validator_writer.newline(&quot;{\n&quot;)
-                                    validator_writer.newline(&quot;    WTF::String s;\n&quot;)
-                                    validator_writer.newline(&quot;    bool cast_res = value-&gt;asString(&amp;s);\n&quot;)
-                                    validator_writer.newline(&quot;    ASSERT(cast_res);\n&quot;)
-                                    if len(enum) &gt; 0:
-                                        condition_list = []
-                                        for enum_item in enum:
-                                            enum_pos = EnumConstants.add_constant(enum_item)
-                                            condition_list.append(&quot;s == \&quot;%s\&quot;&quot; % enum_item)
-                                        validator_writer.newline(&quot;    ASSERT(%s);\n&quot; % &quot; || &quot;.join(condition_list))
-                                    validator_writer.newline(&quot;}\n&quot;)
-
-                                    if domain_guard:
-                                        domain_guard.generate_close(validator_writer)
-
-                                    validator_writer.newline(&quot;\n\n&quot;)
-
-                                writer.newline(&quot;}; // struct &quot;)
-                                writer.append(enum_name)
-                                writer.append(&quot;\n&quot;)
-
-                            @staticmethod
-                            def register_use(forward_listener):
-                                pass
-
-                            @staticmethod
-                            def get_generate_pass_id():
-                                return TypeBuilderPass.MAIN
-
-                        return CodeGenerator
-
-                    @classmethod
-                    def get_validator_call_text(cls):
-                        return helper.full_name_prefix_for_use + fixed_type_name.class_name + &quot;::assertCorrectValue&quot;
-
-                    @classmethod
-                    def get_array_item_c_type_text(cls):
-                        return helper.full_name_prefix_for_use + fixed_type_name.class_name + &quot;::Enum&quot;
-
-                    @staticmethod
-                    def get_setter_value_expression_pattern():
-                        return &quot;Inspector::TypeBuilder::get%sEnumConstantValue(%s)&quot;
-
-                    @staticmethod
-                    def reduce_to_raw_type():
-                        return RawTypes.String
-
-                    @staticmethod
-                    def get_type_model():
-                        return TypeModel.Enum(helper.full_name_prefix_for_use + fixed_type_name.class_name)
-
-                return EnumBinding
-            else:
-                if helper.is_ad_hoc:
-
-                    class PlainString:
-                        @classmethod
-                        def resolve_inner(cls, resolve_context):
-                            pass
-
-                        @staticmethod
-                        def request_user_runtime_cast(request):
-                            raise Exception(&quot;Unsupported&quot;)
-
-                        @staticmethod
-                        def request_internal_runtime_cast():
-                            pass
-
-                        @staticmethod
-                        def get_code_generator():
-                            return None
-
-                        @classmethod
-                        def get_validator_call_text(cls):
-                            return RawTypes.String.get_raw_validator_call_text()
-
-                        @staticmethod
-                        def reduce_to_raw_type():
-                            return RawTypes.String
-
-                        @staticmethod
-                        def get_type_model():
-                            return TypeModel.String
-
-                        @staticmethod
-                        def get_setter_value_expression_pattern():
-                            return None
-
-                        @classmethod
-                        def get_array_item_c_type_text(cls):
-                            return cls.reduce_to_raw_type().get_array_item_raw_c_type_text()
-
-                    return PlainString
-
-                else:
-
-                    class TypedefString:
-                        @classmethod
-                        def resolve_inner(cls, resolve_context):
-                            pass
-
-                        @staticmethod
-                        def request_user_runtime_cast(request):
-                            raise Exception(&quot;Unsupported&quot;)
-
-                        @staticmethod
-                        def request_internal_runtime_cast():
-                            RawTypes.String.request_raw_internal_runtime_cast()
-
-                        @staticmethod
-                        def get_code_generator():
-                            class CodeGenerator:
-                                @staticmethod
-                                def generate_type_builder(writer, generate_context):
-                                    helper.write_doc(writer)
-                                    fixed_type_name.output_comment(writer)
-                                    writer.newline(&quot;typedef String &quot;)
-                                    writer.append(fixed_type_name.class_name)
-                                    writer.append(&quot;;\n\n&quot;)
-
-                                @staticmethod
-                                def register_use(forward_listener):
-                                    pass
-
-                                @staticmethod
-                                def get_generate_pass_id():
-                                    return TypeBuilderPass.TYPEDEF
-
-                            return CodeGenerator
-
-                        @classmethod
-                        def get_validator_call_text(cls):
-                            return RawTypes.String.get_raw_validator_call_text()
-
-                        @staticmethod
-                        def reduce_to_raw_type():
-                            return RawTypes.String
-
-                        @staticmethod
-                        def get_type_model():
-                            return TypeModel.ValueType(&quot;%s%s&quot; % (helper.full_name_prefix_for_use, fixed_type_name.class_name), True)
-
-                        @staticmethod
-                        def get_setter_value_expression_pattern():
-                            return None
-
-                        @classmethod
-                        def get_array_item_c_type_text(cls):
-                            return &quot;const %s%s&amp;&quot; % (helper.full_name_prefix_for_use, fixed_type_name.class_name)
-
-                    return TypedefString
-
-        elif json_typable[&quot;type&quot;] == &quot;integer&quot;:
-                if helper.is_ad_hoc:
-
-                    class PlainInteger:
-                        @classmethod
-                        def resolve_inner(cls, resolve_context):
-                            pass
-
-                        @staticmethod
-                        def request_user_runtime_cast(request):
-                            raise Exception(&quot;Unsupported&quot;)
-
-                        @staticmethod
-                        def request_internal_runtime_cast():
-                            pass
-
-                        @staticmethod
-                        def get_code_generator():
-                            return None
-
-                        @classmethod
-                        def get_validator_call_text(cls):
-                            return RawTypes.Int.get_raw_validator_call_text()
-
-                        @staticmethod
-                        def reduce_to_raw_type():
-                            return RawTypes.Int
-
-                        @staticmethod
-                        def get_type_model():
-                            return TypeModel.Int
-
-                        @staticmethod
-                        def get_setter_value_expression_pattern():
-                            return None
-
-                        @classmethod
-                        def get_array_item_c_type_text(cls):
-                            return cls.reduce_to_raw_type().get_array_item_raw_c_type_text()
-
-                    return PlainInteger
-
-                else:
-
-                    class TypedefInteger:
-                        @classmethod
-                        def resolve_inner(cls, resolve_context):
-                            pass
-
-                        @staticmethod
-                        def request_user_runtime_cast(request):
-                            raise Exception(&quot;Unsupported&quot;)
-
-                        @staticmethod
-                        def request_internal_runtime_cast():
-                            RawTypes.Int.request_raw_internal_runtime_cast()
-
-                        @staticmethod
-                        def get_code_generator():
-                            class CodeGenerator:
-                                @staticmethod
-                                def generate_type_builder(writer, generate_context):
-                                    helper.write_doc(writer)
-                                    fixed_type_name.output_comment(writer)
-                                    writer.newline(&quot;typedef int &quot;)
-                                    writer.append(fixed_type_name.class_name)
-                                    writer.append(&quot;;\n\n&quot;)
-
-                                @staticmethod
-                                def register_use(forward_listener):
-                                    pass
-
-                                @staticmethod
-                                def get_generate_pass_id():
-                                    return TypeBuilderPass.TYPEDEF
-
-                            return CodeGenerator
-
-                        @classmethod
-                        def get_validator_call_text(cls):
-                            return RawTypes.Int.get_raw_validator_call_text()
-
-                        @staticmethod
-                        def reduce_to_raw_type():
-                            return RawTypes.Int
-
-                        @staticmethod
-                        def get_type_model():
-                            return TypeModel.Int
-
-                        @staticmethod
-                        def get_setter_value_expression_pattern():
-                            return None
-
-                        @classmethod
-                        def get_array_item_c_type_text(cls):
-                            return helper.full_name_prefix_for_use + fixed_type_name.class_name
-
-                    return TypedefInteger
-
-        elif json_typable[&quot;type&quot;] == &quot;object&quot;:
-            if &quot;properties&quot; in json_typable:
-
-                class ClassBinding:
-                    resolve_data_ = None
-                    need_user_runtime_cast_ = False
-                    need_internal_runtime_cast_ = False
-
-                    @classmethod
-                    def resolve_inner(cls, resolve_context):
-                        if cls.resolve_data_:
-                            return
-
-                        properties = json_typable[&quot;properties&quot;]
-                        main = []
-                        optional = []
-
-                        ad_hoc_type_list = []
-
-                        for prop in properties:
-                            prop_name = prop[&quot;name&quot;]
-                            ad_hoc_type_context = cls.AdHocTypeContextImpl(prop_name, fixed_type_name.class_name, resolve_context, ad_hoc_type_list, helper.full_name_prefix_for_impl)
-                            binding = resolve_param_type(prop, context_domain_name, ad_hoc_type_context)
-
-                            code_generator = binding.get_code_generator()
-                            if code_generator:
-                                code_generator.register_use(resolve_context.forward_listener)
-
-                            class PropertyData:
-                                param_type_binding = binding
-                                p = prop
-
-                            if prop.get(&quot;optional&quot;):
-                                optional.append(PropertyData)
-                            else:
-                                main.append(PropertyData)
-
-                        class ResolveData:
-                            main_properties = main
-                            optional_properties = optional
-                            ad_hoc_types = ad_hoc_type_list
-
-                        cls.resolve_data_ = ResolveData
-
-                        for ad_hoc in ad_hoc_type_list:
-                            ad_hoc.resolve_inner(resolve_context)
-
-                    @classmethod
-                    def request_user_runtime_cast(cls, request):
-                        if not request:
-                            return
-                        cls.need_user_runtime_cast_ = True
-                        request.acknowledge()
-                        cls.request_internal_runtime_cast()
-
-                    @classmethod
-                    def request_internal_runtime_cast(cls):
-                        if cls.need_internal_runtime_cast_:
-                            return
-                        cls.need_internal_runtime_cast_ = True
-                        for p in cls.resolve_data_.main_properties:
-                            p.param_type_binding.request_internal_runtime_cast()
-                        for p in cls.resolve_data_.optional_properties:
-                            p.param_type_binding.request_internal_runtime_cast()
-
-                    @classmethod
-                    def get_code_generator(class_binding_cls):
-                        class CodeGenerator:
-                            @classmethod
-                            def generate_type_builder(cls, writer, generate_context):
-                                resolve_data = class_binding_cls.resolve_data_
-                                helper.write_doc(writer)
-                                class_name = fixed_type_name.class_name
-
-                                is_open_type = (context_domain_name + &quot;.&quot; + class_name) in TYPES_WITH_OPEN_FIELD_LIST_SET
-
-                                fixed_type_name.output_comment(writer)
-                                writer.newline(&quot;class &quot;)
-                                writer.append(class_name)
-                                writer.append(&quot; : public &quot;)
-                                if is_open_type:
-                                    writer.append(&quot;Inspector::InspectorObject&quot;)
-                                else:
-                                    writer.append(&quot;Inspector::InspectorObjectBase&quot;)
-                                writer.append(&quot; {\n&quot;)
-                                writer.newline(&quot;public:\n&quot;)
-                                ad_hoc_type_writer = writer.insert_writer(&quot;    &quot;)
-
-                                for ad_hoc_type in resolve_data.ad_hoc_types:
-                                    code_generator = ad_hoc_type.get_code_generator()
-                                    if code_generator:
-                                        code_generator.generate_type_builder(ad_hoc_type_writer, generate_context)
-
-                                writer.newline_multiline(
-&quot;&quot;&quot;    enum {
-        NoFieldsSet = 0,
-&quot;&quot;&quot;)
-
-                                state_enum_items = []
-                                if len(resolve_data.main_properties) &gt; 0:
-                                    pos = 0
-                                    for prop_data in resolve_data.main_properties:
-                                        item_name = Capitalizer.lower_camel_case_to_upper(prop_data.p[&quot;name&quot;]) + &quot;Set&quot;
-                                        state_enum_items.append(item_name)
-                                        writer.newline(&quot;        %s = 1 &lt;&lt; %s,\n&quot; % (item_name, pos))
-                                        pos += 1
-                                    all_fields_set_value = &quot;(&quot; + (&quot; | &quot;.join(state_enum_items)) + &quot;)&quot;
-                                else:
-                                    all_fields_set_value = &quot;0&quot;
-
-                                writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_1
-                                                         % (all_fields_set_value, class_name, class_name))
-
-                                pos = 0
-                                for prop_data in resolve_data.main_properties:
-                                    prop_name = prop_data.p[&quot;name&quot;]
-
-                                    param_type_binding = prop_data.param_type_binding
-                                    param_raw_type = param_type_binding.reduce_to_raw_type()
-
-                                    writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_2
-                                        % (state_enum_items[pos],
-                                           Capitalizer.lower_camel_case_to_upper(prop_name),
-                                           param_type_binding.get_type_model().get_input_param_type_text(),
-                                           state_enum_items[pos], prop_name,
-                                           param_raw_type.get_setter_name(), prop_name,
-                                           format_setter_value_expression(param_type_binding, &quot;value&quot;),
-                                           state_enum_items[pos]))
-
-                                    pos += 1
-
-                                writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_3
-                                                         % (class_name, class_name, class_name, class_name, class_name))
-
-                                writer.newline(&quot;    /*\n&quot;)
-                                writer.newline(&quot;     * Synthetic constructor:\n&quot;)
-                                writer.newline(&quot;     * RefPtr&lt;%s&gt; result = %s::create()&quot; % (class_name, class_name))
-                                for prop_data in resolve_data.main_properties:
-                                    writer.append_multiline(&quot;\n     *     .set%s(...)&quot; % Capitalizer.lower_camel_case_to_upper(prop_data.p[&quot;name&quot;]))
-                                writer.append_multiline(&quot;;\n     */\n&quot;)
-
-                                writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_4)
-
-                                writer.newline(&quot;    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;\n&quot;)
-
-                                for prop_data in resolve_data.optional_properties:
-                                    prop_name = prop_data.p[&quot;name&quot;]
-                                    param_type_binding = prop_data.param_type_binding
-                                    setter_name = &quot;set%s&quot; % Capitalizer.lower_camel_case_to_upper(prop_name)
-
-                                    writer.append_multiline(&quot;\n    void %s&quot; % setter_name)
-                                    writer.append(&quot;(%s value)\n&quot; % param_type_binding.get_type_model().get_input_param_type_text())
-                                    writer.newline(&quot;    {\n&quot;)
-                                    writer.newline(&quot;        this-&gt;set%s(ASCIILiteral(\&quot;%s\&quot;), %s);\n&quot;
-                                        % (param_type_binding.reduce_to_raw_type().get_setter_name(), prop_data.p[&quot;name&quot;],
-                                           format_setter_value_expression(param_type_binding, &quot;value&quot;)))
-                                    writer.newline(&quot;    }\n&quot;)
-
-
-                                    if setter_name in INSPECTOR_OBJECT_SETTER_NAMES:
-                                        writer.newline(&quot;    using Inspector::InspectorObjectBase::%s;\n\n&quot; % setter_name)
-
-                                if class_binding_cls.need_user_runtime_cast_:
-                                    writer.newline(&quot;    static PassRefPtr&lt;%s&gt; runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value)\n&quot; % class_name)
-                                    writer.newline(&quot;    {\n&quot;)
-                                    writer.newline(&quot;        RefPtr&lt;Inspector::InspectorObject&gt; object;\n&quot;)
-                                    writer.newline(&quot;        bool castRes = value-&gt;asObject(&amp;object);\n&quot;)
-                                    writer.newline(&quot;        ASSERT_UNUSED(castRes, castRes);\n&quot;)
-                                    writer.append(&quot;#if %s\n&quot; % VALIDATOR_IFDEF_NAME)
-                                    writer.newline(&quot;        assertCorrectValue(object.get());\n&quot;)
-                                    writer.append(&quot;#endif  // %s\n&quot; % VALIDATOR_IFDEF_NAME)
-                                    writer.newline(&quot;        COMPILE_ASSERT(sizeof(%s) == sizeof(Inspector::InspectorObjectBase), type_cast_problem);\n&quot; % class_name)
-                                    writer.newline(&quot;        return static_cast&lt;%s*&gt;(static_cast&lt;Inspector::InspectorObjectBase*&gt;(object.get()));\n&quot; % class_name)
-                                    writer.newline(&quot;    }\n&quot;)
-                                    writer.append(&quot;\n&quot;)
-
-                                if class_binding_cls.need_internal_runtime_cast_:
-                                    writer.append(&quot;#if %s\n&quot; % VALIDATOR_IFDEF_NAME)
-                                    writer.newline(&quot;    static %s void assertCorrectValue(Inspector::InspectorValue* value);\n&quot; % INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;export_macro&quot;])
-                                    writer.append(&quot;#endif  // %s\n&quot; % VALIDATOR_IFDEF_NAME)
-
-                                    closed_field_set = (context_domain_name + &quot;.&quot; + class_name) not in TYPES_WITH_OPEN_FIELD_LIST_SET
-
-                                    validator_writer = generate_context.validator_writer
-
-                                    domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
-                                    domain_guard = domain_fixes.get_guard()
-                                    if domain_guard:
-                                        domain_guard.generate_open(validator_writer)
-
-                                    validator_writer.newline(&quot;void %s%s::assertCorrectValue(Inspector::InspectorValue* value)\n&quot; % (helper.full_name_prefix_for_impl, class_name))
-                                    validator_writer.newline(&quot;{\n&quot;)
-                                    validator_writer.newline(&quot;    RefPtr&lt;InspectorObject&gt; object;\n&quot;)
-                                    validator_writer.newline(&quot;    bool castRes = value-&gt;asObject(&amp;object);\n&quot;)
-                                    validator_writer.newline(&quot;    ASSERT_UNUSED(castRes, castRes);\n&quot;)
-                                    for prop_data in resolve_data.main_properties:
-                                        validator_writer.newline(&quot;    {\n&quot;)
-                                        it_name = &quot;%sPos&quot; % prop_data.p[&quot;name&quot;]
-                                        validator_writer.newline(&quot;        InspectorObject::iterator %s;\n&quot; % it_name)
-                                        validator_writer.newline(&quot;        %s = object-&gt;find(\&quot;%s\&quot;);\n&quot; % (it_name, prop_data.p[&quot;name&quot;]))
-                                        validator_writer.newline(&quot;        ASSERT(%s != object-&gt;end());\n&quot; % it_name)
-                                        validator_writer.newline(&quot;        %s(%s-&gt;value.get());\n&quot; % (prop_data.param_type_binding.get_validator_call_text(), it_name))
-                                        validator_writer.newline(&quot;    }\n&quot;)
-
-                                    if closed_field_set:
-                                        validator_writer.newline(&quot;    int foundPropertiesCount = %s;\n&quot; % len(resolve_data.main_properties))
-
-                                    for prop_data in resolve_data.optional_properties:
-                                        validator_writer.newline(&quot;    {\n&quot;)
-                                        it_name = &quot;%sPos&quot; % prop_data.p[&quot;name&quot;]
-                                        validator_writer.newline(&quot;        InspectorObject::iterator %s;\n&quot; % it_name)
-                                        validator_writer.newline(&quot;        %s = object-&gt;find(\&quot;%s\&quot;);\n&quot; % (it_name, prop_data.p[&quot;name&quot;]))
-                                        validator_writer.newline(&quot;        if (%s != object-&gt;end()) {\n&quot; % it_name)
-                                        validator_writer.newline(&quot;            %s(%s-&gt;value.get());\n&quot; % (prop_data.param_type_binding.get_validator_call_text(), it_name))
-                                        if closed_field_set:
-                                            validator_writer.newline(&quot;            ++foundPropertiesCount;\n&quot;)
-                                        validator_writer.newline(&quot;        }\n&quot;)
-                                        validator_writer.newline(&quot;    }\n&quot;)
-
-                                    if closed_field_set:
-                                        validator_writer.newline(&quot;    if (foundPropertiesCount != object-&gt;size())\n&quot;)
-                                        validator_writer.newline(&quot;        FATAL(\&quot;Unexpected properties in object: %s\\n\&quot;, object-&gt;toJSONString().ascii().data());\n&quot;)
-                                    validator_writer.newline(&quot;}\n&quot;)
-
-                                    if domain_guard:
-                                        domain_guard.generate_close(validator_writer)
-
-                                    validator_writer.newline(&quot;\n\n&quot;)
-
-                                if is_open_type:
-                                    cpp_writer = generate_context.cpp_writer
-                                    writer.append(&quot;\n&quot;)
-                                    writer.newline(&quot;    // Property names for type generated as open.\n&quot;)
-                                    for prop_data in resolve_data.main_properties + resolve_data.optional_properties:
-                                        prop_name = prop_data.p[&quot;name&quot;]
-                                        prop_field_name = Capitalizer.lower_camel_case_to_upper(prop_name)
-                                        writer.newline(&quot;    static const char* %s;\n&quot; % (prop_field_name))
-                                        cpp_writer.newline(&quot;const char* %s%s::%s = \&quot;%s\&quot;;\n&quot; % (helper.full_name_prefix_for_impl, class_name, prop_field_name, prop_name))
-
-
-                                writer.newline(&quot;};\n\n&quot;)
-
-                            @staticmethod
-                            def generate_forward_declaration(writer):
-                                class_name = fixed_type_name.class_name
-                                writer.newline(&quot;class &quot;)
-                                writer.append(class_name)
-                                writer.append(&quot;;\n&quot;)
-
-                            @staticmethod
-                            def register_use(forward_listener):
-                                helper.add_to_forward_listener(forward_listener)
-
-                            @staticmethod
-                            def get_generate_pass_id():
-                                return TypeBuilderPass.MAIN
-
-                        return CodeGenerator
-
-                    @staticmethod
-                    def get_validator_call_text():
-                        return helper.full_name_prefix_for_use + fixed_type_name.class_name + &quot;::assertCorrectValue&quot;
-
-                    @classmethod
-                    def get_array_item_c_type_text(cls):
-                        return helper.full_name_prefix_for_use + fixed_type_name.class_name
-
-                    @staticmethod
-                    def get_setter_value_expression_pattern():
-                        return None
-
-                    @staticmethod
-                    def reduce_to_raw_type():
-                        return RawTypes.Object
-
-                    @staticmethod
-                    def get_type_model():
-                        return TypeModel.RefPtrBased(helper.full_name_prefix_for_use + fixed_type_name.class_name)
-
-                    class AdHocTypeContextImpl:
-                        def __init__(self, property_name, class_name, resolve_context, ad_hoc_type_list, parent_full_name_prefix):
-                            self.property_name = property_name
-                            self.class_name = class_name
-                            self.resolve_context = resolve_context
-                            self.ad_hoc_type_list = ad_hoc_type_list
-                            self.container_full_name_prefix = parent_full_name_prefix + class_name + &quot;::&quot;
-                            self.container_relative_name_prefix = &quot;&quot;
-
-                        def get_type_name_fix(self):
-                            class NameFix:
-                                class_name = Capitalizer.lower_camel_case_to_upper(self.property_name)
-
-                                @staticmethod
-                                def output_comment(writer):
-                                    writer.newline(&quot;// Named after property name '%s' while generating %s.\n&quot; % (self.property_name, self.class_name))
-
-                            return NameFix
-
-                        def add_type(self, binding):
-                            self.ad_hoc_type_list.append(binding)
-
-                return ClassBinding
-            else:
-
-                class PlainObjectBinding:
-                    @classmethod
-                    def resolve_inner(cls, resolve_context):
-                        pass
-
-                    @staticmethod
-                    def request_user_runtime_cast(request):
-                        pass
-
-                    @staticmethod
-                    def request_internal_runtime_cast():
-                        RawTypes.Object.request_raw_internal_runtime_cast()
-
-                    @staticmethod
-                    def get_code_generator():
-                        pass
-
-                    @staticmethod
-                    def get_validator_call_text():
-                        return &quot;RuntimeCastHelper::assertType&lt;InspectorValue::TypeObject&gt;&quot;
-
-                    @classmethod
-                    def get_array_item_c_type_text(cls):
-                        return cls.reduce_to_raw_type().get_array_item_raw_c_type_text()
-
-                    @staticmethod
-                    def get_setter_value_expression_pattern():
-                        return None
-
-                    @staticmethod
-                    def reduce_to_raw_type():
-                        return RawTypes.Object
-
-                    @staticmethod
-                    def get_type_model():
-                        return TypeModel.Object
-
-                return PlainObjectBinding
-        elif json_typable[&quot;type&quot;] == &quot;array&quot;:
-            if &quot;items&quot; in json_typable:
-
-                ad_hoc_types = []
-
-                class AdHocTypeContext:
-                    container_full_name_prefix = &quot;&lt;not yet defined&gt;&quot;
-                    container_relative_name_prefix = &quot;&quot;
-
-                    @staticmethod
-                    def get_type_name_fix():
-                        return fixed_type_name
-
-                    @staticmethod
-                    def add_type(binding):
-                        ad_hoc_types.append(binding)
-
-                item_binding = resolve_param_type(json_typable[&quot;items&quot;], context_domain_name, AdHocTypeContext)
-
-                class ArrayBinding:
-                    resolve_data_ = None
-                    need_internal_runtime_cast_ = False
-
-                    @classmethod
-                    def resolve_inner(cls, resolve_context):
-                        if cls.resolve_data_:
-                            return
-
-                        class ResolveData:
-                            item_type_binding = item_binding
-                            ad_hoc_type_list = ad_hoc_types
-
-                        cls.resolve_data_ = ResolveData
-
-                        for t in ad_hoc_types:
-                            t.resolve_inner(resolve_context)
-
-                    @classmethod
-                    def request_user_runtime_cast(cls, request):
-                        raise Exception(&quot;Not implemented yet&quot;)
-
-                    @classmethod
-                    def request_internal_runtime_cast(cls):
-                        if cls.need_internal_runtime_cast_:
-                            return
-                        cls.need_internal_runtime_cast_ = True
-                        cls.resolve_data_.item_type_binding.request_internal_runtime_cast()
-
-                    @classmethod
-                    def get_code_generator(array_binding_cls):
-
-                        class CodeGenerator:
-                            @staticmethod
-                            def generate_type_builder(writer, generate_context):
-                                ad_hoc_type_writer = writer
-
-                                resolve_data = array_binding_cls.resolve_data_
-
-                                for ad_hoc_type in resolve_data.ad_hoc_type_list:
-                                    code_generator = ad_hoc_type.get_code_generator()
-                                    if code_generator:
-                                        code_generator.generate_type_builder(ad_hoc_type_writer, generate_context)
-
-                            @staticmethod
-                            def generate_forward_declaration(writer):
-                                pass
-
-                            @staticmethod
-                            def register_use(forward_listener):
-                                item_code_generator = item_binding.get_code_generator()
-                                if item_code_generator:
-                                    item_code_generator.register_use(forward_listener)
-
-                            @staticmethod
-                            def get_generate_pass_id():
-                                return TypeBuilderPass.MAIN
-
-                        return CodeGenerator
-
-                    @classmethod
-                    def get_validator_call_text(cls):
-                        return cls.get_array_item_c_type_text() + &quot;::assertCorrectValue&quot;
-
-                    @classmethod
-                    def get_array_item_c_type_text(cls):
-                        return replace_right_shift(&quot;Inspector::TypeBuilder::Array&lt;%s&gt;&quot; % cls.resolve_data_.item_type_binding.get_array_item_c_type_text())
-
-                    @staticmethod
-                    def get_setter_value_expression_pattern():
-                        return None
-
-                    @staticmethod
-                    def reduce_to_raw_type():
-                        return RawTypes.Array
-
-                    @classmethod
-                    def get_type_model(cls):
-                        return TypeModel.RefPtrBased(cls.get_array_item_c_type_text())
-
-                return ArrayBinding
-            else:
-                # Fall-through to raw type.
-                pass
-
-        raw_type = RawTypes.get(json_typable[&quot;type&quot;])
-
-        return RawTypeBinding(raw_type)
-
-
-class RawTypeBinding:
-    def __init__(self, raw_type):
-        self.raw_type_ = raw_type
-
-    def resolve_inner(self, resolve_context):
-        pass
-
-    def request_user_runtime_cast(self, request):
-        raise Exception(&quot;Unsupported&quot;)
-
-    def request_internal_runtime_cast(self):
-        self.raw_type_.request_raw_internal_runtime_cast()
-
-    def get_code_generator(self):
-        return None
-
-    def get_validator_call_text(self):
-        return self.raw_type_.get_raw_validator_call_text()
-
-    def get_array_item_c_type_text(self):
-        return self.raw_type_.get_array_item_raw_c_type_text()
-
-    def get_setter_value_expression_pattern(self):
-        return None
-
-    def reduce_to_raw_type(self):
-        return self.raw_type_
-
-    def get_type_model(self):
-        return self.raw_type_.get_raw_type_model()
-
-
-class TypeData(object):
-    def __init__(self, json_type, json_domain, domain_data):
-        self.json_type_ = json_type
-        self.json_domain_ = json_domain
-        self.domain_data_ = domain_data
-
-        if &quot;type&quot; not in json_type:
-            raise Exception(&quot;Unknown type&quot;)
-
-        json_type_name = json_type[&quot;type&quot;]
-        self.raw_type_ = RawTypes.get(json_type_name)
-        self.binding_being_resolved_ = False
-        self.binding_ = None
-
-    def get_raw_type(self):
-        return self.raw_type_
-
-    def get_binding(self):
-        if not self.binding_:
-            if self.binding_being_resolved_:
-                raise Exception(&quot;Type %s is already being resolved&quot; % self.json_type_[&quot;type&quot;])
-            # Resolve only lazily, because resolving one named type may require resolving some other named type.
-            self.binding_being_resolved_ = True
-            try:
-                self.binding_ = TypeBindings.create_named_type_declaration(self.json_type_, self.json_domain_[&quot;domain&quot;], self)
-            finally:
-                self.binding_being_resolved_ = False
-
-        return self.binding_
-
-    def get_json_type(self):
-        return self.json_type_
-
-    def get_name(self):
-        return self.json_type_[&quot;id&quot;]
-
-    def get_domain_name(self):
-        return self.json_domain_[&quot;domain&quot;]
-
-
-class DomainData:
-    def __init__(self, json_domain):
-        self.json_domain = json_domain
-        self.types_ = []
-
-    def add_type(self, type_data):
-        self.types_.append(type_data)
-
-    def name(self):
-        return self.json_domain[&quot;domain&quot;]
-
-    def types(self):
-        return self.types_
-
-
-class TypeMap:
-    def __init__(self, api, dependency_api):
-        self.map_ = {}
-        self.domains_ = []
-        self.domains_to_generate_ = []
-        for json_domain in api[&quot;domains&quot;]:
-            self.add_domain(json_domain, True)
-        for json_domain in dependency_api[&quot;domains&quot;]:
-            self.add_domain(json_domain, False)
-
-    def add_domain(self, json_domain, should_generate):
-        domain_name = json_domain[&quot;domain&quot;]
-
-        domain_map = {}
-        self.map_[domain_name] = domain_map
-
-        domain_data = DomainData(json_domain)
-        self.domains_.append(domain_data)
-
-        if should_generate:
-            # FIXME: The order of types should not matter. The generated code should work regardless of the order of types.
-            if domain_name == &quot;Page&quot;:
-                self.domains_to_generate_.insert(0, domain_data)
-            else:
-                self.domains_to_generate_.append(domain_data)
-
-        if &quot;types&quot; in json_domain:
-            for json_type in json_domain[&quot;types&quot;]:
-                type_name = json_type[&quot;id&quot;]
-                type_data = TypeData(json_type, json_domain, domain_data)
-                domain_map[type_name] = type_data
-                domain_data.add_type(type_data)
-
-    def domains(self):
-        return self.domains_
-
-    def domains_to_generate(self):
-        return self.domains_to_generate_
-
-    def get(self, domain_name, type_name):
-        return self.map_[domain_name][type_name]
-
-
-def resolve_param_type(json_parameter, scope_domain_name, ad_hoc_type_context):
-    if &quot;$ref&quot; in json_parameter:
-        json_ref = json_parameter[&quot;$ref&quot;]
-        type_data = get_ref_data(json_ref, scope_domain_name)
-        return type_data.get_binding()
-    elif &quot;type&quot; in json_parameter:
-        result = TypeBindings.create_ad_hoc_type_declaration(json_parameter, scope_domain_name, ad_hoc_type_context)
-        ad_hoc_type_context.add_type(result)
-        return result
-    else:
-        raise Exception(&quot;Unknown type&quot;)
-
-
-def resolve_param_raw_type(json_parameter, scope_domain_name):
-    if &quot;$ref&quot; in json_parameter:
-        json_ref = json_parameter[&quot;$ref&quot;]
-        type_data = get_ref_data(json_ref, scope_domain_name)
-        return type_data.get_raw_type()
-    elif &quot;type&quot; in json_parameter:
-        json_type = json_parameter[&quot;type&quot;]
-        return RawTypes.get(json_type)
-    else:
-        raise Exception(&quot;Unknown type&quot;)
-
-
-def get_ref_data(json_ref, scope_domain_name):
-    dot_pos = json_ref.find(&quot;.&quot;)
-    if dot_pos == -1:
-        domain_name = scope_domain_name
-        type_name = json_ref
-    else:
-        domain_name = json_ref[:dot_pos]
-        type_name = json_ref[dot_pos + 1:]
-
-    return type_map.get(domain_name, type_name)
-
-
-input_file = open(input_json_filename, &quot;r&quot;)
-json_string = input_file.read()
-json_api = json.loads(json_string)
-input_file.close()
-if not &quot;domains&quot; in json_api:
-    json_api = {&quot;domains&quot;: [json_api]}
-
-dependency_api = {&quot;domains&quot;: []}
-for dependency_json_filename in dependency_json_filenames:
-    dependency_input_file = open(dependency_json_filename, &quot;r&quot;)
-    dependency_json_string = dependency_input_file.read()
-    dependency_json_api = json.loads(dependency_json_string)
-    dependency_input_file.close()
-    if not &quot;domains&quot; in dependency_json_api:
-        dependency_json_api = {&quot;domains&quot;: [dependency_json_api]}
-    dependency_api[&quot;domains&quot;] += dependency_json_api[&quot;domains&quot;]
-
-
-class Templates:
-    def get_this_script_path_(absolute_path):
-        absolute_path = os.path.abspath(absolute_path)
-        components = []
-
-        def fill_recursive(path_part, depth):
-            if depth &lt;= 0 or path_part == '/':
-                return
-            fill_recursive(os.path.dirname(path_part), depth - 1)
-            components.append(os.path.basename(path_part))
-
-        # Typical path is /Source/WebCore/inspector/CodeGeneratorInspector.py
-        # Let's take 4 components from the real path then.
-        fill_recursive(absolute_path, 4)
-
-        return &quot;/&quot;.join(components)
-
-    file_header_ = (&quot;// File is generated by %s\n\n&quot; % get_this_script_path_(sys.argv[0]) +
-&quot;&quot;&quot;// Copyright (c) 2013 Apple Inc. All Rights Reserved.
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-&quot;&quot;&quot;)
-
-    frontend_domain_class = string.Template(CodeGeneratorInspectorStrings.frontend_domain_class)
-    backend_dispatcher_constructor = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_constructor)
-    backend_dispatcher_dispatch_method = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method)
-    backend_dispatcher_dispatch_method_simple = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method_simple)
-    backend_method = string.Template(CodeGeneratorInspectorStrings.backend_method)
-    frontend_method = string.Template(CodeGeneratorInspectorStrings.frontend_method)
-    callback_method = string.Template(CodeGeneratorInspectorStrings.callback_method)
-    frontend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.frontend_h)
-    backend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_h)
-    backend_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_cpp)
-    frontend_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.frontend_cpp)
-    typebuilder_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.typebuilder_h)
-    typebuilder_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.typebuilder_cpp)
-    backend_js = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_js)
-    param_container_access_code = CodeGeneratorInspectorStrings.param_container_access_code
-
-
-
-
-
-type_map = TypeMap(json_api, dependency_api)
-
-
-class NeedRuntimeCastRequest:
-    def __init__(self):
-        self.ack_ = None
-
-    def acknowledge(self):
-        self.ack_ = True
-
-    def is_acknowledged(self):
-        return self.ack_
-
-
-def resolve_all_types():
-    runtime_cast_generate_requests = {}
-    for type_name in TYPES_WITH_RUNTIME_CAST_SET:
-        runtime_cast_generate_requests[type_name] = NeedRuntimeCastRequest()
-
-    class ForwardListener:
-        type_data_set = set()
-        already_declared_set = set()
-
-        @classmethod
-        def add_type_data(cls, type_data):
-            if type_data not in cls.already_declared_set:
-                cls.type_data_set.add(type_data)
-
-    class ResolveContext:
-        forward_listener = ForwardListener
-
-    for domain_data in type_map.domains():
-        for type_data in domain_data.types():
-            binding = type_data.get_binding()
-            binding.resolve_inner(ResolveContext)
-            # Do not generate forwards for this type any longer.
-            ForwardListener.already_declared_set.add(type_data)
-
-    for domain_data in type_map.domains():
-        for type_data in domain_data.types():
-            full_type_name = &quot;%s.%s&quot; % (type_data.get_domain_name(), type_data.get_name())
-            request = runtime_cast_generate_requests.pop(full_type_name, None)
-            binding = type_data.get_binding()
-            if request:
-                binding.request_user_runtime_cast(request)
-
-            if request and not request.is_acknowledged():
-                raise Exception(&quot;Failed to generate runtimeCast in &quot; + full_type_name)
-
-    # FIXME: This assumes all the domains are processed at once. Change this verification
-    # to only verify runtime casts for the domains being generated.
-    # if verification:
-    #     for full_type_name in runtime_cast_generate_requests:
-    #         raise Exception(&quot;Failed to generate runtimeCast. Type &quot; + full_type_name + &quot; not found&quot;)
-
-    return ForwardListener
-
-
-global_forward_listener = resolve_all_types()
-
-
-def get_annotated_type_text(raw_type, annotated_type):
-    if annotated_type != raw_type:
-        return &quot;/*%s*/ %s&quot; % (annotated_type, raw_type)
-    else:
-        return raw_type
-
-
-def format_setter_value_expression(param_type_binding, value_ref):
-    pattern = param_type_binding.get_setter_value_expression_pattern()
-    if pattern:
-        return pattern % (INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;prefix&quot;], value_ref)
-    else:
-        return value_ref
-
-
-class Generator:
-    frontend_domain_class_lines = []
-
-    backend_method_implementation_list = []
-    frontend_method_list = []
-    backend_js_domain_initializer_list = []
-
-    backend_handler_interface_list = []
-    backend_handler_implementation_list = []
-    backend_dispatcher_interface_list = []
-    type_builder_fragments = []
-    type_builder_forwards = []
-    validator_impl_list = []
-    type_builder_impl_list = []
-
-
-    @staticmethod
-    def go():
-        Generator.process_types(type_map)
-
-        first_cycle_guardable_list_list = [
-            Generator.backend_method_implementation_list,
-            Generator.backend_handler_interface_list,
-            Generator.backend_handler_implementation_list,
-            Generator.backend_dispatcher_interface_list]
-
-        for json_domain in json_api[&quot;domains&quot;]:
-            domain_name = json_domain[&quot;domain&quot;]
-            domain_name_lower = domain_name.lower()
-
-            domain_fixes = DomainNameFixes.get_fixed_data(domain_name)
-
-            domain_guard = domain_fixes.get_guard()
-
-            if domain_guard:
-                for l in first_cycle_guardable_list_list:
-                    domain_guard.generate_open(l)
-
-            frontend_method_declaration_lines = []
-
-            if (&quot;commands&quot; in json_domain or &quot;events&quot; in json_domain):
-                Generator.backend_js_domain_initializer_list.append(&quot;// %s.\n&quot; % domain_name)
-                if not domain_fixes.skip_js_bind:
-                    Generator.backend_js_domain_initializer_list.append(&quot;InspectorBackend.register%sDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, \&quot;%s\&quot;);\n&quot; % (domain_name, domain_name))
-
-            if &quot;types&quot; in json_domain:
-                for json_type in json_domain[&quot;types&quot;]:
-                    if &quot;type&quot; in json_type and json_type[&quot;type&quot;] == &quot;string&quot; and &quot;enum&quot; in json_type:
-                        enum_name = &quot;%s.%s&quot; % (domain_name, json_type[&quot;id&quot;])
-                        Generator.process_enum(json_type, enum_name)
-                    elif json_type[&quot;type&quot;] == &quot;object&quot;:
-                        if &quot;properties&quot; in json_type:
-                            for json_property in json_type[&quot;properties&quot;]:
-                                if &quot;type&quot; in json_property and json_property[&quot;type&quot;] == &quot;string&quot; and &quot;enum&quot; in json_property:
-                                    enum_name = &quot;%s.%s%s&quot; % (domain_name, json_type[&quot;id&quot;], to_title_case(json_property[&quot;name&quot;]))
-                                    Generator.process_enum(json_property, enum_name)
-
-            if &quot;events&quot; in json_domain:
-                if domain_guard:
-                    domain_guard.generate_open(Generator.frontend_method_list)
-                    domain_guard.generate_open(Generator.frontend_domain_class_lines)
-
-                for json_event in json_domain[&quot;events&quot;]:
-                    Generator.process_event(json_event, domain_name, frontend_method_declaration_lines)
-
-                Generator.frontend_domain_class_lines.append(Templates.frontend_domain_class.substitute(None,
-                    exportMacro=INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;export_macro&quot;],
-                    domainClassName=&quot;Inspector%sFrontendDispatcher&quot; % domain_name,
-                    frontendDomainMethodDeclarations=&quot;&quot;.join(flatten_list(frontend_method_declaration_lines))))
-
-                if domain_guard:
-                    domain_guard.generate_close(Generator.frontend_method_list)
-                    domain_guard.generate_close(Generator.frontend_domain_class_lines)
-
-            dispatcher_name = &quot;Inspector&quot; + Capitalizer.lower_camel_case_to_upper(domain_name) + &quot;BackendDispatcher&quot;
-            agent_interface_name = dispatcher_name + &quot;Handler&quot;
-
-            if &quot;commands&quot; in json_domain:
-                Generator.backend_dispatcher_interface_list.append(&quot;class %s %s final : public Inspector::InspectorSupplementalBackendDispatcher {\n&quot; % (INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;export_macro&quot;], dispatcher_name))
-                Generator.backend_dispatcher_interface_list.append(&quot;public:\n&quot;)
-                Generator.backend_dispatcher_interface_list.append(&quot;    static PassRefPtr&lt;%s&gt; create(Inspector::InspectorBackendDispatcher*, %s*);\n&quot; % (dispatcher_name, agent_interface_name))
-                Generator.backend_dispatcher_interface_list.append(&quot;    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;\n&quot;)
-                Generator.backend_dispatcher_interface_list.append(&quot;private:\n&quot;)
-
-                Generator.backend_handler_interface_list.append(&quot;class %s %s {\n&quot; % (INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;export_macro&quot;], agent_interface_name))
-                Generator.backend_handler_interface_list.append(&quot;public:\n&quot;)
-
-                backend_method_count = len(Generator.backend_method_implementation_list)
-
-                dispatcher_if_chain = []
-                dispatcher_commands_list = []
-                for json_command in json_domain[&quot;commands&quot;]:
-                    Generator.process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list)
-
-                Generator.backend_handler_interface_list.append(&quot;protected:\n&quot;)
-                Generator.backend_handler_interface_list.append(&quot;    virtual ~%s();\n&quot; % agent_interface_name)
-                Generator.backend_handler_interface_list.append(&quot;};\n\n&quot;)
-
-                Generator.backend_handler_implementation_list.append(&quot;%s::~%s() { }\n&quot; % (agent_interface_name, agent_interface_name))
-
-                Generator.backend_dispatcher_interface_list.append(&quot;private:\n&quot;)
-                Generator.backend_dispatcher_interface_list.append(&quot;    %s(Inspector::InspectorBackendDispatcher*, %s*);\n&quot; % (dispatcher_name, agent_interface_name))
-                Generator.backend_dispatcher_interface_list.append(&quot;    %s* m_agent;\n&quot; % agent_interface_name)
-                Generator.backend_dispatcher_interface_list.append(&quot;};\n\n&quot;)
-
-                Generator.backend_method_implementation_list.insert(backend_method_count, Templates.backend_dispatcher_constructor.substitute(None,
-                    domainName=domain_name,
-                    dispatcherName=dispatcher_name,
-                    agentName=agent_interface_name))
-
-                if len(json_domain[&quot;commands&quot;]) &lt;= 5:
-                    Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method_simple.substitute(None,
-                        domainName=domain_name,
-                        dispatcherName=dispatcher_name,
-                        ifChain=&quot;\n&quot;.join(dispatcher_if_chain)))
-                else:
-                    Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method.substitute(None,
-                        domainName=domain_name,
-                        dispatcherName=dispatcher_name,
-                        dispatcherCommands=&quot;\n&quot;.join(dispatcher_commands_list)))
-
-                if domain_guard:
-                    for l in reversed(first_cycle_guardable_list_list):
-                        domain_guard.generate_close(l)
-                Generator.backend_js_domain_initializer_list.append(&quot;\n&quot;)
-
-    @staticmethod
-    def process_enum(json_enum, enum_name):
-        enum_members = []
-        for member in json_enum[&quot;enum&quot;]:
-            enum_members.append(&quot;%s: \&quot;%s\&quot;&quot; % (fix_camel_case(member), member))
-
-        Generator.backend_js_domain_initializer_list.append(&quot;InspectorBackend.registerEnum(\&quot;%s\&quot;, {%s});\n&quot; % (
-            enum_name, &quot;, &quot;.join(enum_members)))
-
-    @staticmethod
-    def process_event(json_event, domain_name, frontend_method_declaration_lines):
-        event_name = json_event[&quot;name&quot;]
-
-        ad_hoc_type_output = []
-        frontend_method_declaration_lines.append(ad_hoc_type_output)
-        ad_hoc_type_writer = Writer(ad_hoc_type_output, &quot;        &quot;)
-
-        decl_parameter_list = []
-
-        json_parameters = json_event.get(&quot;parameters&quot;)
-        Generator.generate_send_method(json_parameters, event_name, domain_name, ad_hoc_type_writer,
-                                       decl_parameter_list,
-                                       Generator.EventMethodStructTemplate,
-                                       Generator.frontend_method_list, Templates.frontend_method, {&quot;eventName&quot;: event_name})
-
-        backend_js_event_param_list = []
-        if json_parameters:
-            for parameter in json_parameters:
-                parameter_name = parameter[&quot;name&quot;]
-                backend_js_event_param_list.append(&quot;\&quot;%s\&quot;&quot; % parameter_name)
-
-        frontend_method_declaration_lines.append(
-            &quot;    void %s(%s);\n&quot; % (event_name, &quot;, &quot;.join(decl_parameter_list)))
-
-        Generator.backend_js_domain_initializer_list.append(&quot;InspectorBackend.registerEvent(\&quot;%s.%s\&quot;, [%s]);\n&quot; % (
-            domain_name, event_name, &quot;, &quot;.join(backend_js_event_param_list)))
-
-    class EventMethodStructTemplate:
-        @staticmethod
-        def append_prolog(line_list):
-            line_list.append(&quot;    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();\n&quot;)
-
-        @staticmethod
-        def append_epilog(line_list):
-            line_list.append(&quot;    jsonMessage-&gt;setObject(ASCIILiteral(\&quot;params\&quot;), paramsObject);\n&quot;)
-
-        container_name = &quot;paramsObject&quot;
-
-    @staticmethod
-    def process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list):
-        json_command_name = json_command[&quot;name&quot;]
-
-        ad_hoc_type_output = []
-        Generator.backend_handler_interface_list.append(ad_hoc_type_output)
-        ad_hoc_type_writer = Writer(ad_hoc_type_output, &quot;    &quot;)
-
-        Generator.backend_dispatcher_interface_list.append(&quot;    void %s(long callId, const Inspector::InspectorObject&amp; message);\n&quot; % json_command_name)
-
-        Generator.backend_handler_interface_list.append(&quot;    virtual void %s(ErrorString*&quot; % json_command_name)
-
-        if not dispatcher_if_chain:
-            dispatcher_if_chain.append(&quot;    if (method == \&quot;%s\&quot;)&quot; % json_command_name)
-        else:
-            dispatcher_if_chain.append(&quot;    else if (method == \&quot;%s\&quot;)&quot; % json_command_name)
-        dispatcher_if_chain.append(&quot;        %s(callId, *message.get());&quot; % json_command_name)
-        dispatcher_commands_list.append(&quot;            { \&quot;%s\&quot;, &amp;%s::%s },&quot; % (json_command_name, dispatcher_name, json_command_name))
-
-        method_in_params_handling = []
-        method_dispatch_handling = []
-        method_out_params_handling = []
-        method_ending_handling = []
-        method_request_message_param_name = &quot;&quot;
-        agent_call_param_list = []
-        js_parameters_text = &quot;&quot;
-        if &quot;parameters&quot; in json_command:
-            json_params = json_command[&quot;parameters&quot;]
-            method_request_message_param_name = &quot; message&quot;
-            method_in_params_handling.append(&quot;    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();\n&quot;)
-            method_in_params_handling.append(&quot;    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(\&quot;params\&quot;));\n&quot;)
-            method_in_params_handling.append(&quot;    InspectorObject* paramsContainerPtr = paramsContainer.get();\n&quot;)
-            method_in_params_handling.append(&quot;    InspectorArray* protocolErrorsPtr = protocolErrors.get();\n&quot;)
-            js_param_list = []
-
-            for json_parameter in json_params:
-                json_param_name = json_parameter[&quot;name&quot;]
-                param_raw_type = resolve_param_raw_type(json_parameter, domain_name)
-
-                getter_name = param_raw_type.get_getter_name()
-
-                optional = json_parameter.get(&quot;optional&quot;)
-
-                non_optional_type_model = param_raw_type.get_raw_type_model()
-                if optional:
-                    type_model = non_optional_type_model.get_optional()
-                else:
-                    type_model = non_optional_type_model
-
-                if optional:
-                    code = (&quot;    bool %s_valueFound = false;\n&quot;
-                            &quot;    %s in_%s = InspectorBackendDispatcher::get%s(paramsContainerPtr, ASCIILiteral(\&quot;%s\&quot;), &amp;%s_valueFound, protocolErrorsPtr);\n&quot; %
-                           (json_param_name, non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name, getter_name, json_param_name, json_param_name))
-                    param = &quot;, %s_valueFound ? &amp;in_%s : nullptr&quot; % (json_param_name, json_param_name)
-                    # FIXME: pass optional refptr-values as PassRefPtr
-                    formal_param_type_pattern = &quot;const %s*&quot;
-                else:
-                    code = (&quot;    %s in_%s = InspectorBackendDispatcher::get%s(paramsContainerPtr, ASCIILiteral(\&quot;%s\&quot;), nullptr, protocolErrorsPtr);\n&quot; %
-                            (non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name, getter_name, json_param_name))
-                    param = &quot;, in_%s&quot; % json_param_name
-                    # FIXME: pass not-optional refptr-values as NonNullPassRefPtr
-                    if param_raw_type.is_heavy_value():
-                        formal_param_type_pattern = &quot;const %s&amp;&quot;
-                    else:
-                        formal_param_type_pattern = &quot;%s&quot;
-
-                method_in_params_handling.append(code)
-                agent_call_param_list.append(param)
-                Generator.backend_handler_interface_list.append(&quot;, %s in_%s&quot; % (formal_param_type_pattern % non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name))
-
-                js_bind_type = param_raw_type.get_js_bind_type()
-                js_param_text = &quot;{\&quot;name\&quot;: \&quot;%s\&quot;, \&quot;type\&quot;: \&quot;%s\&quot;, \&quot;optional\&quot;: %s}&quot; % (
-                    json_param_name,
-                    js_bind_type,
-                    (&quot;true&quot; if (&quot;optional&quot; in json_parameter and json_parameter[&quot;optional&quot;]) else &quot;false&quot;))
-
-                js_param_list.append(js_param_text)
-
-            method_in_params_handling.append(&quot;    if (protocolErrors-&gt;length()) {\n&quot;)
-            method_in_params_handling.append(&quot;        String errorMessage = String::format(\&quot;Some arguments of method '%%s' can't be processed\&quot;, \&quot;%s.%s\&quot;);\n&quot; % (domain_name, json_command_name))
-            method_in_params_handling.append(&quot;        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());\n&quot;)
-            method_in_params_handling.append(&quot;        return;\n&quot;)
-            method_in_params_handling.append(&quot;    }\n&quot;)
-            method_in_params_handling.append(&quot;\n&quot;)
-
-            js_parameters_text = &quot;, &quot;.join(js_param_list)
-
-        method_dispatch_handling.append(&quot;    ErrorString error;\n&quot;)
-        method_dispatch_handling.append(&quot;    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();\n&quot;)
-
-        if json_command.get(&quot;async&quot;) == True:
-            callback_name = Capitalizer.lower_camel_case_to_upper(json_command_name) + &quot;Callback&quot;
-
-            callback_output = []
-            callback_writer = Writer(callback_output, ad_hoc_type_writer.get_indent())
-
-            decl_parameter_list = []
-            Generator.generate_send_method(json_command.get(&quot;returns&quot;), json_command_name, domain_name, ad_hoc_type_writer,
-                                           decl_parameter_list,
-                                           Generator.CallbackMethodStructTemplate,
-                                           Generator.backend_method_implementation_list, Templates.callback_method,
-                                           {&quot;callbackName&quot;: callback_name, &quot;handlerName&quot;: agent_interface_name})
-
-            callback_writer.newline(&quot;class &quot; + callback_name + &quot; : public Inspector::InspectorBackendDispatcher::CallbackBase {\n&quot;)
-            callback_writer.newline(&quot;public:\n&quot;)
-            callback_writer.newline(&quot;    &quot; + callback_name + &quot;(PassRefPtr&lt;Inspector::InspectorBackendDispatcher&gt;, int id);\n&quot;)
-            callback_writer.newline(&quot;    void sendSuccess(&quot; + &quot;, &quot;.join(decl_parameter_list) + &quot;);\n&quot;)
-            callback_writer.newline(&quot;};\n&quot;)
-
-            ad_hoc_type_output.append(callback_output)
-
-            method_dispatch_handling.append(&quot;    RefPtr&lt;%s::%s&gt; callback = adoptRef(new %s::%s(m_backendDispatcher,callId));\n&quot; % (agent_interface_name, callback_name, agent_interface_name, callback_name))
-            method_ending_handling.append(&quot;    if (error.length()) {\n&quot;)
-            method_ending_handling.append(&quot;        callback-&gt;disable();\n&quot;)
-            method_ending_handling.append(&quot;        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, Inspector::InspectorBackendDispatcher::ServerError, error);\n&quot;)
-            method_ending_handling.append(&quot;        return;\n&quot;)
-            method_ending_handling.append(&quot;    }&quot;)
-
-            agent_call_param_list.append(&quot;, callback&quot;)
-            Generator.backend_handler_interface_list.append(&quot;, PassRefPtr&lt;%s&gt; callback&quot; % callback_name)
-        elif &quot;returns&quot; in json_command:
-            has_multiple_returns = len(json_command[&quot;returns&quot;]) &gt; 1
-            if has_multiple_returns:
-                method_out_params_handling.append(&quot;    if (!error.length()) {\n&quot;)
-            else:
-                method_out_params_handling.append(&quot;    if (!error.length())\n&quot;)
-
-            for json_return in json_command[&quot;returns&quot;]:
-
-                json_return_name = json_return[&quot;name&quot;]
-
-                optional = bool(json_return.get(&quot;optional&quot;))
-
-                return_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_return, json_command_name, domain_name, ad_hoc_type_writer, agent_interface_name + &quot;::&quot;)
-
-                raw_type = return_type_binding.reduce_to_raw_type()
-                setter_type = raw_type.get_setter_name()
-                initializer = raw_type.get_c_initializer()
-
-                type_model = return_type_binding.get_type_model()
-                if optional:
-                    type_model = type_model.get_optional()
-
-                code = &quot;    %s out_%s;\n&quot; % (type_model.get_command_return_pass_model().get_return_var_type(), json_return_name)
-                param = &quot;, %sout_%s&quot; % (type_model.get_command_return_pass_model().get_output_argument_prefix(), json_return_name)
-                var_name = &quot;out_%s&quot; % json_return_name
-                setter_argument = type_model.get_command_return_pass_model().get_output_to_raw_expression() % var_name
-                if return_type_binding.get_setter_value_expression_pattern():
-                    setter_argument = return_type_binding.get_setter_value_expression_pattern() % (INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;prefix&quot;], setter_argument)
-
-                cook = &quot;        result-&gt;set%s(ASCIILiteral(\&quot;%s\&quot;), %s);\n&quot; % (setter_type, json_return_name, setter_argument)
-
-                set_condition_pattern = type_model.get_command_return_pass_model().get_set_return_condition()
-                if set_condition_pattern:
-                    cook = (&quot;        if (%s)\n    &quot; % (set_condition_pattern % var_name)) + cook
-                annotated_type = type_model.get_command_return_pass_model().get_output_parameter_type()
-
-                param_name = &quot;out_%s&quot; % json_return_name
-                if optional:
-                    param_name = &quot;opt_&quot; + param_name
-
-                Generator.backend_handler_interface_list.append(&quot;, %s %s&quot; % (annotated_type, param_name))
-                method_out_params_handling.append(cook)
-                method_dispatch_handling.append(code)
-
-                agent_call_param_list.append(param)
-
-            if has_multiple_returns:
-                method_out_params_handling.append(&quot;    }\n&quot;)
-            method_out_params_handling.append(&quot;\n&quot;)
-
-        method_dispatch_handling.append(&quot;    m_agent-&gt;%s(&amp;error%s);\n&quot; % (json_command_name, &quot;&quot;.join(agent_call_param_list)))
-        method_dispatch_handling.append(&quot;\n&quot;)
-
-        if not method_ending_handling:
-            method_ending_handling.append(&quot;    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);&quot;)
-
-        backend_js_reply_param_list = []
-        if &quot;returns&quot; in json_command:
-            for json_return in json_command[&quot;returns&quot;]:
-                json_return_name = json_return[&quot;name&quot;]
-                backend_js_reply_param_list.append(&quot;\&quot;%s\&quot;&quot; % json_return_name)
-
-        js_reply_list = &quot;[%s]&quot; % &quot;, &quot;.join(backend_js_reply_param_list)
-
-        Generator.backend_method_implementation_list.append(Templates.backend_method.substitute(None,
-            dispatcherName=dispatcher_name,
-            methodName=json_command_name,
-            requestMessageObject=method_request_message_param_name,
-            methodInParametersHandling=&quot;&quot;.join(method_in_params_handling),
-            methodDispatchHandling=&quot;&quot;.join(method_dispatch_handling),
-            methodOutParametersHandling=&quot;&quot;.join(method_out_params_handling),
-            methodEndingHandling=&quot;&quot;.join(method_ending_handling)))
-
-        Generator.backend_js_domain_initializer_list.append(&quot;InspectorBackend.registerCommand(\&quot;%s.%s\&quot;, [%s], %s);\n&quot; % (domain_name, json_command_name, js_parameters_text, js_reply_list))
-        Generator.backend_handler_interface_list.append(&quot;) = 0;\n&quot;)
-
-    class CallbackMethodStructTemplate:
-        @staticmethod
-        def append_prolog(line_list):
-            pass
-
-        @staticmethod
-        def append_epilog(line_list):
-            pass
-
-        container_name = &quot;jsonMessage&quot;
-
-    # Generates common code for event sending and callback response data sending.
-    @staticmethod
-    def generate_send_method(parameters, event_name, domain_name, ad_hoc_type_writer, decl_parameter_list,
-                             method_struct_template,
-                             generator_method_list, method_template, template_params):
-        method_line_list = []
-        if parameters:
-            method_struct_template.append_prolog(method_line_list)
-            for json_parameter in parameters:
-                parameter_name = json_parameter[&quot;name&quot;]
-
-                param_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_parameter, event_name, domain_name, ad_hoc_type_writer, &quot;&quot;)
-
-                raw_type = param_type_binding.reduce_to_raw_type()
-                raw_type_binding = RawTypeBinding(raw_type)
-
-                optional = bool(json_parameter.get(&quot;optional&quot;))
-
-                setter_type = raw_type.get_setter_name()
-
-                type_model = param_type_binding.get_type_model()
-                raw_type_model = raw_type_binding.get_type_model()
-                if optional:
-                    type_model = type_model.get_optional()
-                    raw_type_model = raw_type_model.get_optional()
-
-                annotated_type = type_model.get_input_param_type_text()
-                mode_type_binding = param_type_binding
-
-                decl_parameter_list.append(&quot;%s %s&quot; % (annotated_type, parameter_name))
-
-                setter_argument = raw_type_model.get_event_setter_expression_pattern() % parameter_name
-                if mode_type_binding.get_setter_value_expression_pattern():
-                    setter_argument = mode_type_binding.get_setter_value_expression_pattern() % (INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;prefix&quot;], setter_argument)
-
-                setter_code = &quot;    %s-&gt;set%s(ASCIILiteral(\&quot;%s\&quot;), %s);\n&quot; % (method_struct_template.container_name, setter_type, parameter_name, setter_argument)
-                if optional:
-                    setter_code = (&quot;    if (%s)\n    &quot; % parameter_name) + setter_code
-                method_line_list.append(setter_code)
-
-            method_struct_template.append_epilog(method_line_list)
-
-        generator_method_list.append(method_template.substitute(None,
-            domainName=domain_name,
-            parameters=&quot;, &quot;.join(decl_parameter_list),
-            code=&quot;&quot;.join(method_line_list), **template_params))
-
-    @staticmethod
-    def resolve_type_and_generate_ad_hoc(json_param, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param):
-        param_name = json_param[&quot;name&quot;]
-        ad_hoc_type_list = []
-
-        class AdHocTypeContext:
-            container_full_name_prefix = &quot;&lt;not yet defined&gt;&quot;
-            container_relative_name_prefix = container_relative_name_prefix_param
-
-            @staticmethod
-            def get_type_name_fix():
-                class NameFix:
-                    class_name = Capitalizer.lower_camel_case_to_upper(param_name)
-
-                    @staticmethod
-                    def output_comment(writer):
-                        writer.newline(&quot;// Named after parameter '%s' while generating command/event %s.\n&quot; % (param_name, method_name))
-
-                return NameFix
-
-            @staticmethod
-            def add_type(binding):
-                ad_hoc_type_list.append(binding)
-
-        type_binding = resolve_param_type(json_param, domain_name, AdHocTypeContext)
-
-        class InterfaceForwardListener:
-            @staticmethod
-            def add_type_data(type_data):
-                pass
-
-        class InterfaceResolveContext:
-            forward_listener = InterfaceForwardListener
-
-        for type in ad_hoc_type_list:
-            type.resolve_inner(InterfaceResolveContext)
-
-        class InterfaceGenerateContext:
-            validator_writer = &quot;not supported in InterfaceGenerateContext&quot;
-            cpp_writer = validator_writer
-
-        for type in ad_hoc_type_list:
-            generator = type.get_code_generator()
-            if generator:
-                generator.generate_type_builder(ad_hoc_type_writer, InterfaceGenerateContext)
-
-        return type_binding
-
-    @staticmethod
-    def process_types(type_map):
-        output = Generator.type_builder_fragments
-
-        class GenerateContext:
-            validator_writer = Writer(Generator.validator_impl_list, &quot;&quot;)
-            cpp_writer = Writer(Generator.type_builder_impl_list, &quot;&quot;)
-
-        def generate_all_domains_code(out, type_data_callback):
-            writer = Writer(out, &quot;&quot;)
-            for domain_data in type_map.domains_to_generate():
-                domain_fixes = DomainNameFixes.get_fixed_data(domain_data.name())
-                domain_guard = domain_fixes.get_guard()
-
-                namespace_declared = []
-
-                def namespace_lazy_generator():
-                    if not namespace_declared:
-                        if domain_guard:
-                            domain_guard.generate_open(out)
-                        writer.newline(&quot;namespace &quot;)
-                        writer.append(domain_data.name())
-                        writer.append(&quot; {\n&quot;)
-                        # What is a better way to change value from outer scope?
-                        namespace_declared.append(True)
-                    return writer
-
-                for type_data in domain_data.types():
-                    type_data_callback(type_data, namespace_lazy_generator)
-
-                if namespace_declared:
-                    writer.append(&quot;} // &quot;)
-                    writer.append(domain_data.name())
-                    writer.append(&quot;\n\n&quot;)
-
-                    if domain_guard:
-                        domain_guard.generate_close(out)
-
-        def create_type_builder_caller(generate_pass_id):
-            def call_type_builder(type_data, writer_getter):
-                code_generator = type_data.get_binding().get_code_generator()
-                if code_generator and generate_pass_id == code_generator.get_generate_pass_id():
-                    writer = writer_getter()
-
-                    code_generator.generate_type_builder(writer, GenerateContext)
-            return call_type_builder
-
-        generate_all_domains_code(output, create_type_builder_caller(TypeBuilderPass.MAIN))
-
-        Generator.type_builder_forwards.append(&quot;// Forward declarations.\n&quot;)
-
-        def generate_forward_callback(type_data, writer_getter):
-            if type_data in global_forward_listener.type_data_set:
-                binding = type_data.get_binding()
-                binding.get_code_generator().generate_forward_declaration(writer_getter())
-        generate_all_domains_code(Generator.type_builder_forwards, generate_forward_callback)
-
-        Generator.type_builder_forwards.append(&quot;// End of forward declarations.\n\n&quot;)
-
-        Generator.type_builder_forwards.append(&quot;// Typedefs.\n&quot;)
-
-        generate_all_domains_code(Generator.type_builder_forwards, create_type_builder_caller(TypeBuilderPass.TYPEDEF))
-
-        Generator.type_builder_forwards.append(&quot;// End of typedefs.\n\n&quot;)
-
-
-def flatten_list(input):
-    res = []
-
-    def fill_recursive(l):
-        for item in l:
-            if isinstance(item, list):
-                fill_recursive(item)
-            else:
-                res.append(item)
-    fill_recursive(input)
-    return res
-
-
-# A writer that only updates file if it actually changed to better support incremental build.
-class SmartOutput:
-    def __init__(self, file_name):
-        self.file_name_ = file_name
-        self.output_ = &quot;&quot;
-
-    def write(self, text):
-        self.output_ += text
-
-    def close(self):
-        text_changed = True
-        self.output_ = self.output_.rstrip() + &quot;\n&quot;
-
-        try:
-            read_file = open(self.file_name_, &quot;r&quot;)
-            old_text = read_file.read()
-            read_file.close()
-            text_changed = old_text != self.output_
-        except:
-            # Ignore, just overwrite by default
-            pass
-
-        if text_changed or write_always:
-            out_file = open(self.file_name_, &quot;w&quot;)
-            out_file.write(self.output_)
-            out_file.close()
-
-
-Generator.go()
-
-output_file_name_prefix = INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;prefix&quot;]
-
-backend_h_file = SmartOutput(output_header_dirname + (&quot;/Inspector%sBackendDispatchers.h&quot; % output_file_name_prefix))
-backend_cpp_file = SmartOutput(output_cpp_dirname + (&quot;/Inspector%sBackendDispatchers.cpp&quot; % output_file_name_prefix))
-
-frontend_h_file = SmartOutput(output_header_dirname + (&quot;/Inspector%sFrontendDispatchers.h&quot; % output_file_name_prefix))
-frontend_cpp_file = SmartOutput(output_cpp_dirname + (&quot;/Inspector%sFrontendDispatchers.cpp&quot; % output_file_name_prefix))
-
-typebuilder_h_file = SmartOutput(output_header_dirname + (&quot;/Inspector%sTypeBuilders.h&quot; % output_file_name_prefix))
-typebuilder_cpp_file = SmartOutput(output_cpp_dirname + (&quot;/Inspector%sTypeBuilders.cpp&quot; % output_file_name_prefix))
-
-backend_js_file = SmartOutput(output_js_dirname + (&quot;/Inspector%sBackendCommands.js&quot; % output_file_name_prefix))
-
-
-backend_h_file.write(Templates.backend_h.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    handlerInterfaces=&quot;&quot;.join(flatten_list(Generator.backend_handler_interface_list)),
-    dispatcherInterfaces=&quot;&quot;.join(flatten_list(Generator.backend_dispatcher_interface_list))))
-
-backend_cpp_file.write(Templates.backend_cpp.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    handlerImplementations=&quot;&quot;.join(flatten_list(Generator.backend_handler_implementation_list)),
-    methods=&quot;\n&quot;.join(Generator.backend_method_implementation_list)))
-
-frontend_h_file.write(Templates.frontend_h.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    domainClassList=&quot;&quot;.join(Generator.frontend_domain_class_lines)))
-
-frontend_cpp_file.write(Templates.frontend_cpp.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    methods=&quot;\n&quot;.join(Generator.frontend_method_list)))
-
-typebuilder_h_file.write(Templates.typebuilder_h.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    typeBuilderDependencies=INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;typebuilder_dependency&quot;],
-    exportMacro=INSPECTOR_TYPES_GENERATOR_CONFIG_MAP[output_type][&quot;export_macro&quot;],
-    typeBuilders=&quot;&quot;.join(flatten_list(Generator.type_builder_fragments)),
-    forwards=&quot;&quot;.join(Generator.type_builder_forwards),
-    validatorIfdefName=VALIDATOR_IFDEF_NAME))
-
-typebuilder_cpp_file.write(Templates.typebuilder_cpp.substitute(None,
-    outputFileNamePrefix=output_file_name_prefix,
-    enumConstantValues=EnumConstants.get_enum_constant_code(),
-    implCode=&quot;&quot;.join(flatten_list(Generator.type_builder_impl_list)),
-    validatorCode=&quot;&quot;.join(flatten_list(Generator.validator_impl_list)),
-    validatorIfdefName=VALIDATOR_IFDEF_NAME))
-
-backend_js_file.write(Templates.backend_js.substitute(None,
-    domainInitializers=&quot;&quot;.join(Generator.backend_js_domain_initializer_list)))
-
-backend_h_file.close()
-backend_cpp_file.close()
-
-frontend_h_file.close()
-frontend_cpp_file.close()
-
-typebuilder_h_file.close()
-typebuilder_cpp_file.close()
-
-backend_js_file.close()
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsCodeGeneratorInspectorStringspy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,348 +0,0 @@
</span><del>-# Copyright (c) 2013 Google Inc. All rights reserved.
-# Copyright (c) 2013 Apple Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This file contains string resources for CodeGeneratorInspector.
-# Its syntax is a Python syntax subset, suitable for manual parsing.
-
-frontend_domain_class = (
-&quot;&quot;&quot;class ${exportMacro} ${domainClassName} {
-public:
-    ${domainClassName}(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
-${frontendDomainMethodDeclarations}private:
-    InspectorFrontendChannel* m_inspectorFrontendChannel;
-};
-
-&quot;&quot;&quot;)
-
-backend_dispatcher_constructor = (
-&quot;&quot;&quot;PassRefPtr&lt;${dispatcherName}&gt; ${dispatcherName}::create(InspectorBackendDispatcher* backendDispatcher, ${agentName}* agent)
-{
-    return adoptRef(new ${dispatcherName}(backendDispatcher, agent));
-}
-
-${dispatcherName}::${dispatcherName}(InspectorBackendDispatcher* backendDispatcher, ${agentName}* agent)
-    : InspectorSupplementalBackendDispatcher(backendDispatcher)
-    , m_agent(agent)
-{
-    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;${domainName}&quot;), this);
-}
-&quot;&quot;&quot;)
-
-backend_dispatcher_dispatch_method_simple = (
-&quot;&quot;&quot;void ${dispatcherName}::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
-{
-    Ref&lt;${dispatcherName}&gt; protect(*this);
-
-${ifChain}
-    else
-        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;${domainName}&quot; + '.' + method + &quot;' was not found&quot;);
-}
-&quot;&quot;&quot;)
-
-backend_dispatcher_dispatch_method = (
-&quot;&quot;&quot;void ${dispatcherName}::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
-{
-    Ref&lt;${dispatcherName}&gt; protect(*this);
-
-    typedef void (${dispatcherName}::*CallHandler)(long callId, const Inspector::InspectorObject&amp; message);
-    typedef HashMap&lt;String, CallHandler&gt; DispatchMap;
-    DEPRECATED_DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, ());
-    if (dispatchMap.isEmpty()) {
-        static const struct MethodTable {
-            const char* name;
-            CallHandler handler;
-        } commands[] = {
-${dispatcherCommands}
-        };
-        size_t length = WTF_ARRAY_LENGTH(commands);
-        for (size_t i = 0; i &lt; length; ++i)
-            dispatchMap.add(commands[i].name, commands[i].handler);
-    }
-
-    HashMap&lt;String, CallHandler&gt;::iterator it = dispatchMap.find(method);
-    if (it == dispatchMap.end()) {
-        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;${domainName}&quot; + '.' + method + &quot;' was not found&quot;);
-        return;
-    }
-
-    ((*this).*it-&gt;value)(callId, *message.get());
-}
-&quot;&quot;&quot;)
-
-backend_method = (
-&quot;&quot;&quot;void ${dispatcherName}::${methodName}(long callId, const InspectorObject&amp;${requestMessageObject})
-{
-${methodInParametersHandling}${methodDispatchHandling}${methodOutParametersHandling}${methodEndingHandling}
-}
-&quot;&quot;&quot;)
-
-frontend_method = (&quot;&quot;&quot;void Inspector${domainName}FrontendDispatcher::${eventName}(${parameters})
-{
-    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
-    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;${domainName}.${eventName}&quot;));
-${code}
-    m_inspectorFrontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());
-}
-&quot;&quot;&quot;)
-
-callback_method = (
-&quot;&quot;&quot;${handlerName}::${callbackName}::${callbackName}(PassRefPtr&lt;InspectorBackendDispatcher&gt; backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
-
-void ${handlerName}::${callbackName}::sendSuccess(${parameters})
-{
-    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
-${code}    sendIfActive(jsonMessage, ErrorString());
-}
-&quot;&quot;&quot;)
-
-frontend_h = (
-&quot;&quot;&quot;#ifndef Inspector${outputFileNamePrefix}FrontendDispatchers_h
-#define Inspector${outputFileNamePrefix}FrontendDispatchers_h
-
-#include &quot;Inspector${outputFileNamePrefix}TypeBuilders.h&quot;
-#include &lt;inspector/InspectorFrontendChannel.h&gt;
-#include &lt;inspector/InspectorValues.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace Inspector {
-
-#if ENABLE(INSPECTOR)
-
-${domainClassList}
-
-#endif // ENABLE(INSPECTOR)
-
-} // namespace Inspector
-
-#endif // !defined(Inspector${outputFileNamePrefix}FrontendDispatchers_h)
-&quot;&quot;&quot;)
-
-backend_h = (
-&quot;&quot;&quot;#ifndef Inspector${outputFileNamePrefix}BackendDispatchers_h
-#define Inspector${outputFileNamePrefix}BackendDispatchers_h
-
-#if ENABLE(INSPECTOR)
-
-#include &quot;Inspector${outputFileNamePrefix}TypeBuilders.h&quot;
-#include &lt;inspector/InspectorBackendDispatcher.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace Inspector {
-
-typedef String ErrorString;
-
-${handlerInterfaces}
-
-${dispatcherInterfaces}
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-
-#endif // !defined(Inspector${outputFileNamePrefix}BackendDispatchers_h)
-&quot;&quot;&quot;)
-
-backend_cpp = (
-&quot;&quot;&quot;
-#include &quot;config.h&quot;
-
-#if ENABLE(INSPECTOR)
-
-#include &quot;Inspector${outputFileNamePrefix}BackendDispatchers.h&quot;
-
-#include &lt;inspector/InspectorFrontendChannel.h&gt;
-#include &lt;inspector/InspectorValues.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace Inspector {
-
-${handlerImplementations}
-
-${methods}
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-&quot;&quot;&quot;)
-
-frontend_cpp = (
-&quot;&quot;&quot;
-
-#include &quot;config.h&quot;
-
-#if ENABLE(INSPECTOR)
-
-#include &quot;Inspector${outputFileNamePrefix}FrontendDispatchers.h&quot;
-
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace Inspector {
-
-${methods}
-
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-&quot;&quot;&quot;)
-
-typebuilder_h = (
-&quot;&quot;&quot;
-#ifndef Inspector${outputFileNamePrefix}TypeBuilders_h
-#define Inspector${outputFileNamePrefix}TypeBuilders_h
-
-#if ENABLE(INSPECTOR)
-
-#include &lt;inspector/InspectorTypeBuilder.h&gt;
-${typeBuilderDependencies}
-#include &lt;wtf/Assertions.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-
-namespace Inspector {
-
-namespace TypeBuilder {
-
-${forwards}
-
-${exportMacro} String get${outputFileNamePrefix}EnumConstantValue(int code);
-
-${typeBuilders}
-} // namespace TypeBuilder
-
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-
-#endif // !defined(Inspector${outputFileNamePrefix}TypeBuilders_h)
-
-&quot;&quot;&quot;)
-
-typebuilder_cpp = (
-&quot;&quot;&quot;
-
-#include &quot;config.h&quot;
-#include &quot;Inspector${outputFileNamePrefix}TypeBuilders.h&quot;
-
-#if ENABLE(INSPECTOR)
-
-#include &lt;wtf/text/CString.h&gt;
-
-namespace Inspector {
-
-namespace TypeBuilder {
-
-static const char* const enum_constant_values[] = {
-${enumConstantValues}};
-
-String get${outputFileNamePrefix}EnumConstantValue(int code) {
-    return enum_constant_values[code];
-}
-
-} // namespace TypeBuilder
-
-${implCode}
-
-#if ${validatorIfdefName}
-
-${validatorCode}
-
-#endif // ${validatorIfdefName}
-
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-&quot;&quot;&quot;)
-
-backend_js = (
-&quot;&quot;&quot;
-
-${domainInitializers}
-&quot;&quot;&quot;)
-
-param_container_access_code = &quot;&quot;&quot;
-    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(&quot;params&quot;);
-    InspectorObject* paramsContainerPtr = paramsContainer.get();
-    InspectorArray* protocolErrorsPtr = protocolErrors.get();
-&quot;&quot;&quot;
-
-class_binding_builder_part_1 = (
-&quot;&quot;&quot;        AllFieldsSet = %s
-    };
-
-    template&lt;int STATE&gt;
-    class Builder {
-    private:
-        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
-
-        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
-        {
-            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
-        }
-
-        Builder(PassRefPtr&lt;/*%s*/Inspector::InspectorObject&gt; ptr)
-        {
-            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
-            m_result = ptr;
-        }
-        friend class %s;
-    public:
-&quot;&quot;&quot;)
-
-class_binding_builder_part_2 = (&quot;&quot;&quot;
-        Builder&lt;STATE | %s&gt;&amp; set%s(%s value)
-        {
-            COMPILE_ASSERT(!(STATE &amp; %s), property_%s_already_set);
-            m_result-&gt;set%s(ASCIILiteral(&quot;%s&quot;), %s);
-            return castState&lt;%s&gt;();
-        }
-&quot;&quot;&quot;)
-
-class_binding_builder_part_3 = (&quot;&quot;&quot;
-        operator RefPtr&lt;%s&gt;&amp; ()
-        {
-            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
-            COMPILE_ASSERT(sizeof(%s) == sizeof(Inspector::InspectorObject), cannot_cast);
-            return *reinterpret_cast&lt;RefPtr&lt;%s&gt;*&gt;(&amp;m_result);
-        }
-
-        PassRefPtr&lt;%s&gt; release()
-        {
-            return RefPtr&lt;%s&gt;(*this).release();
-        }
-    };
-
-&quot;&quot;&quot;)
-
-class_binding_builder_part_4 = (
-&quot;&quot;&quot;    static Builder&lt;NoFieldsSet&gt; create()
-    {
-        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
-    }
-&quot;&quot;&quot;)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegen__init__py"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+# Required for Python to search this directory for module files
+
+from models import *
+from generator import *
+
+from generate_backend_commands import *
+from generate_backend_dispatcher_header import *
+from generate_backend_dispatcher_implementation import *
+from generate_frontend_dispatcher_header import *
+from generate_frontend_dispatcher_implementation import *
+from generate_type_builder_header import *
+from generate_type_builder_implementation import *
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_commandspy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import EnumType
+
+log = logging.getLogger('global')
+
+
+class BackendCommandsGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sBackendCommands.js&quot; % self.model().framework.setting('prefix')
+
+    def domains_to_generate(self):
+        def should_generate_domain(domain):
+            domain_enum_types = filter(lambda declaration: isinstance(declaration.type, EnumType), domain.type_declarations)
+            return len(domain.commands) &gt; 0 or len(domain.events) &gt; 0 or len(domain_enum_types) &gt; 0
+
+        return filter(should_generate_domain, Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        sections = []
+        sections.append(self.generate_license())
+        sections.extend(map(self.generate_domain, self.domains_to_generate()))
+        return &quot;\n\n&quot;.join(sections)
+
+    def generate_domain(self, domain):
+        lines = []
+        args = {
+            'domain': domain.domain_name
+        }
+
+        lines.append('// %(domain)s.' % args)
+
+        has_async_commands = any(map(lambda command: command.is_async, domain.commands))
+        if len(domain.events) &gt; 0 or has_async_commands:
+            lines.append('InspectorBackend.register%(domain)sDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, &quot;%(domain)s&quot;);' % args)
+
+        for declaration in domain.type_declarations:
+            if declaration.type.is_enum():
+                enum_args = {
+                    'domain': domain.domain_name,
+                    'enumName': declaration.type_name,
+                    'enumMap': &quot;, &quot;.join(['%s: &quot;%s&quot;' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in declaration.type.enum_values()])
+                }
+                lines.append('InspectorBackend.registerEnum(&quot;%(domain)s.%(enumName)s&quot;, {%(enumMap)s});' % enum_args)
+
+            def is_anonymous_enum_member(type_member):
+                return isinstance(type_member.type, EnumType) and type_member.type.is_anonymous
+
+            for _member in filter(is_anonymous_enum_member, declaration.type_members):
+                enum_args = {
+                    'domain': domain.domain_name,
+                    'enumName': '%s%s' % (declaration.type_name, ucfirst(_member.member_name)),
+                    'enumMap': &quot;, &quot;.join(['%s: &quot;%s&quot;' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in _member.type.enum_values()])
+                }
+                lines.append('InspectorBackend.registerEnum(&quot;%(domain)s.%(enumName)s&quot;, {%(enumMap)s});' % enum_args)
+
+        for event in domain.events:
+            event_args = {
+                'domain': domain.domain_name,
+                'eventName': event.event_name,
+                'params': &quot;, &quot;.join(['&quot;%s&quot;' % parameter.parameter_name for parameter in event.event_parameters])
+            }
+            lines.append('InspectorBackend.registerEvent(&quot;%(domain)s.%(eventName)s&quot;, [%(params)s]);' % event_args)
+
+        for command in domain.commands:
+
+            def generate_parameter_object(parameter):
+                optional_string = &quot;true&quot; if parameter.is_optional else &quot;false&quot;
+                pairs = []
+                pairs.append('&quot;name&quot;: &quot;%s&quot;' % parameter.parameter_name)
+                pairs.append('&quot;type&quot;: &quot;%s&quot;' % Generator.js_name_for_parameter_type(parameter.type))
+                pairs.append('&quot;optional&quot;: %s' % optional_string)
+                return &quot;{%s}&quot; % &quot;, &quot;.join(pairs)
+
+            command_args = {
+                'domain': domain.domain_name,
+                'commandName': command.command_name,
+                'callParams': &quot;, &quot;.join([generate_parameter_object(parameter) for parameter in command.call_parameters]),
+                'returnParams': &quot;, &quot;.join(['&quot;%s&quot;' % parameter.parameter_name for parameter in command.return_parameters]),
+            }
+            lines.append('InspectorBackend.registerCommand(&quot;%(domain)s.%(commandName)s&quot;, [%(callParams)s], [%(returnParams)s]);' % command_args)
+
+        return &quot;\n&quot;.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_headerpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import re
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import EnumType
+
+log = logging.getLogger('global')
+
+
+class BackendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sBackendDispatchers.h&quot; % self.model().framework.setting('prefix')
+
+    def domains_to_generate(self):
+        return filter(lambda domain: len(domain.commands) &gt; 0, Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        headers = [
+            '&quot;Inspector%sTypeBuilders.h&quot;' % self.model().framework.setting('prefix'),
+            '&lt;inspector/InspectorBackendDispatcher.h&gt;',
+            '&lt;wtf/PassRefPtr.h&gt;',
+            '&lt;wtf/text/WTFString.h&gt;']
+
+        typedefs = [('String', 'ErrorString')]
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in headers]),
+            'typedefs': '\n'.join(['typedef %s %s;' % typedef for typedef in typedefs]),
+            'inputFilename': self._input_filepath
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppHeaderPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_handler_declarations_for_domain, self.domains_to_generate()))
+        sections.extend(map(self._generate_dispatcher_declarations_for_domain, self.domains_to_generate()))
+        sections.append(Template(Templates.CppHeaderPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_handler_declarations_for_domain(self, domain):
+        classComponents = ['class']
+        exportMacro = self.model().framework.setting('export_macro', None)
+        if exportMacro is not None:
+            classComponents.append(exportMacro)
+
+        used_enum_names = set()
+
+        command_declarations = []
+        for command in domain.commands:
+            command_declarations.append(self._generate_handler_declaration_for_command(command, used_enum_names))
+
+        handler_args = {
+            'classAndExportMacro': &quot; &quot;.join(classComponents),
+            'domainName': domain.domain_name,
+            'commandDeclarations': &quot;\n&quot;.join(command_declarations)
+        }
+
+        return Generator.wrap_with_guard_for_domain(domain, Template(Templates.BackendDispatcherHeaderDomainHandlerDeclaration).substitute(None, **handler_args))
+
+    def _generate_anonymous_enum_for_parameter(self, parameter, command):
+        enum_args = {
+            'parameterName': parameter.parameter_name,
+            'commandName': command.command_name
+        }
+
+        lines = []
+        lines.append('    // Named after parameter \'%(parameterName)s\' while generating command/event %(commandName)s.' % enum_args)
+        lines.append('    enum class %s {' % ucfirst(parameter.parameter_name))
+        for enum_value in parameter.type.enum_values():
+            lines.append('        %s = %d,' % (Generator.stylized_name_for_enum_value(enum_value), self.encoding_for_enum_value(enum_value)))
+        lines.append('    }; // enum class %s' % ucfirst(parameter.parameter_name))
+        return '\n'.join(lines)
+
+    def _generate_handler_declaration_for_command(self, command, used_enum_names):
+        if command.is_async:
+            return self._generate_async_handler_declaration_for_command(command)
+
+        lines = []
+        parameters = ['ErrorString*']
+        for _parameter in command.call_parameters:
+            parameters.append(&quot;%s in_%s&quot; % (Generator.type_string_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
+
+            if isinstance(_parameter.type, EnumType) and _parameter.parameter_name not in used_enum_names:
+                lines.append(self._generate_anonymous_enum_for_parameter(_parameter, command))
+                used_enum_names.add(_parameter.parameter_name)
+
+        for _parameter in command.return_parameters:
+            parameter_name = 'out_' + _parameter.parameter_name
+            if _parameter.is_optional:
+                parameter_name = 'opt_' + parameter_name
+            parameters.append(&quot;%s %s&quot; % (Generator.type_string_for_formal_out_parameter(_parameter), parameter_name))
+
+            if isinstance(_parameter.type, EnumType) and _parameter.parameter_name not in used_enum_names:
+                lines.append(self._generate_anonymous_enum_for_parameter(_parameter, command))
+                used_enum_names.add(_parameter.parameter_name)
+
+        command_args = {
+            'commandName': command.command_name,
+            'parameters': &quot;, &quot;.join(parameters)
+        }
+        lines.append('    virtual void %(commandName)s(%(parameters)s) = 0;' % command_args)
+        return '\n'.join(lines)
+
+    def _generate_async_handler_declaration_for_command(self, command):
+        callbackName = &quot;%sCallback&quot; % ucfirst(command.command_name)
+
+        in_parameters = ['ErrorString*']
+        for _parameter in command.call_parameters:
+            in_parameters.append(&quot;%s in_%s&quot; % (Generator.type_string_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
+        in_parameters.append(&quot;PassRefPtr&lt;%s&gt; callback&quot; % callbackName)
+
+        out_parameters = []
+        for _parameter in command.return_parameters:
+            out_parameters.append(&quot;%s %s&quot; % (Generator.type_string_for_formal_async_parameter(_parameter), _parameter.parameter_name))
+
+        command_args = {
+            'callbackName': callbackName,
+            'commandName': command.command_name,
+            'inParameters': &quot;, &quot;.join(in_parameters),
+            'outParameters': &quot;, &quot;.join(out_parameters),
+        }
+
+        return Template(Templates.BackendDispatcherHeaderAsyncCommandDeclaration).substitute(None, **command_args)
+
+    def _generate_dispatcher_declarations_for_domain(self, domain):
+        classComponents = ['class']
+        exportMacro = self.model().framework.setting('export_macro', None)
+        if exportMacro is not None:
+            classComponents.append(exportMacro)
+
+        declarations = []
+        if len(domain.commands) &gt; 0:
+            declarations.append('private:')
+        declarations.extend(map(self._generate_dispatcher_declaration_for_command, domain.commands))
+
+        handler_args = {
+            'classAndExportMacro': &quot; &quot;.join(classComponents),
+            'domainName': domain.domain_name,
+            'commandDeclarations': &quot;\n&quot;.join(declarations)
+        }
+
+        return Generator.wrap_with_guard_for_domain(domain, Template(Templates.BackendDispatcherHeaderDomainDispatcherDeclaration).substitute(None, **handler_args))
+
+    def _generate_dispatcher_declaration_for_command(self, command):
+        return &quot;    void %s(long callId, const Inspector::InspectorObject&amp; message);&quot; % command.command_name
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_implementationpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,269 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import ObjectType, ArrayType
+
+log = logging.getLogger('global')
+
+
+class BackendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sBackendDispatchers.cpp&quot; % self.model().framework.setting('prefix')
+
+    def domains_to_generate(self):
+        return filter(lambda domain: len(domain.commands) &gt; 0, Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        secondary_headers = [
+            '&lt;inspector/InspectorFrontendChannel.h&gt;',
+            '&lt;inspector/InspectorValues.h&gt;',
+            '&lt;wtf/text/CString.h&gt;']
+
+        header_args = {
+            'primaryInclude': '&quot;Inspector%sBackendDispatchers.h&quot;' % self.model().framework.setting('prefix'),
+            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
+            'inputFilename': self._input_filepath
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppImplementationPrelude).substitute(None, **header_args))
+        sections.append(&quot;\n&quot;.join(map(self._generate_handler_class_destructor_for_domain, self.domains_to_generate())))
+        sections.extend(map(self._generate_dispatcher_implementations_for_domain, self.domains_to_generate()))
+        sections.append(Template(Templates.CppImplementationPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_handler_class_destructor_for_domain(self, domain):
+        destructor_args = {
+            'domainName': domain.domain_name
+        }
+        destructor = 'Inspector%(domainName)sBackendDispatcherHandler::~Inspector%(domainName)sBackendDispatcherHandler() { }' % destructor_args
+        return Generator.wrap_with_guard_for_domain(domain, destructor)
+
+    def _generate_dispatcher_implementations_for_domain(self, domain):
+        implementations = []
+
+        constructor_args = {
+            'domainName': domain.domain_name,
+        }
+        implementations.append(Template(Templates.BackendDispatcherImplementationDomainConstructor).substitute(None, **constructor_args))
+
+        if len(domain.commands) &lt;= 5:
+            implementations.append(self._generate_small_dispatcher_switch_implementation_for_domain(domain))
+        else:
+            implementations.append(self._generate_large_dispatcher_switch_implementation_for_domain(domain))
+
+        for command in domain.commands:
+            if command.is_async:
+                implementations.append(self._generate_async_dispatcher_class_for_domain(command, domain))
+            implementations.append(self._generate_dispatcher_implementation_for_command(command, domain))
+
+        return Generator.wrap_with_guard_for_domain(domain, &quot;\n\n&quot;.join(implementations))
+
+    def _generate_small_dispatcher_switch_implementation_for_domain(self, domain):
+        cases = []
+        cases.append('    if (method == &quot;%s&quot;)' % domain.commands[0].command_name)
+        cases.append('        %s(callId, *message.get());' % domain.commands[0].command_name)
+        for command in domain.commands[1:]:
+            cases.append('    else if (method == &quot;%s&quot;)' % command.command_name)
+            cases.append('        %s(callId, *message.get());' % command.command_name)
+
+        switch_args = {
+            'domainName': domain.domain_name,
+            'dispatchCases': &quot;\n&quot;.join(cases)
+        }
+
+        return Template(Templates.BackendDispatcherImplementationSmallSwitch).substitute(None, **switch_args)
+
+    def _generate_large_dispatcher_switch_implementation_for_domain(self, domain):
+        cases = []
+        for command in domain.commands:
+            args = {
+                'domainName': domain.domain_name,
+                'commandName': command.command_name
+            }
+            cases.append('            { &quot;%(commandName)s&quot;, &amp;Inspector%(domainName)sBackendDispatcher::%(commandName)s },' % args)
+
+        switch_args = {
+            'domainName': domain.domain_name,
+            'dispatchCases': &quot;\n&quot;.join(cases)
+        }
+
+        return Template(Templates.BackendDispatcherImplementationLargeSwitch).substitute(None, **switch_args)
+
+    def _generate_async_dispatcher_class_for_domain(self, command, domain):
+        out_parameter_assignments = []
+        formal_parameters = []
+
+        for parameter in command.return_parameters:
+            param_args = {
+                'frameworkPrefix': self.model().framework.setting('prefix'),
+                'keyedSetMethod': Generator.keyed_set_method_for_type(parameter.type),
+                'parameterName': parameter.parameter_name,
+                'parameterType': Generator.type_string_for_stack_in_parameter(parameter),
+            }
+
+            formal_parameters.append('%s %s' % (Generator.type_string_for_formal_async_parameter(parameter), parameter.parameter_name))
+
+            if parameter.is_optional:
+                if Generator.should_use_wrapper_for_return_type(parameter.type):
+                    out_parameter_assignments.append('    if (%(parameterName)s.isAssigned())' % param_args)
+                    out_parameter_assignments.append('        jsonMessage-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), %(parameterName)s.getValue());' % param_args)
+                else:
+                    out_parameter_assignments.append('    if (%(parameterName)s)' % param_args)
+                    out_parameter_assignments.append('        jsonMessage-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), %(parameterName)s);' % param_args)
+            elif parameter.type.is_enum():
+                out_parameter_assignments.append('    jsonMessage-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), Inspector::TypeBuilder::get%(frameworkPrefix)sEnumConstantValue(%(parameterName)s));' % param_args)
+            else:
+                out_parameter_assignments.append('    jsonMessage-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), %(parameterName)s);' % param_args)
+
+        async_args = {
+            'domainName': domain.domain_name,
+            'callbackName': ucfirst(command.command_name) + 'Callback',
+            'formalParameters': &quot;, &quot;.join(formal_parameters),
+            'outParameterAssignments': &quot;\n&quot;.join(out_parameter_assignments)
+        }
+        return Template(Templates.BackendDispatcherImplementationAsyncCommand).substitute(None, **async_args)
+
+    def _generate_dispatcher_implementation_for_command(self, command, domain):
+        in_parameter_declarations = []
+        out_parameter_declarations = []
+        out_parameter_assignments = []
+        method_parameters = ['&amp;error']
+
+        for parameter in command.call_parameters:
+            out_success_argument = 'nullptr'
+            if parameter.is_optional:
+                out_success_argument = '&amp;%s_valueFound' % parameter.parameter_name
+                in_parameter_declarations.append('    bool %s_valueFound = false;' % parameter.parameter_name)
+
+            param_args = {
+                'parameterType': Generator.type_string_for_stack_in_parameter(parameter),
+                'parameterName': parameter.parameter_name,
+                'keyedGetMethod': Generator.keyed_get_method_for_type(parameter.type),
+                'successOutParam': out_success_argument
+            }
+
+            in_parameter_declarations.append('    %(parameterType)s in_%(parameterName)s = InspectorBackendDispatcher::%(keyedGetMethod)s(paramsContainerPtr, ASCIILiteral(&quot;%(parameterName)s&quot;), %(successOutParam)s, protocolErrorsPtr);' % param_args)
+
+            if parameter.is_optional:
+                method_parameters.append('%(parameterName)s_valueFound ? &amp;in_%(parameterName)s : nullptr' % param_args)
+            else:
+                method_parameters.append('in_' + parameter.parameter_name)
+
+        if command.is_async:
+            async_args = {
+                'domainName': domain.domain_name,
+                'callbackName': ucfirst(command.command_name) + 'Callback'
+            }
+
+            out_parameter_assignments.append('        callback-&gt;disable();')
+            out_parameter_assignments.append('        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, Inspector::InspectorBackendDispatcher::ServerError, error);')
+            out_parameter_assignments.append('        return;')
+            method_parameters.append('callback')
+
+        else:
+            for parameter in command.return_parameters:
+                param_args = {
+                    'parameterType': Generator.type_string_for_stack_out_parameter(parameter),
+                    'parameterName': parameter.parameter_name,
+                    'keyedSetMethod': Generator.keyed_set_method_for_type(parameter.type),
+                    'frameworkPrefix': self.model().framework.setting('prefix')
+                }
+
+                out_parameter_declarations.append('    %(parameterType)s out_%(parameterName)s;' % param_args)
+                if parameter.is_optional:
+                    if Generator.should_use_wrapper_for_return_type(parameter.type):
+                        out_parameter_assignments.append('        if (out_%(parameterName)s.isAssigned())' % param_args)
+                        out_parameter_assignments.append('            result-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), out_%(parameterName)s.getValue());' % param_args)
+                    else:
+                        out_parameter_assignments.append('        if (out_%(parameterName)s)' % param_args)
+                        out_parameter_assignments.append('            result-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), out_%(parameterName)s);' % param_args)
+                elif parameter.type.is_enum():
+                    out_parameter_assignments.append('        result-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), Inspector::TypeBuilder::get%(frameworkPrefix)sEnumConstantValue(out_%(parameterName)s));' % param_args)
+                else:
+                    out_parameter_assignments.append('        result-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), out_%(parameterName)s);' % param_args)
+
+                if Generator.should_pass_by_copy_for_return_type(parameter.type):
+                    method_parameters.append('out_' + parameter.parameter_name)
+                else:
+                    method_parameters.append('&amp;out_' + parameter.parameter_name)
+
+        command_args = {
+            'domainName': domain.domain_name,
+            'callbackName': '%sCallback' % ucfirst(command.command_name),
+            'commandName': command.command_name,
+            'inParameterDeclarations': &quot;\n&quot;.join(in_parameter_declarations),
+            'invocationParameters': &quot;, &quot;.join(method_parameters)
+        }
+
+        lines = []
+        if len(command.call_parameters) == 0:
+            lines.append('void Inspector%(domainName)sBackendDispatcher::%(commandName)s(long callId, const InspectorObject&amp;)' % command_args)
+        else:
+            lines.append('void Inspector%(domainName)sBackendDispatcher::%(commandName)s(long callId, const InspectorObject&amp; message)' % command_args)
+        lines.append('{')
+
+        if len(command.call_parameters) &gt; 0:
+            lines.append(Template(Templates.BackendDispatcherImplementationPrepareCommandArguments).substitute(None, **command_args))
+
+        lines.append('    ErrorString error;')
+        lines.append('    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();')
+        if command.is_async:
+            lines.append('    RefPtr&lt;Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s&gt; callback = adoptRef(new Inspector%(domainName)sBackendDispatcherHandler::%(callbackName)s(m_backendDispatcher,callId));' % command_args)
+        if len(command.return_parameters) &gt; 0:
+            lines.extend(out_parameter_declarations)
+        lines.append('    m_agent-&gt;%(commandName)s(%(invocationParameters)s);' % command_args)
+        lines.append('')
+        if command.is_async:
+            lines.append('    if (error.length()) {')
+            lines.extend(out_parameter_assignments)
+            lines.append('    }')
+        elif len(command.return_parameters) &gt; 1:
+            lines.append('    if (!error.length()) {')
+            lines.extend(out_parameter_assignments)
+            lines.append('    }')
+        elif len(command.return_parameters) == 1:
+            lines.append('    if (!error.length())')
+            lines.extend(out_parameter_assignments)
+            lines.append('')
+
+        if not command.is_async:
+            lines.append('    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);')
+        lines.append('}')
+        return &quot;\n&quot;.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_headerpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import re
+import string
+from string import Template
+
+from models import EnumType
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+
+log = logging.getLogger('global')
+
+
+class FrontendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sFrontendDispatchers.h&quot; % self.model().framework.setting('prefix')
+
+    def domains_to_generate(self):
+        return filter(lambda domain: len(domain.events) &gt; 0, Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        headers = [
+            '&quot;Inspector%sTypeBuilders.h&quot;' % self.model().framework.setting('prefix'),
+            '&lt;inspector/InspectorFrontendChannel.h&gt;',
+            '&lt;inspector/InspectorValues.h&gt;',
+            '&lt;wtf/PassRefPtr.h&gt;',
+            '&lt;wtf/text/WTFString.h&gt;']
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in headers]),
+            'typedefs': '',
+            'inputFilename': self._input_filepath
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppHeaderPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_dispatcher_declarations_for_domain, self.domains_to_generate()))
+        sections.append(Template(Templates.CppHeaderPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_anonymous_enum_for_parameter(self, parameter, event):
+        enum_args = {
+            'parameterName': parameter.parameter_name,
+            'eventName': event.event_name
+        }
+
+        lines = []
+        lines.append('        // Named after parameter \'%(parameterName)s\' while generating command/event %(eventName)s.' % enum_args)
+        lines.append('        enum class %s {' % ucfirst(parameter.parameter_name))
+        for enum_value in parameter.type.enum_values():
+            lines.append('            %s = %d,' % (Generator.stylized_name_for_enum_value(enum_value), self.encoding_for_enum_value(enum_value)))
+        lines.append('        }; // enum class %s' % ucfirst(parameter.parameter_name))
+        return &quot;\n&quot;.join(lines)
+
+    def _generate_dispatcher_declarations_for_domain(self, domain):
+        classComponents = ['class']
+        exportMacro = self.model().framework.setting('export_macro', None)
+        if exportMacro is not None:
+            classComponents.append(exportMacro)
+
+        used_enum_names = set([])
+
+        event_declarations = []
+        for event in domain.events:
+            event_declarations.append(self._generate_dispatcher_declaration_for_event(event, domain, used_enum_names))
+
+        handler_args = {
+            'classAndExportMacro': &quot; &quot;.join(classComponents),
+            'domainName': domain.domain_name,
+            'eventDeclarations': &quot;\n&quot;.join(event_declarations)
+        }
+
+        return Generator.wrap_with_guard_for_domain(domain, Template(Templates.FrontendDispatcherDomainDispatcherDeclaration).substitute(None, **handler_args))
+
+    def _generate_dispatcher_declaration_for_event(self, event, domain, used_enum_names):
+        formal_parameters = []
+        lines = []
+        for parameter in event.event_parameters:
+            formal_parameters.append('%s %s' % (Generator.type_string_for_checked_formal_event_parameter(parameter), parameter.parameter_name))
+            if isinstance(parameter.type, EnumType) and parameter.parameter_name not in used_enum_names:
+                lines.append(self._generate_anonymous_enum_for_parameter(parameter, event))
+                used_enum_names.add(parameter.parameter_name)
+
+        lines.append(&quot;    void %s(%s);&quot; % (event.event_name, &quot;, &quot;.join(formal_parameters)))
+        return &quot;\n&quot;.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_implementationpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import ObjectType, ArrayType
+
+log = logging.getLogger('global')
+
+
+class FrontendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sFrontendDispatchers.cpp&quot; % self.model().framework.setting('prefix')
+
+    def domains_to_generate(self):
+        return filter(lambda domain: len(domain.events) &gt; 0, Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        secondary_headers = ['&lt;wtf/text/CString.h&gt;']
+
+        header_args = {
+            'primaryInclude': '&quot;Inspector%sFrontendDispatchers.h&quot;' % self.model().framework.setting('prefix'),
+            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
+            'inputFilename': self._input_filepath
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppImplementationPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_dispatcher_implementations_for_domain, self.domains_to_generate()))
+        sections.append(Template(Templates.CppImplementationPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_dispatcher_implementations_for_domain(self, domain):
+        implementations = []
+        for event in domain.events:
+            implementations.append(self._generate_dispatcher_implementation_for_event(event, domain))
+
+        return Generator.wrap_with_guard_for_domain(domain, &quot;\n\n&quot;.join(implementations))
+
+    def _generate_dispatcher_implementation_for_event(self, event, domain):
+        lines = []
+        parameter_assignments = []
+        formal_parameters = []
+
+        for parameter in event.event_parameters:
+
+            parameter_value = parameter.parameter_name
+            if parameter.is_optional and not Generator.should_pass_by_copy_for_return_type(parameter.type):
+                parameter_value = '*' + parameter_value
+            if parameter.type.is_enum():
+                framework_prefix = self.model().framework.setting('prefix')
+                parameter_value = 'Inspector::TypeBuilder::get%sEnumConstantValue(%s)' % (framework_prefix, parameter_value)
+
+            parameter_args = {
+                'parameterType': Generator.type_string_for_stack_out_parameter(parameter),
+                'parameterName': parameter.parameter_name,
+                'parameterValue': parameter_value,
+                'keyedSetMethod': Generator.keyed_set_method_for_type(parameter.type),
+            }
+
+            if parameter.is_optional:
+                parameter_assignments.append('    if (%(parameterName)s)' % parameter_args)
+                parameter_assignments.append('        paramsObject-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), %(parameterValue)s);' % parameter_args)
+            else:
+                parameter_assignments.append('    paramsObject-&gt;%(keyedSetMethod)s(ASCIILiteral(&quot;%(parameterName)s&quot;), %(parameterValue)s);' % parameter_args)
+
+            formal_parameters.append('%s %s' % (Generator.type_string_for_checked_formal_event_parameter(parameter), parameter.parameter_name))
+
+        event_args = {
+            'domainName': domain.domain_name,
+            'eventName': event.event_name,
+            'formalParameters': &quot;, &quot;.join(formal_parameters)
+        }
+
+        lines.append('void Inspector%(domainName)sFrontendDispatcher::%(eventName)s(%(formalParameters)s)' % event_args)
+        lines.append('{')
+        lines.append('    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();')
+        lines.append('    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;%(domainName)s.%(eventName)s&quot;));' % event_args)
+
+        if len(parameter_assignments) &gt; 0:
+            lines.append('    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();')
+            lines.extend(parameter_assignments)
+            lines.append('    jsonMessage-&gt;setObject(ASCIILiteral(&quot;params&quot;), paramsObject);')
+
+        lines.append('')
+        lines.append('    m_inspectorFrontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());')
+        lines.append('}')
+        return &quot;\n&quot;.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_type_builder_headerpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_header.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_header.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,346 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import re
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import EnumType, ObjectType, PrimitiveType, AliasedType, ArrayType, Frameworks
+
+log = logging.getLogger('global')
+
+
+class TypeBuilderHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sTypeBuilders.h&quot; % self.model().framework.setting('prefix')
+
+    def generate_output(self):
+        domains = self.domains_to_generate()
+        self.calculate_types_requiring_shape_assertions(domains)
+
+        headers = set([
+            '&lt;inspector/InspectorTypeBuilder.h&gt;',
+            '&lt;wtf/Assertions.h&gt;',
+            '&lt;wtf/PassRefPtr.h&gt;'
+        ])
+
+        if self.model().framework is not Frameworks.JavaScriptCore:
+            headers.add('&lt;inspector/InspectorJSTypeBuilders.h&gt;')
+
+        export_macro = self.model().framework.setting('export_macro', None)
+        framework_prefix = self.model().framework.setting('prefix')
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in sorted(headers)]),
+            'typedefs': '',
+            'inputFilename': self._input_filepath
+        }
+
+        return_type = 'String'
+        return_type_with_export_macro = [return_type]
+        if export_macro is not None:
+            return_type_with_export_macro[:0] = [export_macro]
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppHeaderPrelude).substitute(None, **header_args))
+        sections.append('namespace TypeBuilder {')
+        sections.append(self._generate_forward_declarations(domains))
+        sections.append(self._generate_typedefs(domains))
+        sections.append('%s get%sEnumConstantValue(int code);' % (' '.join(return_type_with_export_macro), framework_prefix))
+        sections.append('\n'.join([
+            'template&lt;typename T&gt; %s get%sEnumConstantValue(T enumValue)' % (return_type, framework_prefix),
+            '{',
+            '    return get%sEnumConstantValue(static_cast&lt;int&gt;(enumValue));' % framework_prefix,
+            '}']))
+
+        builder_sections = map(self._generate_builders_for_domain, domains)
+        sections.extend(filter(lambda section: len(section) &gt; 0, builder_sections))
+        sections.append(self._generate_forward_declarations_for_binding_traits())
+        sections.append('} // namespace TypeBuilder')
+        sections.append(Template(Templates.CppHeaderPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    # FIXME: move builders out of classes, uncomment forward declaration
+
+    def _generate_forward_declarations(self, domains):
+        sections = []
+
+        for domain in domains:
+            declaration_types = [decl.type for decl in domain.type_declarations]
+            object_types = filter(lambda _type: isinstance(_type, ObjectType), declaration_types)
+            enum_types = filter(lambda _type: isinstance(_type, EnumType), declaration_types)
+            if len(object_types) + len(enum_types) == 0:
+                continue
+
+            domain_lines = []
+            domain_lines.append('namespace %s {' % domain.domain_name)
+
+            object_type_names = [_type.raw_name() for _type in object_types]
+            enum_type_names = [_type.raw_name() for _type in enum_types]
+
+            # Forward-declare all classes so the type builders won't break if rearranged.
+            domain_lines.extend('class %s;' % name for name in sorted(object_type_names))
+            domain_lines.extend('enum class %s;' % name for name in sorted(enum_type_names))
+            domain_lines.append('} // %s' % domain.domain_name)
+            sections.append(Generator.wrap_with_guard_for_domain(domain, '\n'.join(domain_lines)))
+
+        if len(sections) == 0:
+            return ''
+        else:
+            return &quot;&quot;&quot;// Forward declarations.
+%s
+// End of forward declarations.
+&quot;&quot;&quot; % '\n\n'.join(sections)
+
+    def _generate_typedefs(self, domains):
+        sections = map(self._generate_typedefs_for_domain, domains)
+        sections = filter(lambda text: len(text) &gt; 0, sections)
+
+        if len(sections) == 0:
+            return ''
+        else:
+            return &quot;&quot;&quot;// Typedefs.
+%s
+// End of typedefs.&quot;&quot;&quot; % '\n\n'.join(sections)
+
+    def _generate_typedefs_for_domain(self, domain):
+        primitive_declarations = filter(lambda decl: isinstance(decl.type, AliasedType), domain.type_declarations)
+        if len(primitive_declarations) == 0:
+            return ''
+
+        sections = []
+        for declaration in primitive_declarations:
+            primitive_name = Generator.cpp_name_for_primitive_type(declaration.type.aliased_type)
+            typedef_lines = []
+            if len(declaration.description) &gt; 0:
+                typedef_lines.append('/* %s */' % declaration.description)
+            typedef_lines.append('typedef %s %s;' % (primitive_name, declaration.type_name))
+            sections.append('\n'.join(typedef_lines))
+
+        lines = []
+        lines.append('namespace %s {' % domain.domain_name)
+        lines.append('\n\n'.join(sections))
+        lines.append('} // %s' % domain.domain_name)
+        return Generator.wrap_with_guard_for_domain(domain, '\n'.join(lines))
+
+    def _generate_builders_for_domain(self, domain):
+        sections = []
+
+        for type_declaration in domain.type_declarations:
+            if isinstance(type_declaration.type, EnumType):
+                sections.append(self._generate_struct_for_enum_declaration(type_declaration))
+            elif isinstance(type_declaration.type, ObjectType):
+                sections.append(self._generate_class_for_object_declaration(type_declaration, domain))
+
+        sections = filter(lambda section: len(section) &gt; 0, sections)
+        if len(sections) == 0:
+            return ''
+
+        lines = []
+        lines.append('namespace %s {' % domain.domain_name)
+        lines.append('\n'.join(sections))
+        lines.append('} // %s' % domain.domain_name)
+        return Generator.wrap_with_guard_for_domain(domain, '\n'.join(lines))
+
+    def _generate_class_for_object_declaration(self, type_declaration, domain):
+        if len(type_declaration.type_members) == 0:
+            return ''
+
+        enum_members = filter(lambda member: isinstance(member.type, EnumType) and member.type.is_anonymous, type_declaration.type_members)
+        required_members = filter(lambda member: not member.is_optional, type_declaration.type_members)
+        optional_members = filter(lambda member: member.is_optional, type_declaration.type_members)
+        object_name = type_declaration.type_name
+
+        lines = []
+        if len(type_declaration.description) &gt; 0:
+            lines.append('/* %s */' % type_declaration.description)
+        base_class = 'Inspector::InspectorObject'
+        if not Generator.type_has_open_fields(type_declaration.type):
+            base_class = base_class + 'Base'
+        lines.append('class %s : public %s {' % (object_name, base_class))
+        lines.append('public:')
+        for enum_member in enum_members:
+            lines.append('    // Named after property name \'%s\' while generating %s.' % (enum_member.member_name, object_name))
+            lines.append(self._generate_struct_for_anonymous_enum_member(enum_member))
+        lines.append(self._generate_builder_state_enum(type_declaration))
+
+        constructor_example = []
+        constructor_example.append('     * RefPtr&lt;%s&gt; result = %s::create()' % (object_name, object_name))
+        for member in required_members:
+            constructor_example.append('     *     .set%s(...)' % ucfirst(member.member_name))
+
+        builder_args = {
+            'objectType': object_name,
+            'constructorExample': '\n'.join(constructor_example) + ';',
+        }
+
+        lines.append(Template(Templates.TypeBuilderDeclarationPrelude).substitute(None, **builder_args))
+        for type_member in required_members:
+            lines.append(self._generate_builder_setter_for_member(type_member, domain))
+        lines.append(Template(Templates.TypeBuilderDeclarationPostlude).substitute(None, **builder_args))
+        for member in optional_members:
+            lines.append(self._generate_unchecked_setter_for_member(member, domain))
+
+        if Generator.type_has_open_fields(type_declaration.type):
+            lines.append('')
+            lines.append('    // Property names for type generated as open.')
+            for type_member in type_declaration.type_members:
+                lines.append('    static const char* %s;' % ucfirst(type_member.member_name))
+
+        lines.append('};')
+        lines.append('')
+        return '\n'.join(lines)
+
+    def _generate_struct_for_enum_declaration(self, enum_declaration):
+        lines = []
+        lines.append('/* %s */' % enum_declaration.description)
+        lines.extend(self._generate_struct_for_enum_type(enum_declaration.type_name, enum_declaration.type))
+        return '\n'.join(lines)
+
+    def _generate_struct_for_anonymous_enum_member(self, enum_member):
+        def apply_indentation(line):
+            if line.startswith(('#', '/*', '*/', '//')) or len(line) is 0:
+                return line
+            else:
+                return '    ' + line
+
+        indented_lines = map(apply_indentation, self._generate_struct_for_enum_type(enum_member.member_name, enum_member.type))
+        return '\n'.join(indented_lines)
+
+    def _generate_struct_for_enum_type(self, enum_name, enum_type):
+        lines = []
+        enum_name = ucfirst(enum_name)
+        lines.append('enum class %s {' % enum_name)
+        for enum_value in enum_type.enum_values():
+            lines.append('    %s = %s,' % (Generator.stylized_name_for_enum_value(enum_value), self.encoding_for_enum_value(enum_value)))
+        lines.append('}; // enum class %s' % enum_name)
+        return lines  # The caller may want to adjust indentation, so don't join these lines.
+
+    def _generate_builder_state_enum(self, type_declaration):
+        lines = []
+        required_members = filter(lambda member: not member.is_optional, type_declaration.type_members)
+        enum_values = []
+
+        lines.append('    enum {')
+        lines.append('        NoFieldsSet = 0,')
+        for i in range(len(required_members)):
+            enum_value = &quot;%sSet&quot; % ucfirst(required_members[i].member_name)
+            enum_values.append(enum_value)
+            lines.append('        %s = 1 &lt;&lt; %d,' % (enum_value, i))
+        if len(enum_values) &gt; 0:
+            lines.append('        AllFieldsSet = (%s)' % ' | '.join(enum_values))
+        else:
+            lines.append('        AllFieldsSet = 0')
+        lines.append('    };')
+        lines.append('')
+        return '\n'.join(lines)
+
+    def _generate_builder_setter_for_member(self, type_member, domain):
+        setter_args = {
+            'camelName': ucfirst(type_member.member_name),
+            'frameworkPrefix': self.model().framework.setting('prefix'),
+            'keyedSet': Generator.keyed_set_method_for_type(type_member.type),
+            'name': type_member.member_name,
+            'parameterType': Generator.type_string_for_type_member(type_member)
+        }
+
+        lines = []
+        lines.append('')
+        lines.append('        Builder&lt;STATE | %(camelName)sSet&gt;&amp; set%(camelName)s(%(parameterType)s value)' % setter_args)
+        lines.append('        {')
+        lines.append('            COMPILE_ASSERT(!(STATE &amp; %(camelName)sSet), property_%(name)s_already_set);' % setter_args)
+
+        if isinstance(type_member.type, EnumType):
+            lines.append('            m_result-&gt;%(keyedSet)s(ASCIILiteral(&quot;%(name)s&quot;), Inspector::TypeBuilder::get%(frameworkPrefix)sEnumConstantValue(static_cast&lt;int&gt;(value)));' % setter_args)
+        else:
+            lines.append('            m_result-&gt;%(keyedSet)s(ASCIILiteral(&quot;%(name)s&quot;), value);' % setter_args)
+        lines.append('            return castState&lt;%(camelName)sSet&gt;();' % setter_args)
+        lines.append('        }')
+        return '\n'.join(lines)
+
+    def _generate_unchecked_setter_for_member(self, type_member, domain):
+        setter_args = {
+            'camelName': ucfirst(type_member.member_name),
+            'frameworkPrefix': self.model().framework.setting('prefix'),
+            'keyedSet': Generator.keyed_set_method_for_type(type_member.type),
+            'name': type_member.member_name,
+            'parameterType': Generator.type_string_for_type_member(type_member)
+        }
+
+        lines = []
+        lines.append('')
+        lines.append('    void set%(camelName)s(%(parameterType)s value)' % setter_args)
+        lines.append('    {')
+        if isinstance(type_member.type, EnumType):
+            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral(&quot;%(name)s&quot;), Inspector::TypeBuilder::get%(frameworkPrefix)sEnumConstantValue(static_cast&lt;int&gt;(value)));' % setter_args)
+        else:
+            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral(&quot;%(name)s&quot;), value);' % setter_args)
+        lines.append('    }')
+        return '\n'.join(lines)
+
+    def _generate_forward_declarations_for_binding_traits(self):
+        # A list of (builder_type, needs_runtime_cast)
+        type_arguments = []
+
+        for domain in self.domains_to_generate():
+            declarations_to_generate = filter(lambda decl: self.type_needs_shape_assertions(decl.type), domain.type_declarations)
+
+            for type_declaration in declarations_to_generate:
+                for type_member in type_declaration.type_members:
+                    if isinstance(type_member.type, EnumType):
+                        type_arguments.append((Generator.type_builder_string_for_type_member(type_member, type_declaration), False))
+
+                if isinstance(type_declaration.type, ObjectType):
+                    type_arguments.append((Generator.type_builder_string_for_type(type_declaration.type), Generator.type_needs_runtime_casts(type_declaration.type)))
+
+        struct_keywords = ['struct']
+        function_keywords = ['static void']
+        export_macro = self.model().framework.setting('export_macro', None)
+        if export_macro is not None:
+            struct_keywords.append(export_macro)
+            #function_keywords[1:1] = [export_macro]
+
+        lines = []
+        for argument in type_arguments:
+            lines.append('template&lt;&gt; %s BindingTraits&lt;%s&gt; {' % (' '.join(struct_keywords), argument[0]))
+            if argument[1]:
+                lines.append('static PassRefPtr&lt;%s&gt; runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value);' % argument[0])
+            lines.append('#if !ASSERT_DISABLED')
+            lines.append('%s assertValueHasExpectedType(Inspector::InspectorValue*);' % ' '.join(function_keywords))
+            lines.append('#endif // !ASSERT_DISABLED')
+            lines.append('};')
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_type_builder_implementationpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_implementation.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_type_builder_implementation.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,184 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+
+import logging
+import string
+from string import Template
+
+from generator import Generator, ucfirst
+from generator_templates import GeneratorTemplates as Templates
+from models import AliasedType, ArrayType, EnumType, ObjectType
+
+log = logging.getLogger('global')
+
+
+class TypeBuilderImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;Inspector%sTypeBuilders.cpp&quot; % self.model().framework.setting('prefix')
+
+    def generate_output(self):
+        domains = self.domains_to_generate()
+        self.calculate_types_requiring_shape_assertions(domains)
+
+        secondary_headers = ['&lt;wtf/text/CString.h&gt;']
+
+        header_args = {
+            'primaryInclude': '&quot;Inspector%sTypeBuilders.h&quot;' % self.model().framework.setting('prefix'),
+            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
+            'inputFilename': self._input_filepath
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(Templates.CppImplementationPrelude).substitute(None, **header_args))
+        sections.append('namespace TypeBuilder {')
+        sections.append(self._generate_enum_mapping())
+        sections.append(self._generate_open_field_names())
+        builder_sections = map(self._generate_builders_for_domain, domains)
+        sections.extend(filter(lambda section: len(section) &gt; 0, builder_sections))
+        sections.append('} // namespace TypeBuilder')
+        sections.append(Template(Templates.CppImplementationPostlude).substitute(None, **header_args))
+
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_enum_mapping(self):
+        framework_prefix = self.model().framework.setting('prefix')
+        lines = []
+
+        lines.append('static const char* const enum_constant_values[] = {')
+        lines.extend(['    &quot;%s&quot;,' % enum_value for enum_value in self.assigned_enum_values()])
+        lines.append('};')
+        lines.append('')
+        lines.append('String get%sEnumConstantValue(int code) {' % framework_prefix)
+        lines.append('    return enum_constant_values[code];')
+        lines.append('}')
+
+        return '\n'.join(lines)
+
+    def _generate_open_field_names(self):
+        lines = []
+        for domain in self.domains_to_generate():
+            for type_declaration in filter(lambda decl: Generator.type_has_open_fields(decl.type), domain.type_declarations):
+                for type_member in sorted(type_declaration.type_members, key=lambda member: member.member_name):
+                    field_name = '::'.join(['Inspector', 'TypeBuilder', domain.domain_name, ucfirst(type_declaration.type_name), ucfirst(type_member.member_name)])
+                    lines.append('const char* %s = &quot;%s&quot;;' % (field_name, type_member.member_name))
+
+        return '\n'.join(lines)
+
+    def _generate_builders_for_domain(self, domain):
+        sections = []
+        declarations_to_generate = filter(lambda decl: self.type_needs_shape_assertions(decl.type), domain.type_declarations)
+
+        for type_declaration in declarations_to_generate:
+            for type_member in type_declaration.type_members:
+                if isinstance(type_member.type, EnumType):
+                    sections.append(self._generate_assertion_for_enum(type_member, type_declaration))
+
+            if isinstance(type_declaration.type, ObjectType):
+                sections.append(self._generate_assertion_for_object_declaration(type_declaration))
+                if Generator.type_needs_runtime_casts(type_declaration.type):
+                    sections.append(self._generate_runtime_cast_for_object_declaration(type_declaration))
+
+        return '\n\n'.join(sections)
+
+    def _generate_runtime_cast_for_object_declaration(self, object_declaration):
+        args = {
+            'objectType': Generator.type_builder_string_for_type(object_declaration.type)
+        }
+        return Template(Templates.TypeBuilderObjectRuntimeCast).substitute(None, **args)
+
+    def _generate_assertion_for_object_declaration(self, object_declaration):
+        required_members = filter(lambda member: not member.is_optional, object_declaration.type_members)
+        optional_members = filter(lambda member: member.is_optional, object_declaration.type_members)
+        should_count_properties = not Generator.type_has_open_fields(object_declaration.type)
+        lines = []
+
+        lines.append('#if !ASSERT_DISABLED')
+        lines.append('void BindingTraits&lt;%s&gt;::assertValueHasExpectedType(Inspector::InspectorValue* value)' % (Generator.type_builder_string_for_type(object_declaration.type)))
+        lines.append(&quot;&quot;&quot;{
+    RefPtr&lt;InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);&quot;&quot;&quot;)
+        for type_member in required_members:
+            args = {
+                'memberName': type_member.member_name,
+                'assertMethod': Generator.assertion_method_for_type_member(type_member, object_declaration)
+            }
+
+            lines.append(&quot;&quot;&quot;    {
+        InspectorObject::iterator %(memberName)sPos = object-&gt;find(ASCIILiteral(&quot;%(memberName)s&quot;));
+        ASSERT(%(memberName)sPos != object-&gt;end());
+        %(assertMethod)s(%(memberName)sPos-&gt;value.get());
+    }&quot;&quot;&quot; % args)
+
+        if should_count_properties:
+            lines.append('')
+            lines.append('    int foundPropertiesCount = %s;' % len(required_members))
+
+        for type_member in optional_members:
+            args = {
+                'memberName': type_member.member_name,
+                'assertMethod': Generator.assertion_method_for_type_member(type_member, object_declaration)
+            }
+
+            lines.append(&quot;&quot;&quot;    {
+        InspectorObject::iterator %(memberName)sPos = object-&gt;find(ASCIILiteral(&quot;%(memberName)s&quot;));
+        if (%(memberName)sPos != object-&gt;end()) {
+            %(assertMethod)s(%(memberName)sPos-&gt;value.get());&quot;&quot;&quot; % args)
+
+            if should_count_properties:
+                lines.append('            ++foundPropertiesCount;')
+            lines.append('        }')
+            lines.append('    }')
+
+        if should_count_properties:
+            lines.append('    if (foundPropertiesCount != object-&gt;size())')
+            lines.append('        FATAL(&quot;Unexpected properties in object: %s\\n&quot;, object-&gt;toJSONString().ascii().data());')
+        lines.append('}')
+        lines.append('#endif // !ASSERT_DISABLED')
+        return '\n'.join(lines)
+
+    def _generate_assertion_for_enum(self, enum_member, object_declaration):
+        lines = []
+        lines.append('#if !ASSERT_DISABLED')
+        lines.append('void %s(Inspector::InspectorValue* value)' % Generator.assertion_method_for_type_member(enum_member, object_declaration))
+        lines.append('{')
+        lines.append('    String s;')
+        lines.append('    bool cast_res = value-&gt;asString(&amp;s);')
+        lines.append('    ASSERT(cast_res);')
+
+        assert_condition = ' || '.join(['s == &quot;%s&quot;' % enum_value for enum_value in enum_member.type.enum_values()])
+        lines.append('    ASSERT(%s);' % assert_condition)
+        lines.append('}')
+        lines.append('#endif // !ASSERT_DISABLED')
+
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengeneratorpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,496 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import os.path
+import re
+from string import Template
+
+from generator_templates import GeneratorTemplates as Templates
+from models import PrimitiveType, ObjectType, ArrayType, EnumType, AliasedType
+
+log = logging.getLogger('global')
+
+
+def ucfirst(str):
+    return str[:1].upper() + str[1:]
+
+_PRIMITIVE_TO_CPP_NAME_MAP = {
+    'boolean': 'bool',
+    'integer': 'int',
+    'number': 'double',
+    'string': 'String',
+    'object': 'Inspector::InspectorObject',
+    'any': 'Inspector::InspectorValue'
+}
+
+# FIXME: This should be converted into a property on the domain in JSON.
+_DOMAIN_TO_CPP_GUARD_MAP = {
+    'Database': &quot;ENABLE(SQL_DATABASE)&quot;,
+    'IndexedDB': &quot;ENABLE(INDEXED_DATABASE)&quot;,
+    'Replay': &quot;ENABLE(WEB_REPLAY)&quot;,
+}
+
+_ALWAYS_UPPERCASED_ENUM_VALUE_SUBSTRINGS = set(['API', 'CSS', 'DOM', 'HTML', 'XHR', 'XML'])
+
+# These objects are built manually by creating and setting InspectorValues.
+# Before sending these over the protocol, their shapes are checked against the specification.
+# So, any types referenced by these types require debug-only assertions that check values.
+# Calculating necessary assertions is annoying, and adds a lot of complexity to the generator.
+
+# FIXME: This should be converted into a property in JSON.
+_TYPES_NEEDING_RUNTIME_CASTS = set([
+    &quot;Runtime.RemoteObject&quot;,
+    &quot;Runtime.PropertyDescriptor&quot;,
+    &quot;Runtime.InternalPropertyDescriptor&quot;,
+    &quot;Debugger.FunctionDetails&quot;,
+    &quot;Debugger.CallFrame&quot;,
+    &quot;Canvas.TraceLog&quot;,
+    &quot;Canvas.ResourceInfo&quot;,
+    &quot;Canvas.ResourceState&quot;,
+    # This should be a temporary hack. TimelineEvent should be created via generated C++ API.
+    &quot;Timeline.TimelineEvent&quot;,
+    # For testing purposes only.
+    &quot;Test.TypeNeedingCast&quot;
+])
+
+# FIXME: This should be converted into a property in JSON.
+_TYPES_WITH_OPEN_FIELDS = set([
+    &quot;Timeline.TimelineEvent&quot;,
+    # InspectorStyleSheet not only creates this property but wants to read it and modify it.
+    &quot;CSS.CSSProperty&quot;,
+    # InspectorResourceAgent needs to update mime-type.
+    &quot;Network.Response&quot;,
+    # For testing purposes only.
+    &quot;Test.OpenParameterBundle&quot;
+])
+
+
+class Generator:
+    def __init__(self, model, input_filepath):
+        self._model = model
+        self._input_filepath = input_filepath
+
+    def model(self):
+        return self._model
+
+    def generate_license(self):
+        return Template(Templates.CopyrightBlock).substitute(None, inputFilename=os.path.basename(self._input_filepath))
+
+    # These methods are overridden by subclasses.
+    def domains_to_generate(self):
+        return filter(lambda domain: not domain.is_supplemental, self.model().domains)
+
+    def generate_output(self):
+        pass
+
+    def output_filename(self):
+        pass
+
+    def encoding_for_enum_value(self, enum_value):
+        if not hasattr(self, &quot;_assigned_enum_values&quot;):
+            self._traverse_and_assign_enum_values()
+
+        return self._enum_value_encodings[enum_value]
+
+    def assigned_enum_values(self):
+        if not hasattr(self, &quot;_assigned_enum_values&quot;):
+            self._traverse_and_assign_enum_values()
+
+        return self._assigned_enum_values[:]  # Slice.
+
+    @staticmethod
+    def type_needs_runtime_casts(_type):
+        return _type.qualified_name() in _TYPES_NEEDING_RUNTIME_CASTS
+
+    @staticmethod
+    def type_has_open_fields(_type):
+        return _type.qualified_name() in _TYPES_WITH_OPEN_FIELDS
+
+    def type_needs_shape_assertions(self, _type):
+        if not hasattr(self, &quot;_types_needing_shape_assertions&quot;):
+            self.calculate_types_requiring_shape_assertions(self.model().domains)
+
+        return _type in self._types_needing_shape_assertions
+
+    # To restrict the domains over which we compute types needing assertions, call this method
+    # before generating any output with the desired domains parameter. The computed
+    # set of types will not be automatically regenerated on subsequent calls to
+    # Generator.types_needing_shape_assertions().
+    def calculate_types_requiring_shape_assertions(self, domains):
+        domain_names = map(lambda domain: domain.domain_name, domains)
+        log.debug(&quot;&gt; Calculating types that need shape assertions (eligible domains: %s)&quot; % &quot;, &quot;.join(domain_names))
+
+        # Mutates the passed-in set; this simplifies checks to prevent infinite recursion.
+        def gather_transitively_referenced_types(_type, gathered_types):
+            if _type in gathered_types:
+                return
+
+            if isinstance(_type, ObjectType):
+                log.debug(&quot;&gt; Adding type %s to list of types needing shape assertions.&quot; % _type.qualified_name())
+                gathered_types.add(_type)
+                for type_member in _type.members:
+                    gather_transitively_referenced_types(type_member.type, gathered_types)
+            elif isinstance(_type, EnumType):
+                log.debug(&quot;&gt; Adding type %s to list of types needing shape assertions.&quot; % _type.qualified_name())
+                gathered_types.add(_type)
+            elif isinstance(_type, AliasedType):
+                gather_transitively_referenced_types(_type.aliased_type, gathered_types)
+            elif isinstance(_type, ArrayType):
+                gather_transitively_referenced_types(_type.element_type, gathered_types)
+
+        found_types = set()
+        for domain in domains:
+            for declaration in domain.type_declarations:
+                if declaration.type.qualified_name() in _TYPES_NEEDING_RUNTIME_CASTS:
+                    log.debug(&quot;&gt; Gathering types referenced by %s to generate shape assertions.&quot; % declaration.type.qualified_name())
+                    gather_transitively_referenced_types(declaration.type, found_types)
+
+        self._types_needing_shape_assertions = found_types
+
+    # Private helper instance methods.
+    def _traverse_and_assign_enum_values(self):
+        self._enum_value_encodings = {}
+        self._assigned_enum_values = []
+        all_types = []
+
+        domains = self.domains_to_generate()
+
+        for domain in domains:
+            for type_declaration in domain.type_declarations:
+                all_types.append(type_declaration.type)
+                for type_member in type_declaration.type_members:
+                    all_types.append(type_member.type)
+
+        for domain in domains:
+            for event in domain.events:
+                all_types.extend([parameter.type for parameter in event.event_parameters])
+
+        for domain in domains:
+            for command in domain.commands:
+                all_types.extend([parameter.type for parameter in command.call_parameters])
+                all_types.extend([parameter.type for parameter in command.return_parameters])
+
+        for _type in all_types:
+            if not isinstance(_type, EnumType):
+                continue
+            map(self._assign_encoding_for_enum_value, _type.enum_values())
+
+    def _assign_encoding_for_enum_value(self, enum_value):
+        if enum_value in self._enum_value_encodings:
+            return
+
+        self._enum_value_encodings[enum_value] = len(self._assigned_enum_values)
+        self._assigned_enum_values.append(enum_value)
+
+    # Miscellaneous text manipulation routines.
+    @staticmethod
+    def wrap_with_guard_for_domain(domain, text):
+        guard = _DOMAIN_TO_CPP_GUARD_MAP.get(domain.domain_name)
+        if guard is not None:
+            lines = [
+                '#if %s' % guard,
+                text,
+                '#endif // %s' % guard
+                ]
+            return '\n'.join(lines)
+        else:
+            return text
+
+    @staticmethod
+    def stylized_name_for_enum_value(enum_value):
+        regex = '(%s)' % &quot;|&quot;.join(_ALWAYS_UPPERCASED_ENUM_VALUE_SUBSTRINGS)
+
+        def replaceCallback(match):
+            return match.group(1).upper()
+
+        # Split on hyphen, introduce camelcase, and force uppercasing of acronyms.
+        subwords = map(ucfirst, enum_value.split('-'))
+        return re.sub(regex, replaceCallback, &quot;&quot;.join(subwords), flags=re.IGNORECASE)
+
+    @staticmethod
+    def keyed_get_method_for_type(_type):
+        if isinstance(_type, ObjectType):
+            return 'getObject'
+        if isinstance(_type, ArrayType):
+            return 'getArray'
+        if isinstance(_type, PrimitiveType):
+            if _type.raw_name() is 'integer':
+                return 'getInt'
+            else:
+                return 'get' + ucfirst(_type.raw_name())
+        if isinstance(_type, AliasedType):
+            return Generator.keyed_get_method_for_type(_type.aliased_type)
+        if isinstance(_type, EnumType):
+            return Generator.keyed_get_method_for_type(_type.primitive_type)
+
+    @staticmethod
+    def keyed_set_method_for_type(_type):
+        if isinstance(_type, ObjectType):
+            return 'setObject'
+        if isinstance(_type, ArrayType):
+            return 'setArray'
+        if isinstance(_type, PrimitiveType):
+            if _type.raw_name() in ['integer', 'number']:
+                return 'setNumber'
+            elif _type.raw_name() in ['any']:
+                return 'setValue'
+            else:
+                return 'set' + ucfirst(_type.raw_name())
+        if isinstance(_type, AliasedType):
+            return Generator.keyed_set_method_for_type(_type.aliased_type)
+        if isinstance(_type, EnumType):
+            return Generator.keyed_set_method_for_type(_type.primitive_type)
+
+    # Generate type representations for various situations.
+    @staticmethod
+    def type_builder_string_for_type(_type):
+        if isinstance(_type, ObjectType) and len(_type.members) == 0:
+            return 'Inspector::InspectorObject'
+        if isinstance(_type, (ObjectType, AliasedType, EnumType)):
+            return 'Inspector::TypeBuilder::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+        if isinstance(_type, ArrayType):
+            return 'Inspector::TypeBuilder::Array&lt;%s&gt;' % Generator.type_builder_string_for_type(_type.element_type)
+        if isinstance(_type, PrimitiveType):
+            return Generator.cpp_name_for_primitive_type(_type)
+
+    @staticmethod
+    def type_builder_string_for_type_member(type_member, object_declaration):
+        if isinstance(type_member.type, EnumType) and type_member.type.is_anonymous:
+            return '::'.join([Generator.type_builder_string_for_type(object_declaration.type), ucfirst(type_member.member_name)])
+        else:
+            return Generator.type_builder_string_for_type(type_member.type)
+
+    @staticmethod
+    def type_string_for_unchecked_formal_in_parameter(parameter):
+        _type = parameter.type
+        if isinstance(_type, AliasedType):
+            _type = _type.aliased_type  # Fall through to enum or primitive.
+
+        if isinstance(_type, EnumType):
+            _type = _type.primitive_type  # Fall through to primitive.
+
+        sigil = '*' if parameter.is_optional else '&amp;'
+        # This handles the 'any' type and objects with defined properties.
+        if isinstance(_type, ObjectType) or _type.qualified_name() is 'object':
+            return 'const RefPtr&lt;Inspector::InspectorObject&gt;' + sigil
+        if isinstance(_type, ArrayType):
+            return 'const RefPtr&lt;Inspector::InspectorArray&gt;' + sigil
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return 'const %s*' % cpp_name
+            elif _type.raw_name() in ['string']:
+                return 'const %s&amp;' % cpp_name
+            else:
+                return cpp_name
+
+        return &quot;unknown_unchecked_formal_in_parameter_type&quot;
+
+    @staticmethod
+    def type_string_for_checked_formal_event_parameter(parameter):
+        return Generator.type_string_for_type_with_name(parameter.type, parameter.parameter_name, parameter.is_optional)
+
+    @staticmethod
+    def type_string_for_type_member(member):
+        return Generator.type_string_for_type_with_name(member.type, member.member_name, False)
+
+    @staticmethod
+    def type_string_for_type_with_name(_type, type_name, is_optional):
+        if isinstance(_type, (ArrayType, ObjectType)):
+            return 'PassRefPtr&lt;%s&gt;' % Generator.type_builder_string_for_type(_type)
+        if isinstance(_type, AliasedType):
+            builder_type = Generator.type_builder_string_for_type(_type)
+            if is_optional:
+                return 'const %s* const' % builder_type
+            elif _type.aliased_type.qualified_name() in ['integer', 'number']:
+                return Generator.cpp_name_for_primitive_type(_type.aliased_type)
+            elif _type.aliased_type.qualified_name() in ['string']:
+                return 'const %s&amp;' % builder_type
+            else:
+                return builder_type
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if _type.qualified_name() in ['object']:
+                return 'PassRefPtr&lt;Inspector::InspectorObject&gt;'
+            elif _type.qualified_name() in ['any']:
+                return 'PassRefPtr&lt;Inspector::InspectorValue&gt;'
+            elif is_optional:
+                return 'const %s* const' % cpp_name
+            elif _type.qualified_name() in ['string']:
+                return 'const %s&amp;' % cpp_name
+            else:
+                return cpp_name
+        if isinstance(_type, EnumType):
+            if _type.is_anonymous:
+                enum_type_name = ucfirst(type_name)
+            else:
+                enum_type_name = 'Inspector::TypeBuilder::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+
+            if is_optional:
+                return '%s*' % enum_type_name
+            else:
+                return '%s' % enum_type_name
+
+    @staticmethod
+    def type_string_for_formal_out_parameter(parameter):
+        _type = parameter.type
+
+        if isinstance(_type, AliasedType):
+            _type = _type.aliased_type  # Fall through.
+
+        if isinstance(_type, (ObjectType, ArrayType)):
+            return 'RefPtr&lt;%s&gt;&amp;' % Generator.type_builder_string_for_type(_type)
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;*&quot; % cpp_name
+            else:
+                return '%s*' % cpp_name
+        if isinstance(_type, EnumType):
+            if _type.is_anonymous:
+                return 'Inspector%sBackendDispatcherHandler::%s*' % (_type.type_domain().domain_name, ucfirst(parameter.parameter_name))
+            else:
+                return 'Inspector::TypeBuilder::%s::%s*' % (_type.type_domain().domain_name, _type.raw_name())
+
+        raise ValueError(&quot;unknown formal out parameter type.&quot;)
+
+    # FIXME: this is only slightly different from out parameters; they could be unified.
+    @staticmethod
+    def type_string_for_formal_async_parameter(parameter):
+        _type = parameter.type
+        if isinstance(_type, AliasedType):
+            _type = _type.aliased_type  # Fall through.
+
+        if isinstance(_type, EnumType):
+            _type = _type.primitive_type  # Fall through.
+
+        if isinstance(_type, (ObjectType, ArrayType)):
+            return 'PassRefPtr&lt;%s&gt;' % Generator.type_builder_string_for_type(_type)
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;*&quot; % cpp_name
+            elif _type.qualified_name() in ['integer', 'number']:
+                return Generator.cpp_name_for_primitive_type(_type)
+            elif _type.qualified_name() in ['string']:
+                return 'const %s&amp;' % cpp_name
+            else:
+                return cpp_name
+
+        raise ValueError(&quot;Unknown formal async parameter type.&quot;)
+
+    # In-parameters don't use builder types, because they could be passed
+    # &quot;open types&quot; that are manually constructed out of InspectorObjects.
+
+    # FIXME: Only parameters that are actually open types should need non-builder parameter types.
+    @staticmethod
+    def type_string_for_stack_in_parameter(parameter):
+        _type = parameter.type
+        if isinstance(_type, AliasedType):
+            _type = _type.aliased_type  # Fall through.
+
+        if isinstance(_type, EnumType):
+            _type = _type.primitive_type  # Fall through.
+
+        if isinstance(_type, ObjectType):
+            return &quot;RefPtr&lt;Inspector::InspectorObject&gt;&quot;
+        if isinstance(_type, ArrayType):
+            return &quot;RefPtr&lt;Inspector::InspectorArray&gt;&quot;
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if _type.qualified_name() in ['any', 'object']:
+                return &quot;RefPtr&lt;%s&gt;&quot; % Generator.cpp_name_for_primitive_type(_type)
+            elif parameter.is_optional and _type.qualified_name() not in ['boolean', 'string', 'integer']:
+                return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;&quot; % cpp_name
+            else:
+                return cpp_name
+
+    @staticmethod
+    def type_string_for_stack_out_parameter(parameter):
+        _type = parameter.type
+        if isinstance(_type, (ArrayType, ObjectType)):
+            return 'RefPtr&lt;%s&gt;' % Generator.type_builder_string_for_type(_type)
+        if isinstance(_type, AliasedType):
+            builder_type = Generator.type_builder_string_for_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;&quot; % builder_type
+            return '%s' % builder_type
+        if isinstance(_type, PrimitiveType):
+            cpp_name = Generator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::TypeBuilder::OptOutput&lt;%s&gt;&quot; % cpp_name
+            else:
+                return cpp_name
+        if isinstance(_type, EnumType):
+            if _type.is_anonymous:
+                return 'Inspector%sBackendDispatcherHandler::%s' % (_type.type_domain().domain_name, ucfirst(parameter.parameter_name))
+            else:
+                return 'Inspector::TypeBuilder::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+
+    @staticmethod
+    def assertion_method_for_type_member(type_member, object_declaration):
+
+        def assertion_method_for_type(_type):
+            return 'BindingTraits&lt;%s&gt;::assertValueHasExpectedType' % Generator.type_builder_string_for_type(_type)
+
+        if isinstance(type_member.type, AliasedType):
+            return assertion_method_for_type(type_member.type.aliased_type)
+        if isinstance(type_member.type, EnumType) and type_member.type.is_anonymous:
+            return 'BindingTraits&lt;%s&gt;::assertValueHasExpectedType' % Generator.type_builder_string_for_type_member(type_member, object_declaration)
+
+        return assertion_method_for_type(type_member.type)
+
+    @staticmethod
+    def cpp_name_for_primitive_type(_type):
+        return _PRIMITIVE_TO_CPP_NAME_MAP.get(_type.raw_name())
+
+    @staticmethod
+    def js_name_for_parameter_type(_type):
+        _type = _type
+        if isinstance(_type, AliasedType):
+            _type = _type.aliased_type  # Fall through.
+        if isinstance(_type, EnumType):
+            _type = _type.primitive_type  # Fall through.
+
+        if isinstance(_type, (ArrayType, ObjectType)):
+            return 'object'
+        if isinstance(_type, PrimitiveType):
+            if _type.qualified_name() in ['object', 'any']:
+                return 'object'
+            elif _type.qualified_name() in ['integer', 'number']:
+                return 'number'
+            else:
+                return _type.qualified_name()
+
+    # Decide whether certain helpers are necessary in a situation.
+    @staticmethod
+    def should_use_wrapper_for_return_type(_type):
+        return not isinstance(_type, (ArrayType, ObjectType))
+
+    @staticmethod
+    def should_pass_by_copy_for_return_type(_type):
+        return isinstance(_type, (ArrayType, ObjectType)) or (isinstance(_type, (PrimitiveType)) and _type.qualified_name() == &quot;object&quot;)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerator_templatespy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,266 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+# Generator templates, which can be filled with string.Template.
+# Following are classes that fill the templates from the typechecked model.
+
+
+class GeneratorTemplates:
+    CopyrightBlock = (
+    &quot;&quot;&quot;/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from ${inputFilename}
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py&quot;&quot;&quot;)
+
+    CppHeaderPrelude = (
+    &quot;&quot;&quot;#ifndef ${headerGuardString}
+#define ${headerGuardString}
+
+#if ENABLE(INSPECTOR)
+
+${includes}
+
+namespace Inspector {
+
+${typedefs}&quot;&quot;&quot;)
+
+    CppHeaderPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(${headerGuardString})&quot;&quot;&quot;)
+
+    CppImplementationPrelude = (
+    &quot;&quot;&quot;#include &quot;config.h&quot;
+#include ${primaryInclude}
+
+#if ENABLE(INSPECTOR)
+
+${secondaryIncludes}
+
+namespace Inspector {&quot;&quot;&quot;)
+
+    CppImplementationPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderDomainHandlerDeclaration = (
+    &quot;&quot;&quot;${classAndExportMacro} Inspector${domainName}BackendDispatcherHandler {
+public:
+${commandDeclarations}
+protected:
+    virtual ~Inspector${domainName}BackendDispatcherHandler();
+};&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderDomainDispatcherDeclaration = (
+    &quot;&quot;&quot;${classAndExportMacro} Inspector${domainName}BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;Inspector${domainName}BackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, Inspector${domainName}BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+${commandDeclarations}
+private:
+    Inspector${domainName}BackendDispatcher(Inspector::InspectorBackendDispatcher*, Inspector${domainName}BackendDispatcherHandler*);
+    Inspector${domainName}BackendDispatcherHandler* m_agent;
+};&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderAsyncCommandDeclaration = (
+    &quot;&quot;&quot;    class ${callbackName} : public Inspector::InspectorBackendDispatcher::CallbackBase {
+    public:
+        ${callbackName}(PassRefPtr&lt;Inspector::InspectorBackendDispatcher&gt;, int id);
+        void sendSuccess(${outParameters});
+    };
+    virtual void ${commandName}(${inParameters}) = 0;&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationSmallSwitch = (
+    &quot;&quot;&quot;void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;Inspector${domainName}BackendDispatcher&gt; protect(*this);
+
+${dispatchCases}
+    else
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;${domainName}&quot; + '.' + method + &quot;' was not found&quot;);
+}&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationLargeSwitch = (
+&quot;&quot;&quot;void Inspector${domainName}BackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;Inspector${domainName}BackendDispatcher&gt; protect(*this);
+
+    typedef void (Inspector${domainName}BackendDispatcher::*CallHandler)(long callId, const Inspector::InspectorObject&amp; message);
+    typedef HashMap&lt;String, CallHandler&gt; DispatchMap;
+    DEPRECATED_DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, ());
+    if (dispatchMap.isEmpty()) {
+        static const struct MethodTable {
+            const char* name;
+            CallHandler handler;
+        } commands[] = {
+${dispatchCases}
+        };
+        size_t length = WTF_ARRAY_LENGTH(commands);
+        for (size_t i = 0; i &lt; length; ++i)
+            dispatchMap.add(commands[i].name, commands[i].handler);
+    }
+
+    HashMap&lt;String, CallHandler&gt;::iterator it = dispatchMap.find(method);
+    if (it == dispatchMap.end()) {
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;${domainName}&quot; + '.' + method + &quot;' was not found&quot;);
+        return;
+    }
+
+    ((*this).*it-&gt;value)(callId, *message.get());
+}&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationDomainConstructor = (
+    &quot;&quot;&quot;PassRefPtr&lt;Inspector${domainName}BackendDispatcher&gt; Inspector${domainName}BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
+{
+    return adoptRef(new Inspector${domainName}BackendDispatcher(backendDispatcher, agent));
+}
+
+Inspector${domainName}BackendDispatcher::Inspector${domainName}BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, Inspector${domainName}BackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;${domainName}&quot;), this);
+}&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationPrepareCommandArguments = (
+&quot;&quot;&quot;    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+${inParameterDeclarations}
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method \'%s\' can't be processed&quot;, &quot;${domainName}.${commandName}&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationAsyncCommand = (
+&quot;&quot;&quot;Inspector${domainName}BackendDispatcherHandler::${callbackName}::${callbackName}(PassRefPtr&lt;InspectorBackendDispatcher&gt; backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
+
+void Inspector${domainName}BackendDispatcherHandler::${callbackName}::sendSuccess(${formalParameters})
+{
+    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
+${outParameterAssignments}
+    sendIfActive(jsonMessage, ErrorString());
+}&quot;&quot;&quot;)
+
+    FrontendDispatcherDomainDispatcherDeclaration = (
+&quot;&quot;&quot;${classAndExportMacro} Inspector${domainName}FrontendDispatcher {
+public:
+    Inspector${domainName}FrontendDispatcher(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
+${eventDeclarations}
+private:
+    InspectorFrontendChannel* m_inspectorFrontendChannel;
+};&quot;&quot;&quot;)
+
+    TypeBuilderDeclarationPrelude = (
+&quot;&quot;&quot;    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*${objectType}*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class ${objectType};
+    public:&quot;&quot;&quot;)
+
+    TypeBuilderDeclarationPostlude = (
+&quot;&quot;&quot;
+        operator RefPtr&lt;${objectType}&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(${objectType}) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;${objectType}&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;${objectType}&gt; release()
+        {
+            return RefPtr&lt;${objectType}&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+${constructorExample}
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;&quot;&quot;&quot;)
+
+    TypeBuilderObjectRuntimeCast = (
+&quot;&quot;&quot;PassRefPtr&lt;${objectType}&gt; BindingTraits&lt;${objectType}&gt;::runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+{
+    RefPtr&lt;Inspector::InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);
+#if !ASSERT_DISABLED
+    BindingTraits&lt;${objectType}&gt;::assertValueHasExpectedType(object.get());
+#endif  // !ASSERT_DISABLED
+    COMPILE_ASSERT(sizeof(${objectType}) == sizeof(Inspector::InspectorObjectBase), type_cast_problem);
+    return static_cast&lt;${objectType}*&gt;(static_cast&lt;Inspector::InspectorObjectBase*&gt;(object.get()));
+}
+&quot;&quot;&quot;
+)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegenmodelspy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/models.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/models.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/models.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,580 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+
+log = logging.getLogger('global')
+
+
+def ucfirst(str):
+    return str[:1].upper() + str[1:]
+
+
+_FRAMEWORK_CONFIG_MAP = {
+    &quot;Global&quot;: {
+        &quot;prefix&quot;: &quot;&quot;,
+    },
+
+    &quot;WTF&quot;: {
+        &quot;prefix&quot;: &quot;WTF&quot;,
+    },
+    &quot;JavaScriptCore&quot;: {
+        &quot;prefix&quot;: &quot;JS&quot;,
+        &quot;export_macro&quot;: &quot;JS_EXPORT_PRIVATE&quot;
+    },
+    &quot;WebCore&quot;: {
+        &quot;prefix&quot;: &quot;Web&quot;,
+    },
+    # Used for code generator tests.
+    &quot;Test&quot;: {
+        &quot;prefix&quot;: &quot;Test&quot;,
+    }
+}
+
+
+# FIXME: These should be converted into JSON properties, or renamed.
+_TYPES_NEEDING_RENAME_WORKAROUNDS = {
+    'RGBA': 'Rgba', # RGBA is reported to be conflicting with a define name in Windows CE.
+    # For testing only.
+    'UnpleasantName': 'HappyName'
+}
+
+
+class ParseException(Exception):
+    pass
+
+
+class TypecheckException(Exception):
+    pass
+
+
+class Framework:
+    def __init__(self, name):
+        self._settings = _FRAMEWORK_CONFIG_MAP[name]
+        self.name = name
+
+    def setting(self, key, default=''):
+        return self._settings.get(key, default)
+
+    @staticmethod
+    def fromString(frameworkString):
+        if frameworkString == &quot;Global&quot;:
+            return Frameworks.Global
+
+        if frameworkString == &quot;WTF&quot;:
+            return Frameworks.WTF
+
+        if frameworkString == &quot;JavaScriptCore&quot;:
+            return Frameworks.JavaScriptCore
+
+        if frameworkString == &quot;WebCore&quot;:
+            return Frameworks.WebCore
+
+        if frameworkString == &quot;Test&quot;:
+            return Frameworks.Test
+
+        raise ParseException(&quot;Unknown framework: %s&quot; % frameworkString)
+
+
+class Frameworks:
+    Global = Framework(&quot;Global&quot;)
+    WTF = Framework(&quot;WTF&quot;)
+    JavaScriptCore = Framework(&quot;JavaScriptCore&quot;)
+    WebCore = Framework(&quot;WebCore&quot;)
+    Test = Framework(&quot;Test&quot;)
+
+
+class TypeReference:
+    def __init__(self, type_kind, referenced_type_name, enum_values, array_items):
+        self.type_kind = type_kind
+        self.referenced_type_name = _TYPES_NEEDING_RENAME_WORKAROUNDS.get(referenced_type_name, referenced_type_name)
+        self.enum_values = enum_values
+        if array_items is None:
+            self.array_type_ref = None
+        else:
+            self.array_type_ref = TypeReference(array_items.get('type'), array_items.get('$ref'), array_items.get('enum'), array_items.get('items'))
+
+        if type_kind is not None and referenced_type_name is not None:
+            raise ParseException(&quot;Type reference cannot have both 'type' and '$ref' keys.&quot;)
+
+        if type_kind == &quot;array&quot; and array_items is None:
+            raise ParseException(&quot;Type reference with type 'array' must have key 'items' to define array element type.&quot;)
+
+        if enum_values is not None and len(enum_values) == 0:
+            raise ParseException(&quot;Type reference with enum values must have at least one enum value.&quot;)
+
+    def referenced_name(self):
+        if self.referenced_type_name is not None:
+            return self.referenced_type_name
+        else:
+            return self.type_kind  # integer, string, number, boolean, enum, object, array
+
+
+class Type:
+    def __init__(self):
+        pass
+
+    def __eq__(self, other):
+        return self.qualified_name() == other.qualified_name()
+
+    def __hash__(self):
+        return self.qualified_name().__hash__()
+
+    def raw_name(self):
+        return _TYPES_NEEDING_RENAME_WORKAROUNDS.get(self._name, self._name)
+
+    # These methods should be overridden by subclasses.
+    def is_enum(self):
+        return False
+
+    def type_domain(self):
+        pass
+
+    def qualified_name(self):
+        pass
+
+    # This is used to resolve nested types after instances are created.
+    def resolve_type_references(self, protocol):
+        pass
+
+
+class PrimitiveType(Type):
+    def __init__(self, name):
+        self._name = name
+
+    def __repr__(self):
+        return 'PrimitiveType[%s]' % self.qualified_name()
+
+    def type_domain(self):
+        return None
+
+    def qualified_name(self):
+        return self.raw_name()
+
+
+class AliasedType(Type):
+    def __init__(self, name, domain, aliased_type_ref):
+        self._name = name
+        self._domain = domain
+        self._aliased_type_ref = aliased_type_ref
+        self.aliased_type = None
+
+    def __repr__(self):
+        if self.aliased_type is not None:
+            return 'AliasedType[%s -&gt; %r]' % (self.qualified_name(), self.aliased_type)
+        else:
+            return 'AliasedType[%s -&gt; (unresolved)]' % self.qualified_name()
+
+    def is_enum(self):
+        return self.aliased_type.is_enum()
+
+    def type_domain(self):
+        return self._domain
+
+    def qualified_name(self):
+        return  &quot;.&quot;.join([self.type_domain().domain_name, self.raw_name()])
+
+    def resolve_type_references(self, protocol):
+        if self.aliased_type is not None:
+            return
+
+        self.aliased_type = protocol.lookup_type_reference(self._aliased_type_ref, self.type_domain())
+        log.debug(&quot;&lt; Resolved type reference for aliased type in %s: %s&quot; % (self.qualified_name(), self.aliased_type.qualified_name()))
+
+
+class EnumType(Type):
+    def __init__(self, name, domain, values, primitive_type_ref, is_anonymous=False):
+        self._name = name
+        self._domain = domain
+        self._values = values
+        self._primitive_type_ref = primitive_type_ref
+        self.primitive_type = None
+        self.is_anonymous = is_anonymous
+
+    def __repr__(self):
+        return 'EnumType[value_type=%s; values=%s]' % (self.qualified_name(), ', '.join(map(str, self.enum_values())))
+
+    def is_enum(self):
+        return True
+
+    def type_domain(self):
+        return self._domain
+
+    def enum_values(self):
+        return self._values
+
+    def qualified_name(self):
+        return  &quot;.&quot;.join([self.type_domain().domain_name, self.raw_name()])
+
+    def resolve_type_references(self, protocol):
+        if self.primitive_type is not None:
+            return
+
+        self.primitive_type = protocol.lookup_type_reference(self._primitive_type_ref, Domains.GLOBAL)
+        log.debug(&quot;&lt; Resolved type reference for enum type in %s: %s&quot; % (self.qualified_name(), self.primitive_type.qualified_name()))
+        log.debug(&quot;&lt;&lt; enum values: %s&quot; % self.enum_values())
+
+
+class ArrayType(Type):
+    def __init__(self, element_type_ref, domain):
+        self._domain = domain
+        self._element_type_ref = element_type_ref
+        self.element_type = None
+
+    def __repr__(self):
+        if self.element_type is not None:
+            return 'ArrayType[element_type=%r]' % self.element_type
+        else:
+            return 'ArrayType[element_type=(unresolved)]'
+
+    def type_domain(self):
+        return self._domain
+
+    def qualified_name(self):
+        return  &quot;.&quot;.join([&quot;array&quot;, self.element_type.qualified_name()])
+
+    def resolve_type_references(self, protocol):
+        if self.element_type is not None:
+            return
+
+        self.element_type = protocol.lookup_type_reference(self._element_type_ref, self.type_domain())
+        log.debug(&quot;&lt; Resolved type reference for element type in %s: %s&quot; % (self.qualified_name(), self.element_type.qualified_name()))
+
+
+class ObjectType(Type):
+    def __init__(self, name, domain, members):
+        self._name = name
+        self._domain = domain
+        self.members = members
+
+    def __repr__(self):
+        return 'ObjectType[%s]' % self.qualified_name()
+
+    def type_domain(self):
+        return self._domain
+
+    def qualified_name(self):
+        return  &quot;.&quot;.join([self.type_domain().domain_name, self.raw_name()])
+
+
+def check_for_required_properties(props, obj, what):
+    for prop in props:
+        if prop not in obj:
+            raise ParseException(&quot;When parsing %s, required property missing: %s&quot; % (what, prop))
+
+
+class Protocol:
+    def __init__(self, framework_name):
+        self.domains = []
+        self.types_by_name = {}
+        self.framework = Framework.fromString(framework_name)
+
+    def parse_specification(self, json, isSupplemental):
+        log.debug(&quot;parse toplevel&quot;)
+
+        if isinstance(json, dict) and 'domains' in json:
+            json = json['domains']
+        if not isinstance(json, list):
+            json = [json]
+
+        for domain in json:
+            self.parse_domain(domain, isSupplemental)
+
+    def parse_domain(self, json, isSupplemental):
+        check_for_required_properties(['domain'], json, &quot;domain&quot;)
+        log.debug(&quot;parse domain &quot; + json['domain'])
+
+        types = []
+        commands = []
+        events = []
+
+        if 'types' in json:
+            if not isinstance(json['types'], list):
+                raise ParseException(&quot;Malformed domain specification: types is not an array&quot;)
+            types.extend([self.parse_type_declaration(declaration) for declaration in json['types']])
+
+        if 'commands' in json:
+            if not isinstance(json['commands'], list):
+                raise ParseException(&quot;Malformed domain specification: commands is not an array&quot;)
+            commands.extend([self.parse_command(command) for command in json['commands']])
+
+        if 'events' in json:
+            if not isinstance(json['events'], list):
+                raise ParseException(&quot;Malformed domain specification: events is not an array&quot;)
+            events.extend([self.parse_event(event) for event in json['events']])
+
+        self.domains.append(Domain(json['domain'], json.get('description', &quot;&quot;), isSupplemental, types, commands, events))
+
+    def parse_type_declaration(self, json):
+        check_for_required_properties(['id', 'type'], json, &quot;type&quot;)
+        log.debug(&quot;parse type %s&quot; % json['id'])
+
+        type_members = []
+
+        if 'properties' in json:
+            if not isinstance(json['properties'], list):
+                raise ParseException(&quot;Malformed type specification: properties is not an array&quot;)
+            type_members.extend([self.parse_type_member(member) for member in json['properties']])
+
+        type_ref = TypeReference(json['type'], json.get('$ref'), json.get('enum'), json.get('items'))
+        return TypeDeclaration(json['id'], type_ref, json.get(&quot;description&quot;, &quot;&quot;), type_members)
+
+    def parse_type_member(self, json):
+        check_for_required_properties(['name'], json, &quot;type member&quot;)
+        log.debug(&quot;parse type member %s&quot; % json['name'])
+
+        type_ref = TypeReference(json.get('type'), json.get('$ref'), json.get('enum'), json.get('items'))
+        return TypeMember(json['name'], type_ref, json.get('optional', False), json.get('description', &quot;&quot;))
+
+    def parse_command(self, json):
+        check_for_required_properties(['name'], json, &quot;command&quot;)
+        log.debug(&quot;parse command %s&quot; % json['name'])
+
+        call_parameters = []
+        return_parameters = []
+
+        if 'parameters' in json:
+            if not isinstance(json['parameters'], list):
+                raise ParseException(&quot;Malformed command specification: parameters is not an array&quot;)
+            call_parameters.extend([self.parse_call_or_return_parameter(parameter) for parameter in json['parameters']])
+
+        if 'returns' in json:
+            if not isinstance(json['returns'], list):
+                raise ParseException(&quot;Malformed command specification: returns is not an array&quot;)
+            return_parameters.extend([self.parse_call_or_return_parameter(parameter) for parameter in json['returns']])
+
+        return Command(json['name'], call_parameters, return_parameters, json.get('description', &quot;&quot;), json.get('async', False))
+
+    def parse_event(self, json):
+        check_for_required_properties(['name'], json, &quot;event&quot;)
+        log.debug(&quot;parse event %s&quot; % json['name'])
+
+        event_parameters = []
+
+        if 'parameters' in json:
+            if not isinstance(json['parameters'], list):
+                raise ParseException(&quot;Malformed event specification: parameters is not an array&quot;)
+            event_parameters.extend([self.parse_call_or_return_parameter(parameter) for parameter in json['parameters']])
+
+        return Event(json['name'], event_parameters, json.get('description', &quot;&quot;))
+
+    def parse_call_or_return_parameter(self, json):
+        check_for_required_properties(['name'], json, &quot;parameter&quot;)
+        log.debug(&quot;parse parameter %s&quot; % json['name'])
+
+        type_ref = TypeReference(json.get('type'), json.get('$ref'), json.get('enum'), json.get('items'))
+        return Parameter(json['name'], type_ref, json.get('optional', False), json.get('description', &quot;&quot;))
+
+    def resolve_types(self):
+        qualified_declared_type_names = set(['boolean', 'string', 'integer', 'number', 'enum', 'array', 'object', 'any'])
+
+        self.types_by_name['string'] = PrimitiveType('string')
+        for _primitive_type in ['boolean', 'integer', 'number']:
+            self.types_by_name[_primitive_type] = PrimitiveType(_primitive_type)
+        for _object_type in ['any', 'object']:
+            self.types_by_name[_object_type] = PrimitiveType(_object_type)
+
+        # Gather qualified type names from type declarations in each domain.
+        for domain in self.domains:
+            for declaration in domain.type_declarations:
+                # Basic sanity checking.
+                if declaration.type_ref.referenced_type_name is not None:
+                    raise TypecheckException(&quot;Type declarations must name a base type, not a type reference.&quot;)
+
+                # Find duplicate qualified type names.
+                qualified_type_name = &quot;.&quot;.join([domain.domain_name, declaration.type_name])
+                if qualified_type_name in qualified_declared_type_names:
+                    raise TypecheckException(&quot;Duplicate type declaration: %s&quot; % qualified_type_name)
+
+                qualified_declared_type_names.add(qualified_type_name)
+
+                type_instance = None
+
+                kind = declaration.type_ref.type_kind
+                if declaration.type_ref.enum_values is not None:
+                    primitive_type_ref = TypeReference(declaration.type_ref.type_kind, None, None, None)
+                    type_instance = EnumType(declaration.type_name, domain, declaration.type_ref.enum_values, primitive_type_ref)
+                elif kind == &quot;array&quot;:
+                    type_instance = ArrayType(declaration.type_ref.array_type_ref, domain)
+                elif kind == &quot;object&quot;:
+                    type_instance = ObjectType(declaration.type_name, domain, declaration.type_members)
+                else:
+                    type_instance = AliasedType(declaration.type_name, domain, declaration.type_ref)
+
+                log.debug(&quot;&lt; Created fresh type %r for declaration %s&quot; % (type_instance, qualified_type_name))
+                self.types_by_name[qualified_type_name] = type_instance
+
+        # Resolve all type references recursively.
+        for domain in self.domains:
+            domain.resolve_type_references(self)
+
+    def lookup_type_for_declaration(self, declaration, domain):
+        # This will only match a type defined in the same domain, where prefixes aren't required.
+        qualified_name = &quot;.&quot;.join([domain.domain_name, declaration.type_name])
+        if qualified_name in self.types_by_name:
+            found_type = self.types_by_name[qualified_name]
+            found_type.resolve_type_references(self)
+            return found_type
+
+        raise TypecheckException(&quot;Lookup failed for type declaration: %s (referenced from domain: %s)&quot; % (declaration.type_name, domain.domain_name))
+
+    def lookup_type_reference(self, type_ref, domain):
+        # If reference is to an anonymous array type, create a fresh instance.
+        if type_ref.type_kind == &quot;array&quot;:
+            type_instance = ArrayType(type_ref.array_type_ref, domain)
+            type_instance.resolve_type_references(self)
+            log.debug(&quot;&lt; Created fresh type instance for anonymous array type: %s&quot; % type_instance.qualified_name())
+            return type_instance
+
+        # If reference is to an anonymous enum type, create a fresh instance.
+        if type_ref.enum_values is not None:
+            # We need to create a type reference without enum values as the enum's nested type.
+            primitive_type_ref = TypeReference(type_ref.type_kind, None, None, None)
+            type_instance = EnumType(&quot;(anonymous)&quot;, domain, type_ref.enum_values, primitive_type_ref, True)
+            type_instance.resolve_type_references(self)
+            log.debug(&quot;&lt; Created fresh type instance for anonymous enum type: %s&quot; % type_instance.qualified_name())
+            return type_instance
+
+        # This will match when referencing a type defined in the same domain, where prefixes aren't required.
+        qualified_name = &quot;.&quot;.join([domain.domain_name, type_ref.referenced_name()])
+        if qualified_name in self.types_by_name:
+            found_type = self.types_by_name[qualified_name]
+            found_type.resolve_type_references(self)
+            log.debug(&quot;&lt; Lookup succeeded for unqualified type: %s&quot; % found_type.qualified_name())
+            return found_type
+
+        # This will match primitive types and fully-qualified types from a different domain.
+        if type_ref.referenced_name() in self.types_by_name:
+            found_type = self.types_by_name[type_ref.referenced_name()]
+            found_type.resolve_type_references(self)
+            log.debug(&quot;&lt; Lookup succeeded for primitive or qualified type: %s&quot; % found_type.qualified_name())
+            return found_type
+
+        raise TypecheckException(&quot;Lookup failed for type reference: %s (referenced from domain: %s)&quot; % (type_ref.referenced_name(), domain.domain_name))
+
+
+class Domain:
+    def __init__(self, domain_name, description, isSupplemental, type_declarations, commands, events):
+        self.domain_name = domain_name
+        self.description = description
+        self.is_supplemental = isSupplemental
+        self.type_declarations = type_declarations
+        self.commands = commands
+        self.events = events
+
+    def resolve_type_references(self, protocol):
+        log.debug(&quot;&gt; Resolving type declarations for domain: %s&quot; % self.domain_name)
+        for declaration in self.type_declarations:
+            declaration.resolve_type_references(protocol, self)
+
+        log.debug(&quot;&gt; Resolving types in commands for domain: %s&quot; % self.domain_name)
+        for command in self.commands:
+            command.resolve_type_references(protocol, self)
+
+        log.debug(&quot;&gt; Resolving types in events for domain: %s&quot; % self.domain_name)
+        for event in self.events:
+            event.resolve_type_references(protocol, self)
+
+
+class Domains:
+    GLOBAL = Domain(&quot;&quot;, &quot;The global domain, in which primitive types are implicitly declared.&quot;, True, [], [], [])
+
+
+class TypeDeclaration:
+    def __init__(self, type_name, type_ref, description, type_members):
+        self.type_name = _TYPES_NEEDING_RENAME_WORKAROUNDS.get(type_name, type_name)
+        self.type_ref = type_ref
+        self.description = description
+        self.type_members = type_members
+
+        if self.type_name != ucfirst(self.type_name):
+            raise ParseException(&quot;Types must begin with an uppercase character.&quot;)
+
+    def resolve_type_references(self, protocol, domain):
+        log.debug(&quot;&gt;&gt; Resolving type references for type declaration: %s&quot; % self.type_name)
+        self.type = protocol.lookup_type_for_declaration(self, domain)
+        for member in self.type_members:
+            member.resolve_type_references(protocol, domain)
+
+
+class TypeMember:
+    def __init__(self, member_name, type_ref, is_optional, description):
+        self.member_name = member_name
+        self.type_ref = type_ref
+        self.is_optional = is_optional
+        self.description = description
+
+        if self.is_optional not in [True, False]:
+            raise ParseException(&quot;The 'optional' flag for a type member must be a boolean literal.&quot;)
+
+    def resolve_type_references(self, protocol, domain):
+        log.debug(&quot;&gt;&gt;&gt; Resolving type references for type member: %s&quot; % self.member_name)
+        self.type = protocol.lookup_type_reference(self.type_ref, domain)
+
+
+class Parameter:
+    def __init__(self, parameter_name, type_ref, is_optional, description):
+        self.parameter_name = parameter_name
+        self.type_ref = type_ref
+        self.is_optional = is_optional
+        self.description = description
+
+        if self.is_optional not in [True, False]:
+            raise ParseException(&quot;The 'optional' flag for a parameter must be a boolean literal.&quot;)
+
+    def resolve_type_references(self, protocol, domain):
+        log.debug(&quot;&gt;&gt;&gt; Resolving type references for parameter: %s&quot; % self.parameter_name)
+        self.type = protocol.lookup_type_reference(self.type_ref, domain)
+
+
+class Command:
+    def __init__(self, command_name, call_parameters, return_parameters, description, is_async):
+        self.command_name = command_name
+        self.call_parameters = call_parameters
+        self.return_parameters = return_parameters
+        self.description = description
+        self.is_async = is_async
+
+    def resolve_type_references(self, protocol, domain):
+        log.debug(&quot;&gt;&gt; Resolving type references for call parameters in command: %s&quot; % self.command_name)
+        for parameter in self.call_parameters:
+            parameter.resolve_type_references(protocol, domain)
+
+        log.debug(&quot;&gt;&gt; Resolving type references for return parameters in command: %s&quot; % self.command_name)
+        for parameter in self.return_parameters:
+            parameter.resolve_type_references(protocol, domain)
+
+
+class Event:
+    def __init__(self, event_name, event_parameters, description):
+        self.event_name = event_name
+        self.event_parameters = event_parameters
+        self.description = description
+
+    def resolve_type_references(self, protocol, domain):
+        log.debug(&quot;&gt;&gt; Resolving type references for parameters in event: %s&quot; % self.event_name)
+        for parameter in self.event_parameters:
+            parameter.resolve_type_references(protocol, domain)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsgenerateinspectorprotocolbindingspy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,186 @@
</span><ins>+#!/usr/bin/env python
+#
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+# Copyright (c) 2014 University of Washington. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+# This script generates JS and C++ bindings for the inspector protocol.
+# Generators for individual files are located in the codegen/ directory.
+
+import os.path
+import re
+import sys
+import string
+from string import Template
+import optparse
+import logging
+
+try:
+    import json
+except ImportError:
+    import simplejson as json
+
+try:
+    from codegen import *
+
+# When copying generator files to JavaScriptCore's private headers on Mac,
+# the codegen/ module directory is flattened. So, import directly.
+except ImportError:
+    import models
+    from models import *
+    from generator import *
+
+    from generate_backend_commands import *
+    from generate_backend_dispatcher_header import *
+    from generate_backend_dispatcher_implementation import *
+    from generate_frontend_dispatcher_header import *
+    from generate_frontend_dispatcher_implementation import *
+    from generate_type_builder_header import *
+    from generate_type_builder_implementation import *
+
+
+logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
+log = logging.getLogger('global')
+
+
+# A writer that only updates file if it actually changed.
+class IncrementalFileWriter:
+    def __init__(self, filepath, force_output):
+        self._filepath = filepath
+        self._output = &quot;&quot;
+        self.force_output = force_output
+
+    def write(self, text):
+        self._output += text
+
+    def close(self):
+        text_changed = True
+        self._output = self._output.rstrip() + &quot;\n&quot;
+
+        try:
+            if self.force_output:
+                raise
+
+            read_file = open(self._filepath, &quot;r&quot;)
+            old_text = read_file.read()
+            read_file.close()
+            text_changed = old_text != self._output
+        except:
+            # Ignore, just overwrite by default
+            pass
+
+        if text_changed or self.force_output:
+            out_file = open(self._filepath, &quot;w&quot;)
+            out_file.write(self._output)
+            out_file.close()
+
+
+def generate_from_specification(primary_specification_filepath=None,
+                                supplemental_specification_filepaths=[],
+                                concatenate_output=False,
+                                output_dirpath=None,
+                                force_output=False,
+                                framework_name=&quot;&quot;):
+
+    def load_specification(protocol, filepath, isSupplemental=False):
+        try:
+            with open(filepath, &quot;r&quot;) as input_file:
+                parsed_json = json.load(input_file)
+                protocol.parse_specification(parsed_json, isSupplemental)
+        except ValueError as e:
+            raise Exception(&quot;Error parsing valid JSON in file: &quot; + filepath)
+
+    protocol = models.Protocol(framework_name)
+    for specification in supplemental_specification_filepaths:
+        load_specification(protocol, specification, isSupplemental=True)
+    load_specification(protocol, primary_specification_filepath, isSupplemental=False)
+
+    protocol.resolve_types()
+
+    generators = []
+    generators.append(BackendCommandsGenerator(protocol, primary_specification_filepath))
+    generators.append(BackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+    generators.append(BackendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+    generators.append(FrontendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+    generators.append(FrontendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+    generators.append(TypeBuilderHeaderGenerator(protocol, primary_specification_filepath))
+    generators.append(TypeBuilderImplementationGenerator(protocol, primary_specification_filepath))
+
+    single_output_file_contents = []
+
+    for generator in generators:
+        output = generator.generate_output()
+        if concatenate_output:
+            single_output_file_contents.append('### Begin File: %s' % generator.output_filename())
+            single_output_file_contents.append(output)
+            single_output_file_contents.append('### End File: %s' % generator.output_filename())
+            single_output_file_contents.append('')
+        else:
+            output_file = IncrementalFileWriter(os.path.join(output_dirpath, generator.output_filename()), force_output)
+            output_file.write(output)
+            output_file.close()
+
+    if concatenate_output:
+        filename = os.path.join(os.path.basename(primary_specification_filepath) + '-result')
+        output_file = IncrementalFileWriter(os.path.join(output_dirpath, filename), force_output)
+        output_file.write('\n'.join(single_output_file_contents))
+        output_file.close()
+
+
+if __name__ == '__main__':
+    allowed_framework_names = ['WTF', 'JavaScriptCore', 'WebCore', 'WebKit', 'WebKit2', 'Test']
+    cli_parser = optparse.OptionParser(usage=&quot;usage: %prog [options] PrimaryProtocol.json [SupplementalProtocol.json ...]&quot;)
+    cli_parser.add_option(&quot;-o&quot;, &quot;--outputDir&quot;, help=&quot;Directory where generated files should be written.&quot;)
+    cli_parser.add_option(&quot;--framework&quot;, type=&quot;choice&quot;, choices=allowed_framework_names, help=&quot;The framework that the primary specification belongs to.&quot;)
+    cli_parser.add_option(&quot;--force&quot;, action=&quot;store_true&quot;, help=&quot;Force output of generated scripts, even if nothing changed.&quot;)
+    cli_parser.add_option(&quot;-v&quot;, &quot;--debug&quot;, action=&quot;store_true&quot;, help=&quot;Log extra output for debugging the generator itself.&quot;)
+    cli_parser.add_option(&quot;-t&quot;, &quot;--test&quot;, action=&quot;store_true&quot;, help=&quot;Enable test mode. Use unique output filenames created by prepending the input filename.&quot;)
+
+    options = None
+
+    arg_options, arg_values = cli_parser.parse_args()
+    if (len(arg_values) &lt; 1):
+        raise ParseException(&quot;At least one plain argument expected&quot;)
+
+    if not arg_options.outputDir:
+        raise ParseException(&quot;Missing output directory&quot;)
+
+    if arg_options.debug:
+        log.setLevel(logging.DEBUG)
+
+    options = {
+        'primary_specification_filepath': arg_values[0],
+        'supplemental_specification_filepaths': arg_values[1:],
+        'output_dirpath': arg_options.outputDir,
+        'concatenate_output': arg_options.test,
+        'framework_name': arg_options.framework,
+        'force_output': arg_options.force
+    }
+
+    try:
+        generate_from_specification(**options)
+    except (ParseException, TypecheckException) as e:
+        if arg_options.test:
+            log.error(e.message)
+        else:
+            raise  # Force the build to fail.
</ins><span class="cx">Property changes on: trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestscommandswithasyncattributejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-async-attribute.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-async-attribute.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-async-attribute.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;DatabaseId&quot;,
+            &quot;type&quot;: &quot;integer&quot;,
+            &quot;description&quot;: &quot;Unique identifier of Database object.&quot;
+        },
+        {
+            &quot;id&quot;: &quot;PrimaryColors&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;Error&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Database error.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;message&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Error message.&quot; },
+                { &quot;name&quot;: &quot;code&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Error code.&quot; }
+            ]
+        }
+    ],
+    &quot;commands&quot;: [
+        {
+            &quot;name&quot;: &quot;executeSQLSyncOptionalReturnValues&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;], &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;name&quot;: &quot;executeSQLAsyncOptionalReturnValues&quot;,
+            &quot;async&quot;: true,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;], &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;name&quot;: &quot;executeSQLSync&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot; },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot; },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;] }
+            ]
+        },
+        {
+            &quot;name&quot;: &quot;executeSQLAsync&quot;,
+            &quot;async&quot;: true,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot; },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot; },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;] }
+            ]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestscommandswithoptionalcallreturnparametersjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-optional-call-return-parameters.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-optional-call-return-parameters.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/commands-with-optional-call-return-parameters.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;DatabaseId&quot;,
+            &quot;type&quot;: &quot;integer&quot;,
+            &quot;description&quot;: &quot;Unique identifier of Database object.&quot;
+        },
+        {
+            &quot;id&quot;: &quot;PrimaryColors&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;Error&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Database error.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;message&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Error message.&quot; },
+                { &quot;name&quot;: &quot;code&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Error code.&quot; }
+            ]
+        }
+    ],
+    &quot;commands&quot;: [
+        {
+            &quot;name&quot;: &quot;executeAllOptionalParameters&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;], &quot;optional&quot;: true }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;], &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;name&quot;: &quot;executeNoOptionalParameters&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot; },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot; },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;] }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;databaseId&quot;, &quot;$ref&quot;: &quot;DatabaseId&quot; },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot; },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot; },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;] }
+            ]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsdomainswithvaryingcommandsizesjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/domains-with-varying-command-sizes.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/domains-with-varying-command-sizes.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/domains-with-varying-command-sizes.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Network1&quot;,
+    &quot;commands&quot;: [
+        {
+            &quot;name&quot;: &quot;loadResource1&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        }
+    ]
+},
+{
+    &quot;domain&quot;: &quot;Network2&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;LoaderId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique loader identifier.&quot;
+        }
+    ]
+},
+{
+    &quot;domain&quot;: &quot;Network3&quot;,
+    &quot;commands&quot;: [
+        {
+            &quot;name&quot;: &quot;loadResource1&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource2&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource3&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource4&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource5&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource6&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;loadResource7&quot;,
+            &quot;description&quot;: &quot;Loads a resource in the context of a frame on the inspected page without cross origin checks.&quot;
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestseventswithoptionalparametersjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/events-with-optional-parameters.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/events-with-optional-parameters.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/events-with-optional-parameters.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;DatabaseId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique identifier of Database object.&quot;
+        },
+        {
+            &quot;id&quot;: &quot;PrimaryColors&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;values&quot;: [&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;Error&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Database error.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;message&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Error message.&quot; },
+                { &quot;name&quot;: &quot;code&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Error code.&quot; }
+            ]
+        }
+    ],
+    &quot;events&quot;: [
+        {
+            &quot;name&quot;: &quot;didExecuteOptionalParameters&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;values&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;], &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;name&quot;: &quot;didExecuteNoOptionalParameters&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;sqlError&quot;, &quot;$ref&quot;: &quot;Error&quot; },
+                { &quot;name&quot;: &quot;screenColor&quot;, &quot;$ref&quot;: &quot;PrimaryColors&quot; },
+                { &quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;values&quot;: [&quot;cyan&quot;, &quot;magenta&quot;, &quot;yellow&quot;, &quot;black&quot;] }
+            ]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedcommandswithasyncattributejsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,738 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Database.
+InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, &quot;Database&quot;);
+InspectorBackend.registerEnum(&quot;Database.PrimaryColors&quot;, {Red: &quot;red&quot;, Green: &quot;green&quot;, Blue: &quot;blue&quot;});
+InspectorBackend.registerCommand(&quot;Database.executeSQLSyncOptionalReturnValues&quot;, [{&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+InspectorBackend.registerCommand(&quot;Database.executeSQLAsyncOptionalReturnValues&quot;, [{&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+InspectorBackend.registerCommand(&quot;Database.executeSQLSync&quot;, [{&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+InspectorBackend.registerCommand(&quot;Database.executeSQLAsync&quot;, [{&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;query&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(SQL_DATABASE)
+class InspectorDatabaseBackendDispatcherHandler {
+public:
+    // Named after parameter 'screenColor' while generating command/event executeSQLSyncOptionalReturnValues.
+    enum class ScreenColor {
+        Red = 0,
+        Green = 1,
+        Blue = 2,
+    }; // enum class ScreenColor
+    // Named after parameter 'printColor' while generating command/event executeSQLSyncOptionalReturnValues.
+    enum class PrintColor {
+        Cyan = 3,
+        Magenta = 4,
+        Yellow = 5,
+        Black = 6,
+    }; // enum class PrintColor
+    virtual void executeSQLSyncOptionalReturnValues(ErrorString*, int in_databaseId, const String&amp; in_query, RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt;&amp; opt_out_columnNames, Inspector::TypeBuilder::OptOutput&lt;String&gt;* opt_out_notes, Inspector::TypeBuilder::OptOutput&lt;double&gt;* opt_out_timestamp, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt;* opt_out_values, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt;* opt_out_payload, Inspector::TypeBuilder::OptOutput&lt;int&gt;* opt_out_databaseId, RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt;&amp; opt_out_sqlError, Inspector::TypeBuilder::Database::PrimaryColors* opt_out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
+    class ExecuteSQLAsyncOptionalReturnValuesCallback : public Inspector::InspectorBackendDispatcher::CallbackBase {
+    public:
+        ExecuteSQLAsyncOptionalReturnValuesCallback(PassRefPtr&lt;Inspector::InspectorBackendDispatcher&gt;, int id);
+        void sendSuccess(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, Inspector::TypeBuilder::OptOutput&lt;String&gt;* notes, Inspector::TypeBuilder::OptOutput&lt;double&gt;* timestamp, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt;* values, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt;* payload, Inspector::TypeBuilder::OptOutput&lt;int&gt;* databaseId, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, Inspector::TypeBuilder::OptOutput&lt;String&gt;* screenColor, Inspector::TypeBuilder::OptOutput&lt;String&gt;* printColor);
+    };
+    virtual void executeSQLAsyncOptionalReturnValues(ErrorString*, int in_databaseId, const String&amp; in_query, PassRefPtr&lt;ExecuteSQLAsyncOptionalReturnValuesCallback&gt; callback) = 0;
+    virtual void executeSQLSync(ErrorString*, int in_databaseId, const String&amp; in_query, RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt;&amp; out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt;&amp; out_sqlError, Inspector::TypeBuilder::Database::PrimaryColors* out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
+    class ExecuteSQLAsyncCallback : public Inspector::InspectorBackendDispatcher::CallbackBase {
+    public:
+        ExecuteSQLAsyncCallback(PassRefPtr&lt;Inspector::InspectorBackendDispatcher&gt;, int id);
+        void sendSuccess(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String&amp; notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const String&amp; screenColor, const String&amp; printColor);
+    };
+    virtual void executeSQLAsync(ErrorString*, int in_databaseId, const String&amp; in_query, PassRefPtr&lt;ExecuteSQLAsyncCallback&gt; callback) = 0;
+protected:
+    virtual ~InspectorDatabaseBackendDispatcherHandler();
+};
+#endif // ENABLE(SQL_DATABASE)
+
+#if ENABLE(SQL_DATABASE)
+class InspectorDatabaseBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;InspectorDatabaseBackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+private:
+    void executeSQLSyncOptionalReturnValues(long callId, const Inspector::InspectorObject&amp; message);
+    void executeSQLAsyncOptionalReturnValues(long callId, const Inspector::InspectorObject&amp; message);
+    void executeSQLSync(long callId, const Inspector::InspectorObject&amp; message);
+    void executeSQLAsync(long callId, const Inspector::InspectorObject&amp; message);
+private:
+    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    InspectorDatabaseBackendDispatcherHandler* m_agent;
+};
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+#if ENABLE(SQL_DATABASE)
+InspectorDatabaseBackendDispatcherHandler::~InspectorDatabaseBackendDispatcherHandler() { }
+#endif // ENABLE(SQL_DATABASE)
+
+#if ENABLE(SQL_DATABASE)
+PassRefPtr&lt;InspectorDatabaseBackendDispatcher&gt; InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+{
+    return adoptRef(new InspectorDatabaseBackendDispatcher(backendDispatcher, agent));
+}
+
+InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;Database&quot;), this);
+}
+
+void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;InspectorDatabaseBackendDispatcher&gt; protect(*this);
+
+    if (method == &quot;executeSQLSyncOptionalReturnValues&quot;)
+        executeSQLSyncOptionalReturnValues(callId, *message.get());
+    else if (method == &quot;executeSQLAsyncOptionalReturnValues&quot;)
+        executeSQLAsyncOptionalReturnValues(callId, *message.get());
+    else if (method == &quot;executeSQLSync&quot;)
+        executeSQLSync(callId, *message.get());
+    else if (method == &quot;executeSQLAsync&quot;)
+        executeSQLAsync(callId, *message.get());
+    else
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;Database&quot; + '.' + method + &quot;' was not found&quot;);
+}
+
+void InspectorDatabaseBackendDispatcher::executeSQLSyncOptionalReturnValues(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;query&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeSQLSyncOptionalReturnValues&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; out_columnNames;
+    Inspector::TypeBuilder::OptOutput&lt;String&gt; out_notes;
+    Inspector::TypeBuilder::OptOutput&lt;double&gt; out_timestamp;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt; out_values;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt; out_payload;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::TypeBuilder::Database::DatabaseId&gt; out_databaseId;
+    RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; out_sqlError;
+    Inspector::TypeBuilder::Database::PrimaryColors out_screenColor;
+    InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
+    m_agent-&gt;executeSQLSyncOptionalReturnValues(&amp;error, in_databaseId, in_query, out_columnNames, &amp;out_notes, &amp;out_timestamp, out_values, &amp;out_payload, &amp;out_databaseId, out_sqlError, &amp;out_screenColor, &amp;out_printColor);
+
+    if (!error.length()) {
+        if (out_columnNames)
+            result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), out_columnNames);
+        if (out_notes.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;notes&quot;), out_notes.getValue());
+        if (out_timestamp.isAssigned())
+            result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), out_timestamp.getValue());
+        if (out_values.isAssigned())
+            result-&gt;setObject(ASCIILiteral(&quot;values&quot;), out_values.getValue());
+        if (out_payload.isAssigned())
+            result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), out_payload.getValue());
+        if (out_databaseId.isAssigned())
+            result-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), out_databaseId.getValue());
+        if (out_sqlError)
+            result-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), out_sqlError);
+        if (out_screenColor.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), out_screenColor.getValue());
+        if (out_printColor.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;printColor&quot;), out_printColor.getValue());
+    }
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::ExecuteSQLAsyncOptionalReturnValuesCallback(PassRefPtr&lt;InspectorBackendDispatcher&gt; backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
+
+void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback::sendSuccess(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, Inspector::TypeBuilder::OptOutput&lt;String&gt;* notes, Inspector::TypeBuilder::OptOutput&lt;double&gt;* timestamp, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt;* values, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt;* payload, Inspector::TypeBuilder::OptOutput&lt;int&gt;* databaseId, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, Inspector::TypeBuilder::OptOutput&lt;String&gt;* screenColor, Inspector::TypeBuilder::OptOutput&lt;String&gt;* printColor)
+{
+    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
+    if (columnNames)
+        jsonMessage-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), columnNames);
+    if (notes.isAssigned())
+        jsonMessage-&gt;setString(ASCIILiteral(&quot;notes&quot;), notes.getValue());
+    if (timestamp.isAssigned())
+        jsonMessage-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), timestamp.getValue());
+    if (values.isAssigned())
+        jsonMessage-&gt;setObject(ASCIILiteral(&quot;values&quot;), values.getValue());
+    if (payload.isAssigned())
+        jsonMessage-&gt;setValue(ASCIILiteral(&quot;payload&quot;), payload.getValue());
+    if (databaseId.isAssigned())
+        jsonMessage-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), databaseId.getValue());
+    if (sqlError)
+        jsonMessage-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), sqlError);
+    if (screenColor.isAssigned())
+        jsonMessage-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), screenColor.getValue());
+    if (printColor.isAssigned())
+        jsonMessage-&gt;setString(ASCIILiteral(&quot;printColor&quot;), printColor.getValue());
+    sendIfActive(jsonMessage, ErrorString());
+}
+
+void InspectorDatabaseBackendDispatcher::executeSQLAsyncOptionalReturnValues(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;query&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeSQLAsyncOptionalReturnValues&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback&gt; callback = adoptRef(new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncOptionalReturnValuesCallback(m_backendDispatcher,callId));
+    m_agent-&gt;executeSQLAsyncOptionalReturnValues(&amp;error, in_databaseId, in_query, callback);
+
+    if (error.length()) {
+        callback-&gt;disable();
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, Inspector::InspectorBackendDispatcher::ServerError, error);
+        return;
+    }
+}
+
+void InspectorDatabaseBackendDispatcher::executeSQLSync(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;query&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeSQLSync&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; out_columnNames;
+    String out_notes;
+    double out_timestamp;
+    Inspector::InspectorObject out_values;
+    Inspector::InspectorValue out_payload;
+    Inspector::TypeBuilder::Database::DatabaseId out_databaseId;
+    RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; out_sqlError;
+    Inspector::TypeBuilder::Database::PrimaryColors out_screenColor;
+    InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
+    m_agent-&gt;executeSQLSync(&amp;error, in_databaseId, in_query, out_columnNames, &amp;out_notes, &amp;out_timestamp, out_values, &amp;out_payload, &amp;out_databaseId, out_sqlError, &amp;out_screenColor, &amp;out_printColor);
+
+    if (!error.length()) {
+        result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), out_columnNames);
+        result-&gt;setString(ASCIILiteral(&quot;notes&quot;), out_notes);
+        result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), out_timestamp);
+        result-&gt;setObject(ASCIILiteral(&quot;values&quot;), out_values);
+        result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), out_payload);
+        result-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), out_databaseId);
+        result-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), out_sqlError);
+        result-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(out_screenColor));
+        result-&gt;setString(ASCIILiteral(&quot;printColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(out_printColor));
+    }
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::ExecuteSQLAsyncCallback(PassRefPtr&lt;InspectorBackendDispatcher&gt; backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
+
+void InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback::sendSuccess(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String&amp; notes, double timestamp, Inspector::InspectorObject values, Inspector::InspectorValue payload, int databaseId, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const String&amp; screenColor, const String&amp; printColor)
+{
+    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
+    jsonMessage-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), columnNames);
+    jsonMessage-&gt;setString(ASCIILiteral(&quot;notes&quot;), notes);
+    jsonMessage-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), timestamp);
+    jsonMessage-&gt;setObject(ASCIILiteral(&quot;values&quot;), values);
+    jsonMessage-&gt;setValue(ASCIILiteral(&quot;payload&quot;), payload);
+    jsonMessage-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), databaseId);
+    jsonMessage-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), sqlError);
+    jsonMessage-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(screenColor));
+    jsonMessage-&gt;setString(ASCIILiteral(&quot;printColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(printColor));
+    sendIfActive(jsonMessage, ErrorString());
+}
+
+void InspectorDatabaseBackendDispatcher::executeSQLAsync(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), nullptr, protocolErrorsPtr);
+    String in_query = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;query&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeSQLAsync&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback&gt; callback = adoptRef(new InspectorDatabaseBackendDispatcherHandler::ExecuteSQLAsyncCallback(m_backendDispatcher,callId));
+    m_agent-&gt;executeSQLAsync(&amp;error, in_databaseId, in_query, callback);
+
+    if (error.length()) {
+        callback-&gt;disable();
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, Inspector::InspectorBackendDispatcher::ServerError, error);
+        return;
+    }
+}
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+class Error;
+enum class PrimaryColors;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of forward declarations.
+
+
+// Typedefs.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/* Unique identifier of Database object. */
+typedef int DatabaseId;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/*  */
+enum class PrimaryColors {
+    Red = 0,
+    Green = 1,
+    Blue = 2,
+}; // enum class PrimaryColors
+/* Database error. */
+class Error : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        MessageSet = 1 &lt;&lt; 0,
+        CodeSet = 1 &lt;&lt; 1,
+        AllFieldsSet = (MessageSet | CodeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*Error*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class Error;
+    public:
+
+        Builder&lt;STATE | MessageSet&gt;&amp; setMessage(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; MessageSet), property_message_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;message&quot;), value);
+            return castState&lt;MessageSet&gt;();
+        }
+
+        Builder&lt;STATE | CodeSet&gt;&amp; setCode(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; CodeSet), property_code_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;code&quot;), value);
+            return castState&lt;CodeSet&gt;();
+        }
+
+        operator RefPtr&lt;Error&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;Error&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;Error&gt; release()
+        {
+            return RefPtr&lt;Error&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;Error&gt; result = Error::create()
+     *     .setMessage(...)
+     *     .setCode(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;red&quot;,
+    &quot;green&quot;,
+    &quot;blue&quot;,
+    &quot;cyan&quot;,
+    &quot;magenta&quot;,
+    &quot;yellow&quot;,
+    &quot;black&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedcommandswithoptionalcallreturnparametersjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,645 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Database.
+InspectorBackend.registerEnum(&quot;Database.PrimaryColors&quot;, {Red: &quot;red&quot;, Green: &quot;green&quot;, Blue: &quot;blue&quot;});
+InspectorBackend.registerCommand(&quot;Database.executeAllOptionalParameters&quot;, [{&quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;sqlError&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;screenColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true}, {&quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+InspectorBackend.registerCommand(&quot;Database.executeNoOptionalParameters&quot;, [{&quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;databaseId&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;sqlError&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;screenColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}, {&quot;name&quot;: &quot;printColor&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: false}], [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;databaseId&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(SQL_DATABASE)
+class InspectorDatabaseBackendDispatcherHandler {
+public:
+    // Named after parameter 'screenColor' while generating command/event executeAllOptionalParameters.
+    enum class ScreenColor {
+        Red = 0,
+        Green = 1,
+        Blue = 2,
+    }; // enum class ScreenColor
+    // Named after parameter 'printColor' while generating command/event executeAllOptionalParameters.
+    enum class PrintColor {
+        Cyan = 3,
+        Magenta = 4,
+        Yellow = 5,
+        Black = 6,
+    }; // enum class PrintColor
+    virtual void executeAllOptionalParameters(ErrorString*, const RefPtr&lt;Inspector::InspectorArray&gt;* in_columnNames, const String* in_notes, const double* in_timestamp, const RefPtr&lt;Inspector::InspectorObject&gt;* in_values, const Inspector::InspectorValue* in_payload, const int* in_databaseId, const RefPtr&lt;Inspector::InspectorObject&gt;* in_sqlError, const String* in_screenColor, const String* in_printColor, RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt;&amp; opt_out_columnNames, Inspector::TypeBuilder::OptOutput&lt;String&gt;* opt_out_notes, Inspector::TypeBuilder::OptOutput&lt;double&gt;* opt_out_timestamp, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt;* opt_out_values, Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt;* opt_out_payload, Inspector::TypeBuilder::OptOutput&lt;int&gt;* opt_out_databaseId, RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt;&amp; opt_out_sqlError, Inspector::TypeBuilder::Database::PrimaryColors* opt_out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* opt_out_printColor) = 0;
+    virtual void executeNoOptionalParameters(ErrorString*, const RefPtr&lt;Inspector::InspectorArray&gt;&amp; in_columnNames, const String&amp; in_notes, double in_timestamp, const RefPtr&lt;Inspector::InspectorObject&gt;&amp; in_values, Inspector::InspectorValue in_payload, int in_databaseId, const RefPtr&lt;Inspector::InspectorObject&gt;&amp; in_sqlError, const String&amp; in_screenColor, const String&amp; in_printColor, RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt;&amp; out_columnNames, String* out_notes, double* out_timestamp, Inspector::InspectorObject* out_values, Inspector::InspectorValue* out_payload, int* out_databaseId, RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt;&amp; out_sqlError, Inspector::TypeBuilder::Database::PrimaryColors* out_screenColor, InspectorDatabaseBackendDispatcherHandler::PrintColor* out_printColor) = 0;
+protected:
+    virtual ~InspectorDatabaseBackendDispatcherHandler();
+};
+#endif // ENABLE(SQL_DATABASE)
+
+#if ENABLE(SQL_DATABASE)
+class InspectorDatabaseBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;InspectorDatabaseBackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+private:
+    void executeAllOptionalParameters(long callId, const Inspector::InspectorObject&amp; message);
+    void executeNoOptionalParameters(long callId, const Inspector::InspectorObject&amp; message);
+private:
+    InspectorDatabaseBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorDatabaseBackendDispatcherHandler*);
+    InspectorDatabaseBackendDispatcherHandler* m_agent;
+};
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+#if ENABLE(SQL_DATABASE)
+InspectorDatabaseBackendDispatcherHandler::~InspectorDatabaseBackendDispatcherHandler() { }
+#endif // ENABLE(SQL_DATABASE)
+
+#if ENABLE(SQL_DATABASE)
+PassRefPtr&lt;InspectorDatabaseBackendDispatcher&gt; InspectorDatabaseBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+{
+    return adoptRef(new InspectorDatabaseBackendDispatcher(backendDispatcher, agent));
+}
+
+InspectorDatabaseBackendDispatcher::InspectorDatabaseBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorDatabaseBackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;Database&quot;), this);
+}
+
+void InspectorDatabaseBackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;InspectorDatabaseBackendDispatcher&gt; protect(*this);
+
+    if (method == &quot;executeAllOptionalParameters&quot;)
+        executeAllOptionalParameters(callId, *message.get());
+    else if (method == &quot;executeNoOptionalParameters&quot;)
+        executeNoOptionalParameters(callId, *message.get());
+    else
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;Database&quot; + '.' + method + &quot;' was not found&quot;);
+}
+
+void InspectorDatabaseBackendDispatcher::executeAllOptionalParameters(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    bool columnNames_valueFound = false;
+    RefPtr&lt;Inspector::InspectorArray&gt; in_columnNames = InspectorBackendDispatcher::getArray(paramsContainerPtr, ASCIILiteral(&quot;columnNames&quot;), &amp;columnNames_valueFound, protocolErrorsPtr);
+    bool notes_valueFound = false;
+    String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;notes&quot;), &amp;notes_valueFound, protocolErrorsPtr);
+    bool timestamp_valueFound = false;
+    Inspector::TypeBuilder::OptOutput&lt;double&gt; in_timestamp = InspectorBackendDispatcher::getNumber(paramsContainerPtr, ASCIILiteral(&quot;timestamp&quot;), &amp;timestamp_valueFound, protocolErrorsPtr);
+    bool values_valueFound = false;
+    RefPtr&lt;Inspector::InspectorObject&gt; in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral(&quot;values&quot;), &amp;values_valueFound, protocolErrorsPtr);
+    bool payload_valueFound = false;
+    RefPtr&lt;Inspector::InspectorValue&gt; in_payload = InspectorBackendDispatcher::getAny(paramsContainerPtr, ASCIILiteral(&quot;payload&quot;), &amp;payload_valueFound, protocolErrorsPtr);
+    bool databaseId_valueFound = false;
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), &amp;databaseId_valueFound, protocolErrorsPtr);
+    bool sqlError_valueFound = false;
+    RefPtr&lt;Inspector::InspectorObject&gt; in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral(&quot;sqlError&quot;), &amp;sqlError_valueFound, protocolErrorsPtr);
+    bool screenColor_valueFound = false;
+    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;screenColor&quot;), &amp;screenColor_valueFound, protocolErrorsPtr);
+    bool printColor_valueFound = false;
+    String in_printColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;printColor&quot;), &amp;printColor_valueFound, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeAllOptionalParameters&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; out_columnNames;
+    Inspector::TypeBuilder::OptOutput&lt;String&gt; out_notes;
+    Inspector::TypeBuilder::OptOutput&lt;double&gt; out_timestamp;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorObject&gt; out_values;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::InspectorValue&gt; out_payload;
+    Inspector::TypeBuilder::OptOutput&lt;Inspector::TypeBuilder::Database::DatabaseId&gt; out_databaseId;
+    RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; out_sqlError;
+    Inspector::TypeBuilder::Database::PrimaryColors out_screenColor;
+    InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
+    m_agent-&gt;executeAllOptionalParameters(&amp;error, columnNames_valueFound ? &amp;in_columnNames : nullptr, notes_valueFound ? &amp;in_notes : nullptr, timestamp_valueFound ? &amp;in_timestamp : nullptr, values_valueFound ? &amp;in_values : nullptr, payload_valueFound ? &amp;in_payload : nullptr, databaseId_valueFound ? &amp;in_databaseId : nullptr, sqlError_valueFound ? &amp;in_sqlError : nullptr, screenColor_valueFound ? &amp;in_screenColor : nullptr, printColor_valueFound ? &amp;in_printColor : nullptr, out_columnNames, &amp;out_notes, &amp;out_timestamp, out_values, &amp;out_payload, &amp;out_databaseId, out_sqlError, &amp;out_screenColor, &amp;out_printColor);
+
+    if (!error.length()) {
+        if (out_columnNames)
+            result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), out_columnNames);
+        if (out_notes.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;notes&quot;), out_notes.getValue());
+        if (out_timestamp.isAssigned())
+            result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), out_timestamp.getValue());
+        if (out_values.isAssigned())
+            result-&gt;setObject(ASCIILiteral(&quot;values&quot;), out_values.getValue());
+        if (out_payload.isAssigned())
+            result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), out_payload.getValue());
+        if (out_databaseId.isAssigned())
+            result-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), out_databaseId.getValue());
+        if (out_sqlError)
+            result-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), out_sqlError);
+        if (out_screenColor.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), out_screenColor.getValue());
+        if (out_printColor.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;printColor&quot;), out_printColor.getValue());
+    }
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    RefPtr&lt;Inspector::InspectorArray&gt; in_columnNames = InspectorBackendDispatcher::getArray(paramsContainerPtr, ASCIILiteral(&quot;columnNames&quot;), nullptr, protocolErrorsPtr);
+    String in_notes = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;notes&quot;), nullptr, protocolErrorsPtr);
+    double in_timestamp = InspectorBackendDispatcher::getNumber(paramsContainerPtr, ASCIILiteral(&quot;timestamp&quot;), nullptr, protocolErrorsPtr);
+    RefPtr&lt;Inspector::InspectorObject&gt; in_values = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral(&quot;values&quot;), nullptr, protocolErrorsPtr);
+    RefPtr&lt;Inspector::InspectorValue&gt; in_payload = InspectorBackendDispatcher::getAny(paramsContainerPtr, ASCIILiteral(&quot;payload&quot;), nullptr, protocolErrorsPtr);
+    int in_databaseId = InspectorBackendDispatcher::getInt(paramsContainerPtr, ASCIILiteral(&quot;databaseId&quot;), nullptr, protocolErrorsPtr);
+    RefPtr&lt;Inspector::InspectorObject&gt; in_sqlError = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral(&quot;sqlError&quot;), nullptr, protocolErrorsPtr);
+    String in_screenColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;screenColor&quot;), nullptr, protocolErrorsPtr);
+    String in_printColor = InspectorBackendDispatcher::getString(paramsContainerPtr, ASCIILiteral(&quot;printColor&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Database.executeNoOptionalParameters&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; out_columnNames;
+    String out_notes;
+    double out_timestamp;
+    Inspector::InspectorObject out_values;
+    Inspector::InspectorValue out_payload;
+    Inspector::TypeBuilder::Database::DatabaseId out_databaseId;
+    RefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; out_sqlError;
+    Inspector::TypeBuilder::Database::PrimaryColors out_screenColor;
+    InspectorDatabaseBackendDispatcherHandler::PrintColor out_printColor;
+    m_agent-&gt;executeNoOptionalParameters(&amp;error, in_columnNames, in_notes, in_timestamp, in_values, in_payload, in_databaseId, in_sqlError, in_screenColor, in_printColor, out_columnNames, &amp;out_notes, &amp;out_timestamp, out_values, &amp;out_payload, &amp;out_databaseId, out_sqlError, &amp;out_screenColor, &amp;out_printColor);
+
+    if (!error.length()) {
+        result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), out_columnNames);
+        result-&gt;setString(ASCIILiteral(&quot;notes&quot;), out_notes);
+        result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), out_timestamp);
+        result-&gt;setObject(ASCIILiteral(&quot;values&quot;), out_values);
+        result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), out_payload);
+        result-&gt;setNumber(ASCIILiteral(&quot;databaseId&quot;), out_databaseId);
+        result-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), out_sqlError);
+        result-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(out_screenColor));
+        result-&gt;setString(ASCIILiteral(&quot;printColor&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(out_printColor));
+    }
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+class Error;
+enum class PrimaryColors;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of forward declarations.
+
+
+// Typedefs.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/* Unique identifier of Database object. */
+typedef int DatabaseId;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/*  */
+enum class PrimaryColors {
+    Red = 0,
+    Green = 1,
+    Blue = 2,
+}; // enum class PrimaryColors
+/* Database error. */
+class Error : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        MessageSet = 1 &lt;&lt; 0,
+        CodeSet = 1 &lt;&lt; 1,
+        AllFieldsSet = (MessageSet | CodeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*Error*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class Error;
+    public:
+
+        Builder&lt;STATE | MessageSet&gt;&amp; setMessage(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; MessageSet), property_message_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;message&quot;), value);
+            return castState&lt;MessageSet&gt;();
+        }
+
+        Builder&lt;STATE | CodeSet&gt;&amp; setCode(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; CodeSet), property_code_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;code&quot;), value);
+            return castState&lt;CodeSet&gt;();
+        }
+
+        operator RefPtr&lt;Error&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;Error&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;Error&gt; release()
+        {
+            return RefPtr&lt;Error&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;Error&gt; result = Error::create()
+     *     .setMessage(...)
+     *     .setCode(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;red&quot;,
+    &quot;green&quot;,
+    &quot;blue&quot;,
+    &quot;cyan&quot;,
+    &quot;magenta&quot;,
+    &quot;yellow&quot;,
+    &quot;black&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpecteddomainswithvaryingcommandsizesjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,566 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Network1.
+InspectorBackend.registerCommand(&quot;Network1.loadResource1&quot;, [], []);
+
+// Network3.
+InspectorBackend.registerCommand(&quot;Network3.loadResource1&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource2&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource3&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource4&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource5&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource6&quot;, [], []);
+InspectorBackend.registerCommand(&quot;Network3.loadResource7&quot;, [], []);
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+class InspectorNetwork1BackendDispatcherHandler {
+public:
+    virtual void loadResource1(ErrorString*) = 0;
+protected:
+    virtual ~InspectorNetwork1BackendDispatcherHandler();
+};
+
+class InspectorNetwork3BackendDispatcherHandler {
+public:
+    virtual void loadResource1(ErrorString*) = 0;
+    virtual void loadResource2(ErrorString*) = 0;
+    virtual void loadResource3(ErrorString*) = 0;
+    virtual void loadResource4(ErrorString*) = 0;
+    virtual void loadResource5(ErrorString*) = 0;
+    virtual void loadResource6(ErrorString*) = 0;
+    virtual void loadResource7(ErrorString*) = 0;
+protected:
+    virtual ~InspectorNetwork3BackendDispatcherHandler();
+};
+
+class InspectorNetwork1BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;InspectorNetwork1BackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+private:
+    void loadResource1(long callId, const Inspector::InspectorObject&amp; message);
+private:
+    InspectorNetwork1BackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorNetwork1BackendDispatcherHandler*);
+    InspectorNetwork1BackendDispatcherHandler* m_agent;
+};
+
+class InspectorNetwork3BackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;InspectorNetwork3BackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, InspectorNetwork3BackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+private:
+    void loadResource1(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource2(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource3(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource4(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource5(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource6(long callId, const Inspector::InspectorObject&amp; message);
+    void loadResource7(long callId, const Inspector::InspectorObject&amp; message);
+private:
+    InspectorNetwork3BackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorNetwork3BackendDispatcherHandler*);
+    InspectorNetwork3BackendDispatcherHandler* m_agent;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+InspectorNetwork1BackendDispatcherHandler::~InspectorNetwork1BackendDispatcherHandler() { }
+InspectorNetwork3BackendDispatcherHandler::~InspectorNetwork3BackendDispatcherHandler() { }
+
+PassRefPtr&lt;InspectorNetwork1BackendDispatcher&gt; InspectorNetwork1BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+{
+    return adoptRef(new InspectorNetwork1BackendDispatcher(backendDispatcher, agent));
+}
+
+InspectorNetwork1BackendDispatcher::InspectorNetwork1BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork1BackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;Network1&quot;), this);
+}
+
+void InspectorNetwork1BackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;InspectorNetwork1BackendDispatcher&gt; protect(*this);
+
+    if (method == &quot;loadResource1&quot;)
+        loadResource1(callId, *message.get());
+    else
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;Network1&quot; + '.' + method + &quot;' was not found&quot;);
+}
+
+void InspectorNetwork1BackendDispatcher::loadResource1(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource1(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+PassRefPtr&lt;InspectorNetwork3BackendDispatcher&gt; InspectorNetwork3BackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
+{
+    return adoptRef(new InspectorNetwork3BackendDispatcher(backendDispatcher, agent));
+}
+
+InspectorNetwork3BackendDispatcher::InspectorNetwork3BackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorNetwork3BackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;Network3&quot;), this);
+}
+
+void InspectorNetwork3BackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;InspectorNetwork3BackendDispatcher&gt; protect(*this);
+
+    typedef void (InspectorNetwork3BackendDispatcher::*CallHandler)(long callId, const Inspector::InspectorObject&amp; message);
+    typedef HashMap&lt;String, CallHandler&gt; DispatchMap;
+    DEPRECATED_DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, ());
+    if (dispatchMap.isEmpty()) {
+        static const struct MethodTable {
+            const char* name;
+            CallHandler handler;
+        } commands[] = {
+            { &quot;loadResource1&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource1 },
+            { &quot;loadResource2&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource2 },
+            { &quot;loadResource3&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource3 },
+            { &quot;loadResource4&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource4 },
+            { &quot;loadResource5&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource5 },
+            { &quot;loadResource6&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource6 },
+            { &quot;loadResource7&quot;, &amp;InspectorNetwork3BackendDispatcher::loadResource7 },
+        };
+        size_t length = WTF_ARRAY_LENGTH(commands);
+        for (size_t i = 0; i &lt; length; ++i)
+            dispatchMap.add(commands[i].name, commands[i].handler);
+    }
+
+    HashMap&lt;String, CallHandler&gt;::iterator it = dispatchMap.find(method);
+    if (it == dispatchMap.end()) {
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;Network3&quot; + '.' + method + &quot;' was not found&quot;);
+        return;
+    }
+
+    ((*this).*it-&gt;value)(callId, *message.get());
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource1(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource1(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource2(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource2(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource3(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource3(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource4(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource4(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource5(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource5(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource6(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource6(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+void InspectorNetwork3BackendDispatcher::loadResource7(long callId, const InspectorObject&amp;)
+{
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    m_agent-&gt;loadResource7(&amp;error);
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+
+
+// Typedefs.
+namespace Network2 {
+/* Unique loader identifier. */
+typedef String LoaderId;
+} // Network2
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedeventswithoptionalparametersjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,511 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Database.
+InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, &quot;Database&quot;);
+InspectorBackend.registerEvent(&quot;Database.didExecuteOptionalParameters&quot;, [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+InspectorBackend.registerEvent(&quot;Database.didExecuteNoOptionalParameters&quot;, [&quot;columnNames&quot;, &quot;notes&quot;, &quot;timestamp&quot;, &quot;values&quot;, &quot;payload&quot;, &quot;sqlError&quot;, &quot;screenColor&quot;, &quot;printColor&quot;]);
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+#if ENABLE(SQL_DATABASE)
+class InspectorDatabaseFrontendDispatcher {
+public:
+    InspectorDatabaseFrontendDispatcher(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
+    void didExecuteOptionalParameters(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String* const notes, const double* const timestamp, PassRefPtr&lt;Inspector::InspectorObject&gt; values, PassRefPtr&lt;Inspector::InspectorValue&gt; payload, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const Inspector::TypeBuilder::Database::PrimaryColors* const screenColor, const String* const printColor);
+    void didExecuteNoOptionalParameters(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String&amp; notes, double timestamp, PassRefPtr&lt;Inspector::InspectorObject&gt; values, PassRefPtr&lt;Inspector::InspectorValue&gt; payload, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const Inspector::TypeBuilder::Database::PrimaryColors&amp; screenColor, const String&amp; printColor);
+private:
+    InspectorFrontendChannel* m_inspectorFrontendChannel;
+};
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+#if ENABLE(SQL_DATABASE)
+void InspectorDatabaseFrontendDispatcher::didExecuteOptionalParameters(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String* const notes, const double* const timestamp, PassRefPtr&lt;Inspector::InspectorObject&gt; values, PassRefPtr&lt;Inspector::InspectorValue&gt; payload, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const Inspector::TypeBuilder::Database::PrimaryColors* const screenColor, const String* const printColor)
+{
+    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
+    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;Database.didExecuteOptionalParameters&quot;));
+    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();
+    if (columnNames)
+        paramsObject-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), columnNames);
+    if (notes)
+        paramsObject-&gt;setString(ASCIILiteral(&quot;notes&quot;), *notes);
+    if (timestamp)
+        paramsObject-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), *timestamp);
+    if (values)
+        paramsObject-&gt;setObject(ASCIILiteral(&quot;values&quot;), values);
+    if (payload)
+        paramsObject-&gt;setValue(ASCIILiteral(&quot;payload&quot;), *payload);
+    if (sqlError)
+        paramsObject-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), sqlError);
+    if (screenColor)
+        paramsObject-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), *screenColor);
+    if (printColor)
+        paramsObject-&gt;setString(ASCIILiteral(&quot;printColor&quot;), *printColor);
+    jsonMessage-&gt;setObject(ASCIILiteral(&quot;params&quot;), paramsObject);
+
+    m_inspectorFrontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());
+}
+
+void InspectorDatabaseFrontendDispatcher::didExecuteNoOptionalParameters(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; columnNames, const String&amp; notes, double timestamp, PassRefPtr&lt;Inspector::InspectorObject&gt; values, PassRefPtr&lt;Inspector::InspectorValue&gt; payload, PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; sqlError, const Inspector::TypeBuilder::Database::PrimaryColors&amp; screenColor, const String&amp; printColor)
+{
+    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();
+    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;Database.didExecuteNoOptionalParameters&quot;));
+    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();
+    paramsObject-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), columnNames);
+    paramsObject-&gt;setString(ASCIILiteral(&quot;notes&quot;), notes);
+    paramsObject-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), timestamp);
+    paramsObject-&gt;setObject(ASCIILiteral(&quot;values&quot;), values);
+    paramsObject-&gt;setValue(ASCIILiteral(&quot;payload&quot;), payload);
+    paramsObject-&gt;setObject(ASCIILiteral(&quot;sqlError&quot;), sqlError);
+    paramsObject-&gt;setString(ASCIILiteral(&quot;screenColor&quot;), screenColor);
+    paramsObject-&gt;setString(ASCIILiteral(&quot;printColor&quot;), printColor);
+    jsonMessage-&gt;setObject(ASCIILiteral(&quot;params&quot;), paramsObject);
+
+    m_inspectorFrontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());
+}
+#endif // ENABLE(SQL_DATABASE)
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+class Error;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of forward declarations.
+
+
+// Typedefs.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/* Unique identifier of Database object. */
+typedef String DatabaseId;
+
+typedef String PrimaryColors;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/* Database error. */
+class Error : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        MessageSet = 1 &lt;&lt; 0,
+        CodeSet = 1 &lt;&lt; 1,
+        AllFieldsSet = (MessageSet | CodeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*Error*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class Error;
+    public:
+
+        Builder&lt;STATE | MessageSet&gt;&amp; setMessage(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; MessageSet), property_message_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;message&quot;), value);
+            return castState&lt;MessageSet&gt;();
+        }
+
+        Builder&lt;STATE | CodeSet&gt;&amp; setCode(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; CodeSet), property_code_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;code&quot;), value);
+            return castState&lt;CodeSet&gt;();
+        }
+
+        operator RefPtr&lt;Error&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;Error&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;Error&gt; release()
+        {
+            return RefPtr&lt;Error&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;Error&gt; result = Error::create()
+     *     .setMessage(...)
+     *     .setCode(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonduplicatetypedeclarationsjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-duplicate-type-declarations.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-duplicate-type-declarations.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-duplicate-type-declarations.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Duplicate type declaration: Runtime.RemoteObjectId
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonenumwithnovaluesjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-enum-with-no-values.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-enum-with-no-values.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-enum-with-no-values.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Type reference with enum values must have at least one enum value.
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonstringtypedoptionalparameterflagjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-parameter-flag.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-parameter-flag.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-parameter-flag.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: The 'optional' flag for a parameter must be a boolean literal.
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonstringtypedoptionaltypememberjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-type-member.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-type-member.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-string-typed-optional-type-member.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: The 'optional' flag for a type member must be a boolean literal.
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailontypedeclarationusingtypereferencejsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-declaration-using-type-reference.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-declaration-using-type-reference.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-declaration-using-type-reference.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Type reference cannot have both 'type' and '$ref' keys.
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailontypewithlowercasenamejsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-with-lowercase-name.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-with-lowercase-name.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-type-with-lowercase-name.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Types must begin with an uppercase character.
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonunknowntypereferenceintypedeclarationjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Lookup failed for type reference: dragon (referenced from domain: Runtime)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedfailonunknowntypereferenceintypememberjsonerror"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-member.json-error (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-member.json-error                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-member.json-error        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+ERROR: Lookup failed for type reference: Color (referenced from domain: Fantasy)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedsametypeiddifferentdomainjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,370 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+
+
+// Typedefs.
+namespace Runtime {
+/* Unique object identifier. */
+typedef String RemoteObjectId;
+} // Runtime
+
+namespace Runtime2 {
+/* Unique object identifier. */
+typedef String RemoteObjectId;
+} // Runtime2
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedshadowedoptionaltypesettersjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,446 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+namespace Runtime {
+class KeyPath;
+} // Runtime
+// End of forward declarations.
+
+
+
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+namespace Runtime {
+/* Key path. */
+class KeyPath : public Inspector::InspectorObjectBase {
+public:
+    // Named after property name 'type' while generating KeyPath.
+    enum class Type {
+        Null = 0,
+        String = 1,
+        Array = 2,
+    }; // enum class Type
+    enum {
+        NoFieldsSet = 0,
+        TypeSet = 1 &lt;&lt; 0,
+        AllFieldsSet = (TypeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*KeyPath*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class KeyPath;
+    public:
+
+        Builder&lt;STATE | TypeSet&gt;&amp; setType(Type value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; TypeSet), property_type_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;type&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(static_cast&lt;int&gt;(value)));
+            return castState&lt;TypeSet&gt;();
+        }
+
+        operator RefPtr&lt;KeyPath&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(KeyPath) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;KeyPath&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;KeyPath&gt; release()
+        {
+            return RefPtr&lt;KeyPath&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;KeyPath&gt; result = KeyPath::create()
+     *     .setType(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+
+    void setString(const String&amp; value)
+    {
+        InspectorObjectBase::setString(ASCIILiteral(&quot;string&quot;), value);
+    }
+
+    void setArray(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; value)
+    {
+        InspectorObjectBase::setArray(ASCIILiteral(&quot;array&quot;), value);
+    }
+};
+
+} // Runtime
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;null&quot;,
+    &quot;string&quot;,
+    &quot;array&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationaliasedprimitivetypejsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,365 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+
+
+// Typedefs.
+namespace Runtime {
+/* Unique object identifier. */
+typedef int RemoteObjectId;
+} // Runtime
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationarraytypejsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,388 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Debugger.
+InspectorBackend.registerEnum(&quot;Debugger.Reason&quot;, {Died: &quot;Died&quot;, Fainted: &quot;Fainted&quot;, Hungry: &quot;Hungry&quot;});
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+namespace Debugger {
+enum class Reason;
+} // Debugger
+// End of forward declarations.
+
+
+// Typedefs.
+namespace Debugger {
+typedef int BreakpointId;
+} // Debugger
+
+namespace Runtime {
+typedef int ObjectId;
+} // Runtime
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+namespace Debugger {
+/*  */
+enum class Reason {
+    Died = 0,
+    Fainted = 1,
+    Hungry = 2,
+}; // enum class Reason
+} // Debugger
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;Died&quot;,
+    &quot;Fainted&quot;,
+    &quot;Hungry&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationenumtypejsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,394 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Runtime.
+InspectorBackend.registerEnum(&quot;Runtime.FarmAnimals&quot;, {Pigs: &quot;Pigs&quot;, Cows: &quot;Cows&quot;, Cats: &quot;Cats&quot;, Hens: &quot;Hens&quot;});
+InspectorBackend.registerEnum(&quot;Runtime.TwoLeggedAnimals&quot;, {Ducks: &quot;Ducks&quot;, Hens: &quot;Hens&quot;, Crows: &quot;Crows&quot;, Flamingos: &quot;Flamingos&quot;});
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+namespace Runtime {
+enum class FarmAnimals;
+enum class TwoLeggedAnimals;
+} // Runtime
+// End of forward declarations.
+
+
+
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+namespace Runtime {
+/*  */
+enum class FarmAnimals {
+    Pigs = 0,
+    Cows = 1,
+    Cats = 2,
+    Hens = 3,
+}; // enum class FarmAnimals
+/*  */
+enum class TwoLeggedAnimals {
+    Ducks = 4,
+    Hens = 3,
+    Crows = 5,
+    Flamingos = 6,
+}; // enum class TwoLeggedAnimals
+} // Runtime
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;Pigs&quot;,
+    &quot;Cows&quot;,
+    &quot;Cats&quot;,
+    &quot;Hens&quot;,
+    &quot;Ducks&quot;,
+    &quot;Crows&quot;,
+    &quot;Flamingos&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtypedeclarationobjecttypejsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,900 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Test.
+InspectorBackend.registerCommand(&quot;Test.attemptCurse&quot;, [{&quot;name&quot;: &quot;curse&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: false}], [&quot;censoredCurse&quot;]);
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+class InspectorTestBackendDispatcherHandler {
+public:
+    virtual void attemptCurse(ErrorString*, const RefPtr&lt;Inspector::InspectorObject&gt;&amp; in_curse, Inspector::TypeBuilder::OptOutput&lt;String&gt;* opt_out_censoredCurse) = 0;
+protected:
+    virtual ~InspectorTestBackendDispatcherHandler();
+};
+
+class InspectorTestBackendDispatcher final : public Inspector::InspectorSupplementalBackendDispatcher {
+public:
+    static PassRefPtr&lt;InspectorTestBackendDispatcher&gt; create(Inspector::InspectorBackendDispatcher*, InspectorTestBackendDispatcherHandler*);
+    virtual void dispatch(long callId, const String&amp; method, PassRefPtr&lt;Inspector::InspectorObject&gt; message) override;
+private:
+    void attemptCurse(long callId, const Inspector::InspectorObject&amp; message);
+private:
+    InspectorTestBackendDispatcher(Inspector::InspectorBackendDispatcher*, InspectorTestBackendDispatcherHandler*);
+    InspectorTestBackendDispatcherHandler* m_agent;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+InspectorTestBackendDispatcherHandler::~InspectorTestBackendDispatcherHandler() { }
+
+PassRefPtr&lt;InspectorTestBackendDispatcher&gt; InspectorTestBackendDispatcher::create(InspectorBackendDispatcher* backendDispatcher, InspectorTestBackendDispatcherHandler* agent)
+{
+    return adoptRef(new InspectorTestBackendDispatcher(backendDispatcher, agent));
+}
+
+InspectorTestBackendDispatcher::InspectorTestBackendDispatcher(InspectorBackendDispatcher* backendDispatcher, InspectorTestBackendDispatcherHandler* agent)
+    : InspectorSupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher-&gt;registerDispatcherForDomain(ASCIILiteral(&quot;Test&quot;), this);
+}
+
+void InspectorTestBackendDispatcher::dispatch(long callId, const String&amp; method, PassRefPtr&lt;InspectorObject&gt; message)
+{
+    Ref&lt;InspectorTestBackendDispatcher&gt; protect(*this);
+
+    if (method == &quot;attemptCurse&quot;)
+        attemptCurse(callId, *message.get());
+    else
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::MethodNotFound, String(&quot;'&quot;) + &quot;Test&quot; + '.' + method + &quot;' was not found&quot;);
+}
+
+void InspectorTestBackendDispatcher::attemptCurse(long callId, const InspectorObject&amp; message)
+{
+    RefPtr&lt;InspectorArray&gt; protocolErrors = InspectorArray::create();
+    RefPtr&lt;InspectorObject&gt; paramsContainer = message.getObject(ASCIILiteral(&quot;params&quot;));
+    InspectorObject* paramsContainerPtr = paramsContainer.get();
+    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    RefPtr&lt;Inspector::InspectorObject&gt; in_curse = InspectorBackendDispatcher::getObject(paramsContainerPtr, ASCIILiteral(&quot;curse&quot;), nullptr, protocolErrorsPtr);
+    if (protocolErrors-&gt;length()) {
+        String errorMessage = String::format(&quot;Some arguments of method '%s' can't be processed&quot;, &quot;Test.attemptCurse&quot;);
+        m_backendDispatcher-&gt;reportProtocolError(&amp;callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());
+        return;
+    }
+
+    ErrorString error;
+    RefPtr&lt;InspectorObject&gt; result = InspectorObject::create();
+    Inspector::TypeBuilder::OptOutput&lt;String&gt; out_censoredCurse;
+    m_agent-&gt;attemptCurse(&amp;error, in_curse, &amp;out_censoredCurse);
+
+    if (!error.length())
+        if (out_censoredCurse.isAssigned())
+            result-&gt;setString(ASCIILiteral(&quot;censoredCurse&quot;), out_censoredCurse.getValue());
+
+    m_backendDispatcher-&gt;sendResponse(callId, result.release(), error);
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+class DummyObject;
+class Error;
+class ObjectWithPropertyNameConflicts;
+class OptionalParameterBundle;
+class ParameterBundle;
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+
+namespace Test {
+class HappyName;
+class ParameterBundle;
+} // Test
+// End of forward declarations.
+
+
+
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+#if ENABLE(SQL_DATABASE)
+namespace Database {
+/* Database error. */
+class Error : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        MessageSet = 1 &lt;&lt; 0,
+        CodeSet = 1 &lt;&lt; 1,
+        AllFieldsSet = (MessageSet | CodeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*Error*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class Error;
+    public:
+
+        Builder&lt;STATE | MessageSet&gt;&amp; setMessage(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; MessageSet), property_message_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;message&quot;), value);
+            return castState&lt;MessageSet&gt;();
+        }
+
+        Builder&lt;STATE | CodeSet&gt;&amp; setCode(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; CodeSet), property_code_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;code&quot;), value);
+            return castState&lt;CodeSet&gt;();
+        }
+
+        operator RefPtr&lt;Error&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(Error) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;Error&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;Error&gt; release()
+        {
+            return RefPtr&lt;Error&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;Error&gt; result = Error::create()
+     *     .setMessage(...)
+     *     .setCode(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+class OptionalParameterBundle : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        AllFieldsSet = 0
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*OptionalParameterBundle*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class OptionalParameterBundle;
+    public:
+
+        operator RefPtr&lt;OptionalParameterBundle&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(OptionalParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;OptionalParameterBundle&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;OptionalParameterBundle&gt; release()
+        {
+            return RefPtr&lt;OptionalParameterBundle&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;OptionalParameterBundle&gt; result = OptionalParameterBundle::create();
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+
+    void setColumnNames(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; value)
+    {
+        InspectorObjectBase::setArray(ASCIILiteral(&quot;columnNames&quot;), value);
+    }
+
+    void setNotes(const String&amp; value)
+    {
+        InspectorObjectBase::setString(ASCIILiteral(&quot;notes&quot;), value);
+    }
+
+    void setTimestamp(double value)
+    {
+        InspectorObjectBase::setNumber(ASCIILiteral(&quot;timestamp&quot;), value);
+    }
+
+    void setValues(PassRefPtr&lt;Inspector::InspectorObject&gt; value)
+    {
+        InspectorObjectBase::setObject(ASCIILiteral(&quot;values&quot;), value);
+    }
+
+    void setPayload(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+    {
+        InspectorObjectBase::setValue(ASCIILiteral(&quot;payload&quot;), value);
+    }
+
+    void setError(PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; value)
+    {
+        InspectorObjectBase::setObject(ASCIILiteral(&quot;error&quot;), value);
+    }
+};
+
+class ParameterBundle : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        ColumnNamesSet = 1 &lt;&lt; 0,
+        NotesSet = 1 &lt;&lt; 1,
+        TimestampSet = 1 &lt;&lt; 2,
+        ValuesSet = 1 &lt;&lt; 3,
+        PayloadSet = 1 &lt;&lt; 4,
+        ErrorSet = 1 &lt;&lt; 5,
+        AllFieldsSet = (ColumnNamesSet | NotesSet | TimestampSet | ValuesSet | PayloadSet | ErrorSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*ParameterBundle*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class ParameterBundle;
+    public:
+
+        Builder&lt;STATE | ColumnNamesSet&gt;&amp; setColumnNames(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ColumnNamesSet), property_columnNames_already_set);
+            m_result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), value);
+            return castState&lt;ColumnNamesSet&gt;();
+        }
+
+        Builder&lt;STATE | NotesSet&gt;&amp; setNotes(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; NotesSet), property_notes_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;notes&quot;), value);
+            return castState&lt;NotesSet&gt;();
+        }
+
+        Builder&lt;STATE | TimestampSet&gt;&amp; setTimestamp(double value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; TimestampSet), property_timestamp_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), value);
+            return castState&lt;TimestampSet&gt;();
+        }
+
+        Builder&lt;STATE | ValuesSet&gt;&amp; setValues(PassRefPtr&lt;Inspector::InspectorObject&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ValuesSet), property_values_already_set);
+            m_result-&gt;setObject(ASCIILiteral(&quot;values&quot;), value);
+            return castState&lt;ValuesSet&gt;();
+        }
+
+        Builder&lt;STATE | PayloadSet&gt;&amp; setPayload(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; PayloadSet), property_payload_already_set);
+            m_result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), value);
+            return castState&lt;PayloadSet&gt;();
+        }
+
+        Builder&lt;STATE | ErrorSet&gt;&amp; setError(PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ErrorSet), property_error_already_set);
+            m_result-&gt;setObject(ASCIILiteral(&quot;error&quot;), value);
+            return castState&lt;ErrorSet&gt;();
+        }
+
+        operator RefPtr&lt;ParameterBundle&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;ParameterBundle&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;ParameterBundle&gt; release()
+        {
+            return RefPtr&lt;ParameterBundle&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;ParameterBundle&gt; result = ParameterBundle::create()
+     *     .setColumnNames(...)
+     *     .setNotes(...)
+     *     .setTimestamp(...)
+     *     .setValues(...)
+     *     .setPayload(...)
+     *     .setError(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+/* Conflicted names may cause generated getters/setters to clash with built-in InspectorObject methods. */
+class ObjectWithPropertyNameConflicts : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        IntegerSet = 1 &lt;&lt; 0,
+        ArraySet = 1 &lt;&lt; 1,
+        StringSet = 1 &lt;&lt; 2,
+        ValueSet = 1 &lt;&lt; 3,
+        ObjectSet = 1 &lt;&lt; 4,
+        AllFieldsSet = (IntegerSet | ArraySet | StringSet | ValueSet | ObjectSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*ObjectWithPropertyNameConflicts*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class ObjectWithPropertyNameConflicts;
+    public:
+
+        Builder&lt;STATE | IntegerSet&gt;&amp; setInteger(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; IntegerSet), property_integer_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;integer&quot;), value);
+            return castState&lt;IntegerSet&gt;();
+        }
+
+        Builder&lt;STATE | ArraySet&gt;&amp; setArray(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ArraySet), property_array_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;array&quot;), value);
+            return castState&lt;ArraySet&gt;();
+        }
+
+        Builder&lt;STATE | StringSet&gt;&amp; setString(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; StringSet), property_string_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;string&quot;), value);
+            return castState&lt;StringSet&gt;();
+        }
+
+        Builder&lt;STATE | ValueSet&gt;&amp; setValue(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ValueSet), property_value_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;value&quot;), value);
+            return castState&lt;ValueSet&gt;();
+        }
+
+        Builder&lt;STATE | ObjectSet&gt;&amp; setObject(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ObjectSet), property_object_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;object&quot;), value);
+            return castState&lt;ObjectSet&gt;();
+        }
+
+        operator RefPtr&lt;ObjectWithPropertyNameConflicts&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(ObjectWithPropertyNameConflicts) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;ObjectWithPropertyNameConflicts&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;ObjectWithPropertyNameConflicts&gt; release()
+        {
+            return RefPtr&lt;ObjectWithPropertyNameConflicts&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;ObjectWithPropertyNameConflicts&gt; result = ObjectWithPropertyNameConflicts::create()
+     *     .setInteger(...)
+     *     .setArray(...)
+     *     .setString(...)
+     *     .setValue(...)
+     *     .setObject(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+} // Database
+#endif // ENABLE(SQL_DATABASE)
+
+namespace Test {
+class ParameterBundle : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        ColumnNamesSet = 1 &lt;&lt; 0,
+        NotesSet = 1 &lt;&lt; 1,
+        TimestampSet = 1 &lt;&lt; 2,
+        ValuesSet = 1 &lt;&lt; 3,
+        PayloadSet = 1 &lt;&lt; 4,
+        ErrorSet = 1 &lt;&lt; 5,
+        AllFieldsSet = (ColumnNamesSet | NotesSet | TimestampSet | ValuesSet | PayloadSet | ErrorSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*ParameterBundle*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class ParameterBundle;
+    public:
+
+        Builder&lt;STATE | ColumnNamesSet&gt;&amp; setColumnNames(PassRefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ColumnNamesSet), property_columnNames_already_set);
+            m_result-&gt;setArray(ASCIILiteral(&quot;columnNames&quot;), value);
+            return castState&lt;ColumnNamesSet&gt;();
+        }
+
+        Builder&lt;STATE | NotesSet&gt;&amp; setNotes(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; NotesSet), property_notes_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;notes&quot;), value);
+            return castState&lt;NotesSet&gt;();
+        }
+
+        Builder&lt;STATE | TimestampSet&gt;&amp; setTimestamp(double value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; TimestampSet), property_timestamp_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;timestamp&quot;), value);
+            return castState&lt;TimestampSet&gt;();
+        }
+
+        Builder&lt;STATE | ValuesSet&gt;&amp; setValues(PassRefPtr&lt;Inspector::InspectorObject&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ValuesSet), property_values_already_set);
+            m_result-&gt;setObject(ASCIILiteral(&quot;values&quot;), value);
+            return castState&lt;ValuesSet&gt;();
+        }
+
+        Builder&lt;STATE | PayloadSet&gt;&amp; setPayload(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; PayloadSet), property_payload_already_set);
+            m_result-&gt;setValue(ASCIILiteral(&quot;payload&quot;), value);
+            return castState&lt;PayloadSet&gt;();
+        }
+
+        Builder&lt;STATE | ErrorSet&gt;&amp; setError(PassRefPtr&lt;Inspector::TypeBuilder::Database::Error&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; ErrorSet), property_error_already_set);
+            m_result-&gt;setObject(ASCIILiteral(&quot;error&quot;), value);
+            return castState&lt;ErrorSet&gt;();
+        }
+
+        operator RefPtr&lt;ParameterBundle&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(ParameterBundle) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;ParameterBundle&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;ParameterBundle&gt; release()
+        {
+            return RefPtr&lt;ParameterBundle&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;ParameterBundle&gt; result = ParameterBundle::create()
+     *     .setColumnNames(...)
+     *     .setNotes(...)
+     *     .setTimestamp(...)
+     *     .setValues(...)
+     *     .setPayload(...)
+     *     .setError(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+} // Test
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsexpectedtyperequiringruntimecastsjsonresult"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,727 @@
</span><ins>+### Begin File: InspectorTestBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+// Test.
+InspectorBackend.registerEnum(&quot;Test.UncastedAnimals&quot;, {Pigs: &quot;Pigs&quot;, Cows: &quot;Cows&quot;, Cats: &quot;Cats&quot;, Hens: &quot;Hens&quot;});
+InspectorBackend.registerEnum(&quot;Test.CastedAnimals&quot;, {Ducks: &quot;Ducks&quot;, Hens: &quot;Hens&quot;, Crows: &quot;Crows&quot;, Flamingos: &quot;Flamingos&quot;});
+### End File: InspectorTestBackendCommands.js
+
+### Begin File: InspectorTestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestBackendDispatchers_h
+#define InspectorTestBackendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorBackendDispatcher.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestBackendDispatchers_h)
+### End File: InspectorTestBackendDispatchers.h
+
+### Begin File: InspectorTestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestBackendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestBackendDispatchers.cpp
+
+### Begin File: InspectorTestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestFrontendDispatchers_h
+#define InspectorTestFrontendDispatchers_h
+
+#if ENABLE(INSPECTOR)
+
+#include &quot;InspectorTestTypeBuilders.h&quot;
+#include &lt;inspector/InspectorFrontendChannel.h&gt;
+#include &lt;inspector/InspectorValues.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace Inspector {
+
+
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestFrontendDispatchers_h)
+### End File: InspectorTestFrontendDispatchers.h
+
+### Begin File: InspectorTestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestFrontendDispatchers.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestFrontendDispatchers.cpp
+
+### Begin File: InspectorTestTypeBuilders.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#ifndef InspectorTestTypeBuilders_h
+#define InspectorTestTypeBuilders_h
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;inspector/InspectorJSTypeBuilders.h&gt;
+#include &lt;inspector/InspectorTypeBuilder.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace Inspector {
+
+
+
+namespace TypeBuilder {
+
+// Forward declarations.
+namespace Test {
+class RecursiveObject1;
+class RecursiveObject2;
+class TypeNeedingCast;
+enum class CastedAnimals;
+enum class UncastedAnimals;
+} // Test
+// End of forward declarations.
+
+
+// Typedefs.
+namespace Test {
+typedef int CastedObjectId;
+
+typedef int UncastedObjectId;
+} // Test
+// End of typedefs.
+
+String getTestEnumConstantValue(int code);
+
+template&lt;typename T&gt; String getTestEnumConstantValue(T enumValue)
+{
+    return getTestEnumConstantValue(static_cast&lt;int&gt;(enumValue));
+}
+
+namespace Test {
+/* A dummy type that requires runtime casts, and forces non-primitive referenced types to also emit runtime cast helpers. */
+class TypeNeedingCast : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        StringSet = 1 &lt;&lt; 0,
+        NumberSet = 1 &lt;&lt; 1,
+        AnimalsSet = 1 &lt;&lt; 2,
+        IdSet = 1 &lt;&lt; 3,
+        TreeSet = 1 &lt;&lt; 4,
+        AllFieldsSet = (StringSet | NumberSet | AnimalsSet | IdSet | TreeSet)
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*TypeNeedingCast*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class TypeNeedingCast;
+    public:
+
+        Builder&lt;STATE | StringSet&gt;&amp; setString(const String&amp; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; StringSet), property_string_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;string&quot;), value);
+            return castState&lt;StringSet&gt;();
+        }
+
+        Builder&lt;STATE | NumberSet&gt;&amp; setNumber(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; NumberSet), property_number_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;number&quot;), value);
+            return castState&lt;NumberSet&gt;();
+        }
+
+        Builder&lt;STATE | AnimalsSet&gt;&amp; setAnimals(Inspector::TypeBuilder::Test::CastedAnimals value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; AnimalsSet), property_animals_already_set);
+            m_result-&gt;setString(ASCIILiteral(&quot;animals&quot;), Inspector::TypeBuilder::getTestEnumConstantValue(static_cast&lt;int&gt;(value)));
+            return castState&lt;AnimalsSet&gt;();
+        }
+
+        Builder&lt;STATE | IdSet&gt;&amp; setId(int value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; IdSet), property_id_already_set);
+            m_result-&gt;setNumber(ASCIILiteral(&quot;id&quot;), value);
+            return castState&lt;IdSet&gt;();
+        }
+
+        Builder&lt;STATE | TreeSet&gt;&amp; setTree(PassRefPtr&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt; value)
+        {
+            COMPILE_ASSERT(!(STATE &amp; TreeSet), property_tree_already_set);
+            m_result-&gt;setObject(ASCIILiteral(&quot;tree&quot;), value);
+            return castState&lt;TreeSet&gt;();
+        }
+
+        operator RefPtr&lt;TypeNeedingCast&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(TypeNeedingCast) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;TypeNeedingCast&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;TypeNeedingCast&gt; release()
+        {
+            return RefPtr&lt;TypeNeedingCast&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;TypeNeedingCast&gt; result = TypeNeedingCast::create()
+     *     .setString(...)
+     *     .setNumber(...)
+     *     .setAnimals(...)
+     *     .setId(...)
+     *     .setTree(...);
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+};
+
+/*  */
+enum class UncastedAnimals {
+    Pigs = 4,
+    Cows = 5,
+    Cats = 6,
+    Hens = 1,
+}; // enum class UncastedAnimals
+/*  */
+enum class CastedAnimals {
+    Ducks = 0,
+    Hens = 1,
+    Crows = 2,
+    Flamingos = 3,
+}; // enum class CastedAnimals
+class RecursiveObject1 : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        AllFieldsSet = 0
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*RecursiveObject1*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class RecursiveObject1;
+    public:
+
+        operator RefPtr&lt;RecursiveObject1&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(RecursiveObject1) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;RecursiveObject1&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;RecursiveObject1&gt; release()
+        {
+            return RefPtr&lt;RecursiveObject1&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;RecursiveObject1&gt; result = RecursiveObject1::create();
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+
+    void setObj(PassRefPtr&lt;Inspector::TypeBuilder::Test::RecursiveObject2&gt; value)
+    {
+        InspectorObjectBase::setObject(ASCIILiteral(&quot;obj&quot;), value);
+    }
+};
+
+class RecursiveObject2 : public Inspector::InspectorObjectBase {
+public:
+    enum {
+        NoFieldsSet = 0,
+        AllFieldsSet = 0
+    };
+
+    template&lt;int STATE&gt;
+    class Builder {
+    private:
+        RefPtr&lt;Inspector::InspectorObject&gt; m_result;
+
+        template&lt;int STEP&gt; Builder&lt;STATE | STEP&gt;&amp; castState()
+        {
+            return *reinterpret_cast&lt;Builder&lt;STATE | STEP&gt;*&gt;(this);
+        }
+
+        Builder(PassRefPtr&lt;/*RecursiveObject2*/Inspector::InspectorObject&gt; ptr)
+        {
+            COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
+            m_result = ptr;
+        }
+        friend class RecursiveObject2;
+    public:
+
+        operator RefPtr&lt;RecursiveObject2&gt;&amp; ()
+        {
+            COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
+            COMPILE_ASSERT(sizeof(RecursiveObject2) == sizeof(Inspector::InspectorObject), cannot_cast);
+            return *reinterpret_cast&lt;RefPtr&lt;RecursiveObject2&gt;*&gt;(&amp;m_result);
+        }
+
+        PassRefPtr&lt;RecursiveObject2&gt; release()
+        {
+            return RefPtr&lt;RecursiveObject2&gt;(*this).release();
+        }
+    };
+
+    /*
+     * Synthetic constructor:
+     * RefPtr&lt;RecursiveObject2&gt; result = RecursiveObject2::create();
+     */
+    static Builder&lt;NoFieldsSet&gt; create()
+    {
+        return Builder&lt;NoFieldsSet&gt;(Inspector::InspectorObject::create());
+    }
+    typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;
+
+    void setObj(PassRefPtr&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt; value)
+    {
+        InspectorObjectBase::setObject(ASCIILiteral(&quot;obj&quot;), value);
+    }
+};
+
+} // Test
+
+template&lt;&gt; struct BindingTraits&lt;Inspector::TypeBuilder::Test::CastedAnimals&gt; {
+#if !ASSERT_DISABLED
+static void assertValueHasExpectedType(Inspector::InspectorValue*);
+#endif // !ASSERT_DISABLED
+};
+template&lt;&gt; struct BindingTraits&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt; {
+static PassRefPtr&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt; runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value);
+#if !ASSERT_DISABLED
+static void assertValueHasExpectedType(Inspector::InspectorValue*);
+#endif // !ASSERT_DISABLED
+};
+template&lt;&gt; struct BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt; {
+#if !ASSERT_DISABLED
+static void assertValueHasExpectedType(Inspector::InspectorValue*);
+#endif // !ASSERT_DISABLED
+};
+template&lt;&gt; struct BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject2&gt; {
+#if !ASSERT_DISABLED
+static void assertValueHasExpectedType(Inspector::InspectorValue*);
+#endif // !ASSERT_DISABLED
+};
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InspectorTestTypeBuilders_h)
+### End File: InspectorTestTypeBuilders.h
+
+### Begin File: InspectorTestTypeBuilders.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/codegen/generate-inspector-protocol-bindings.py
+
+#include &quot;config.h&quot;
+#include &quot;InspectorTestTypeBuilders.h&quot;
+
+#if ENABLE(INSPECTOR)
+
+#include &lt;wtf/text/CString.h&gt;
+
+namespace Inspector {
+
+namespace TypeBuilder {
+
+static const char* const enum_constant_values[] = {
+    &quot;Ducks&quot;,
+    &quot;Hens&quot;,
+    &quot;Crows&quot;,
+    &quot;Flamingos&quot;,
+    &quot;Pigs&quot;,
+    &quot;Cows&quot;,
+    &quot;Cats&quot;,
+};
+
+String getTestEnumConstantValue(int code) {
+    return enum_constant_values[code];
+}
+
+
+
+#if !ASSERT_DISABLED
+void BindingTraits&lt;Inspector::TypeBuilder::Test::CastedAnimals&gt;::assertValueHasExpectedType(Inspector::InspectorValue* value)
+{
+    String s;
+    bool cast_res = value-&gt;asString(&amp;s);
+    ASSERT(cast_res);
+    ASSERT(s == &quot;Ducks&quot; || s == &quot;Hens&quot; || s == &quot;Crows&quot; || s == &quot;Flamingos&quot;);
+}
+#endif // !ASSERT_DISABLED
+
+#if !ASSERT_DISABLED
+void BindingTraits&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt;::assertValueHasExpectedType(Inspector::InspectorValue* value)
+{
+    RefPtr&lt;InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);
+    {
+        InspectorObject::iterator stringPos = object-&gt;find(ASCIILiteral(&quot;string&quot;));
+        ASSERT(stringPos != object-&gt;end());
+        BindingTraits&lt;String&gt;::assertValueHasExpectedType(stringPos-&gt;value.get());
+    }
+    {
+        InspectorObject::iterator numberPos = object-&gt;find(ASCIILiteral(&quot;number&quot;));
+        ASSERT(numberPos != object-&gt;end());
+        BindingTraits&lt;int&gt;::assertValueHasExpectedType(numberPos-&gt;value.get());
+    }
+    {
+        InspectorObject::iterator animalsPos = object-&gt;find(ASCIILiteral(&quot;animals&quot;));
+        ASSERT(animalsPos != object-&gt;end());
+        BindingTraits&lt;Inspector::TypeBuilder::Test::CastedAnimals&gt;::assertValueHasExpectedType(animalsPos-&gt;value.get());
+    }
+    {
+        InspectorObject::iterator idPos = object-&gt;find(ASCIILiteral(&quot;id&quot;));
+        ASSERT(idPos != object-&gt;end());
+        BindingTraits&lt;int&gt;::assertValueHasExpectedType(idPos-&gt;value.get());
+    }
+    {
+        InspectorObject::iterator treePos = object-&gt;find(ASCIILiteral(&quot;tree&quot;));
+        ASSERT(treePos != object-&gt;end());
+        BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt;::assertValueHasExpectedType(treePos-&gt;value.get());
+    }
+
+    int foundPropertiesCount = 5;
+    if (foundPropertiesCount != object-&gt;size())
+        FATAL(&quot;Unexpected properties in object: %s\n&quot;, object-&gt;toJSONString().ascii().data());
+}
+#endif // !ASSERT_DISABLED
+
+PassRefPtr&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt; BindingTraits&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt;::runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+{
+    RefPtr&lt;Inspector::InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);
+#if !ASSERT_DISABLED
+    BindingTraits&lt;Inspector::TypeBuilder::Test::TypeNeedingCast&gt;::assertValueHasExpectedType(object.get());
+#endif  // !ASSERT_DISABLED
+    COMPILE_ASSERT(sizeof(Inspector::TypeBuilder::Test::TypeNeedingCast) == sizeof(Inspector::InspectorObjectBase), type_cast_problem);
+    return static_cast&lt;Inspector::TypeBuilder::Test::TypeNeedingCast*&gt;(static_cast&lt;Inspector::InspectorObjectBase*&gt;(object.get()));
+}
+
+
+#if !ASSERT_DISABLED
+void BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt;::assertValueHasExpectedType(Inspector::InspectorValue* value)
+{
+    RefPtr&lt;InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);
+
+    int foundPropertiesCount = 0;
+    {
+        InspectorObject::iterator objPos = object-&gt;find(ASCIILiteral(&quot;obj&quot;));
+        if (objPos != object-&gt;end()) {
+            BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject2&gt;::assertValueHasExpectedType(objPos-&gt;value.get());
+            ++foundPropertiesCount;
+        }
+    }
+    if (foundPropertiesCount != object-&gt;size())
+        FATAL(&quot;Unexpected properties in object: %s\n&quot;, object-&gt;toJSONString().ascii().data());
+}
+#endif // !ASSERT_DISABLED
+
+#if !ASSERT_DISABLED
+void BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject2&gt;::assertValueHasExpectedType(Inspector::InspectorValue* value)
+{
+    RefPtr&lt;InspectorObject&gt; object;
+    bool castRes = value-&gt;asObject(&amp;object);
+    ASSERT_UNUSED(castRes, castRes);
+
+    int foundPropertiesCount = 0;
+    {
+        InspectorObject::iterator objPos = object-&gt;find(ASCIILiteral(&quot;obj&quot;));
+        if (objPos != object-&gt;end()) {
+            BindingTraits&lt;Inspector::TypeBuilder::Test::RecursiveObject1&gt;::assertValueHasExpectedType(objPos-&gt;value.get());
+            ++foundPropertiesCount;
+        }
+    }
+    if (foundPropertiesCount != object-&gt;size())
+        FATAL(&quot;Unexpected properties in object: %s\n&quot;, object-&gt;toJSONString().ascii().data());
+}
+#endif // !ASSERT_DISABLED
+
+} // namespace TypeBuilder
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+### End File: InspectorTestTypeBuilders.cpp
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonduplicatetypedeclarationsjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-duplicate-type-declarations.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-duplicate-type-declarations.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-duplicate-type-declarations.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        },
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonenumwithnovaluesjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-enum-with-no-values.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-enum-with-no-values.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-enum-with-no-values.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;PrimaryColors&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: []
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonstringtypedoptionalparameterflagjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-parameter-flag.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-parameter-flag.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-parameter-flag.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;DatabaseId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique identifier of Database object.&quot;
+        }
+    ],
+    &quot;events&quot;: [
+        {
+            &quot;name&quot;: &quot;didExecuteOptionalParameters&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: &quot;true&quot; }
+            ]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonstringtypedoptionaltypememberjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-type-member.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-type-member.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-string-typed-optional-type-member.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;Error&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Database error.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;message&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Error message.&quot; },
+                { &quot;name&quot;: &quot;code&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Error code.&quot;, &quot;optional&quot;: &quot;false&quot; }
+            ]
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailontypedeclarationusingtypereferencejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;$ref&quot;: &quot;SomeType&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailontypewithlowercasenamejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-with-lowercase-name.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-with-lowercase-name.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-type-with-lowercase-name.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;databaseId&quot;,
+            &quot;type&quot;: &quot;integer&quot;,
+            &quot;description&quot;: &quot;Unique identifier of Database object.&quot;
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonunknowntypereferenceintypedeclarationjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;dragon&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsfailonunknowntypereferenceintypememberjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Fantasy&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;DragonEgg&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;A dragon egg.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;color&quot;, &quot;$ref&quot;: &quot;Color&quot; }
+            ]
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestssametypeiddifferentdomainjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/same-type-id-different-domain.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/same-type-id-different-domain.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/same-type-id-different-domain.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+},
+{
+    &quot;domain&quot;: &quot;Runtime2&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptstestsshadowedoptionaltypesettersjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/shadowed-optional-type-setters.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/shadowed-optional-type-setters.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/shadowed-optional-type-setters.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;KeyPath&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Key path.&quot;,
+            &quot;properties&quot;: [
+                {
+                    &quot;name&quot;: &quot;type&quot;,
+                    &quot;type&quot;: &quot;string&quot;,
+                    &quot;enum&quot;: [&quot;null&quot;, &quot;string&quot;, &quot;array&quot;],
+                    &quot;description&quot;: &quot;Key path type.&quot;
+                },
+                {
+                    &quot;name&quot;: &quot;string&quot;,
+                    &quot;type&quot;: &quot;string&quot;,
+                    &quot;optional&quot;: true,
+                    &quot;description&quot;: &quot;String value.&quot;
+                },
+                {
+                    &quot;name&quot;: &quot;array&quot;,
+                    &quot;type&quot;: &quot;array&quot;,
+                    &quot;optional&quot;: true,
+                    &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; },
+                    &quot;description&quot;: &quot;Array value.&quot;
+                }
+            ]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationaliasedprimitivetypejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-aliased-primitive-type.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-aliased-primitive-type.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-aliased-primitive-type.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;RemoteObjectId&quot;,
+            &quot;type&quot;: &quot;integer&quot;,
+            &quot;description&quot;: &quot;Unique object identifier.&quot;
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationarraytypejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-array-type.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-array-type.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-array-type.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Debugger&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;BreakpointId&quot;,
+            &quot;type&quot;: &quot;integer&quot;
+        },
+        {
+            &quot;id&quot;: &quot;Reason&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;Died&quot;, &quot;Fainted&quot;, &quot;Hungry&quot;]
+        }
+    ]
+},
+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;ObjectId&quot;,
+            &quot;type&quot;: &quot;integer&quot;
+        },
+        {
+            &quot;id&quot;: &quot;LuckyNumbers&quot;,
+            &quot;type&quot;: &quot;array&quot;,
+            &quot;items&quot;: { &quot;type&quot;: &quot;integer&quot; }
+        },
+        {
+            &quot;id&quot;: &quot;BabyNames&quot;,
+            &quot;type&quot;: &quot;array&quot;,
+            &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; }
+        },
+        {
+            &quot;id&quot;: &quot;NewObjects&quot;,
+            &quot;type&quot;: &quot;array&quot;,
+            &quot;items&quot;: { &quot;$ref&quot;: &quot;ObjectId&quot; }
+        },
+        {
+            &quot;id&quot;: &quot;OldObjects&quot;,
+            &quot;type&quot;: &quot;array&quot;,
+            &quot;items&quot;: { &quot;$ref&quot;: &quot;Debugger.BreakpointId&quot; }
+        },
+        {
+            &quot;id&quot;: &quot;StopReasons&quot;,
+            &quot;type&quot;: &quot;array&quot;,
+            &quot;items&quot;: { &quot;$ref&quot;: &quot;Debugger.Reason&quot; }
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationenumtypejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-enum-type.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-enum-type.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-enum-type.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+{
+    &quot;domain&quot;: &quot;Runtime&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;FarmAnimals&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;Pigs&quot;, &quot;Cows&quot;, &quot;Cats&quot;, &quot;Hens&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;TwoLeggedAnimals&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;Ducks&quot;, &quot;Hens&quot;, &quot;Crows&quot;, &quot;Flamingos&quot;]
+        }
+    ]
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsteststypedeclarationobjecttypejson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Database&quot;,
+    &quot;description&quot;: &quot;Test type builder generation of various object types.&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;Error&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Database error.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;message&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Error message.&quot; },
+                { &quot;name&quot;: &quot;code&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Error code.&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;OptionalParameterBundle&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true },
+                { &quot;name&quot;: &quot;error&quot;, &quot;$ref&quot;: &quot;Error&quot;, &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;ParameterBundle&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;error&quot;, &quot;$ref&quot;: &quot;Error&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;ObjectWithPropertyNameConflicts&quot;,
+            &quot;description&quot;: &quot;Conflicted names may cause generated getters/setters to clash with built-in InspectorObject methods.&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;integer&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;array&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;string&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;value&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;object&quot;, &quot;type&quot;: &quot;string&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;DummyObject&quot;,
+            &quot;description&quot;: &quot;An open object that doesn't have any predefined fields.&quot;,
+            &quot;type&quot;: &quot;object&quot;
+        }
+    ]
+},
+{
+    &quot;domain&quot;: &quot;Test&quot;,
+    &quot;description&quot;: &quot;Test the generation of special behaviors that only apply to specific classes.&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;UnpleasantName&quot;,
+            &quot;description&quot;: &quot;This type should be renamed to HappyName&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;members&quot;: [
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;ParameterBundle&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;columnNames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;type&quot;: &quot;string&quot; } },
+                { &quot;name&quot;: &quot;notes&quot;, &quot;type&quot;: &quot;string&quot; },
+                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot; },
+                { &quot;name&quot;: &quot;values&quot;, &quot;type&quot;: &quot;object&quot; },
+                { &quot;name&quot;: &quot;payload&quot;, &quot;type&quot;: &quot;any&quot; },
+                { &quot;name&quot;: &quot;error&quot;, &quot;$ref&quot;: &quot;Database.Error&quot; }
+            ]
+        }
+    ],
+    &quot;commands&quot;: [
+        {
+            &quot;name&quot;: &quot;attemptCurse&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;curse&quot;, &quot;$ref&quot;: &quot;UnpleasantName&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;censoredCurse&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true }
+            ]
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsteststyperequiringruntimecastsjson"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/tests/type-requiring-runtime-casts.json (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/tests/type-requiring-runtime-casts.json                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/tests/type-requiring-runtime-casts.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+[
+{
+    &quot;domain&quot;: &quot;Test&quot;,
+    &quot;types&quot;: [
+        {
+            &quot;id&quot;: &quot;TypeNeedingCast&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;A dummy type that requires runtime casts, and forces non-primitive referenced types to also emit runtime cast helpers.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;string&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;String member.&quot; },
+                { &quot;name&quot;: &quot;number&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Number member.&quot; },
+                { &quot;name&quot;: &quot;animals&quot;, &quot;$ref&quot;: &quot;CastedAnimals&quot;, &quot;description&quot;: &quot;Enum member.&quot; },
+                { &quot;name&quot;: &quot;id&quot;, &quot;$ref&quot;: &quot;CastedObjectId&quot;, &quot;description&quot;: &quot;Aliased member.&quot; },
+                { &quot;name&quot;: &quot;tree&quot;, &quot;$ref&quot;: &quot;RecursiveObject1&quot;, &quot;description&quot;: &quot;Recursive object member.&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;CastedObjectId&quot;,
+            &quot;type&quot;: &quot;integer&quot;
+        },
+        {
+            &quot;id&quot;: &quot;UncastedObjectId&quot;,
+            &quot;type&quot;: &quot;integer&quot;
+        },
+        {
+            &quot;id&quot;: &quot;UncastedAnimals&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;Pigs&quot;, &quot;Cows&quot;, &quot;Cats&quot;, &quot;Hens&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;CastedAnimals&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;Ducks&quot;, &quot;Hens&quot;, &quot;Crows&quot;, &quot;Flamingos&quot;]
+        },
+        {
+            &quot;id&quot;: &quot;RecursiveObject1&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;obj&quot;, &quot;$ref&quot;: &quot;RecursiveObject2&quot;, &quot;optional&quot;: true }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;RecursiveObject2&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;obj&quot;, &quot;$ref&quot;: &quot;RecursiveObject1&quot;, &quot;optional&quot;: true }
+            ]
+        }
+    ]
+}
+]
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -787,6 +787,21 @@
</span><span class="cx"> 
</span><span class="cx"> set(WebCore_INSPECTOR_SCRIPTS_DIR &quot;${JAVASCRIPTCORE_DIR}/inspector/scripts&quot;)
</span><span class="cx"> 
</span><ins>+set(WebCore_INSPECTOR_PROTOCOL_SCRIPTS
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_commands.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_dispatcher_header.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_backend_dispatcher_implementation.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_frontend_dispatcher_header.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_frontend_dispatcher_implementation.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_type_builder_header.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_type_builder_implementation.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
+    ${WebCore_INSPECTOR_SCRIPTS_DIR}/codegen/models.py
+)
+
</ins><span class="cx"> set(WebCore_INSPECTOR_DOMAINS
</span><span class="cx">     ${WEBCORE_DIR}/inspector/protocol/ApplicationCache.json
</span><span class="cx">     ${WEBCORE_DIR}/inspector/protocol/CSS.json
</span><span class="lines">@@ -3264,7 +3279,7 @@
</span><span class="cx">     COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${WebCore_INSPECTOR_DOMAINS} &gt; ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json
</span><span class="cx">     VERBATIM)
</span><span class="cx"> 
</span><del>-# All Web Inspector generated files are created with this one call to CodeGeneratorInspector.pm
</del><ins>+# All Web Inspector generated files are created with this one call to generate-inspector-protocol-bindings.py
</ins><span class="cx"> add_custom_command(
</span><span class="cx">     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendDispatchers.cpp
</span><span class="cx">            ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendDispatchers.h
</span><span class="lines">@@ -3274,11 +3289,9 @@
</span><span class="cx">            ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.h
</span><span class="cx">            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorWebBackendCommands.js
</span><span class="cx">     MAIN_DEPENDENCY ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json
</span><del>-    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py
-            ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py
</del><ins>+    DEPENDS ${WebCore_INSPECTOR_PROTOCOL_SCRIPTS}
</ins><span class="cx">             ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
</span><del>-            ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
-    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir &quot;${DERIVED_SOURCES_WEBCORE_DIR}&quot; --output_cpp_dir &quot;${DERIVED_SOURCES_WEBCORE_DIR}&quot; --output_js_dir &quot;${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol&quot; --output_type Web --write_always
</del><ins>+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py --outputDir &quot;${DERIVED_SOURCES_WEBCORE_DIR}&quot; --framework WebCore ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json &amp;&amp; cp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendCommands.js ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol
</ins><span class="cx">     VERBATIM)
</span><span class="cx"> 
</span><span class="cx"> list(APPEND WebCore_SOURCES
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,3 +1,88 @@
</span><ins>+2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
+        https://bugs.webkit.org/show_bug.cgi?id=131596
+
+        Reviewed by Joseph Pecoraro.
+
+        Aside from hooking up the new inspector bindings generator to the build system,
+        there are a few comingled changes that would be painful to split from the main
+        patch. Together, these changes make it possible to forward-declare all protocol
+        enumerations as scoped enums, reducing weird ordering dependencies between domains.
+
+        All runtimeCast() methods are now static methods of BindingTraits specializations,
+        rather than as static methods of the type builder classes.
+
+        All protocol enumeration types are scoped enums rather than struct-namespaced enums.
+
+        Remove some implicit protocol type and enumeration definitions because they trigger
+        compiler bugs or introduce unnecessary complexity in the bindings generator.
+
+        No new tests, no behavior changed.
+
+        * CMakeLists.txt:
+        * DerivedSources.make: Update script dependencies and the bindings generator script name.
+
+        * inspector/CommandLineAPIHost.cpp:
+        (WebCore::CommandLineAPIHost::inspectImpl): Convert to BindingTraits.
+
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::detectOrigin):
+        (WebCore::InspectorCSSAgent::buildArrayForRegions):
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::resourceTypeJson):
+        (WebCore::InspectorPageAgent::cachedResourceTypeJson):
+        (WebCore::InspectorPageAgent::getScriptExecutionStatus): Convert to scoped enums.
+
+        (WebCore::InspectorPageAgent::buildObjectForFrameTree): Extract FrameResourceTree::Resources
+        into its own explicitly-defined object type. The new generator does not support implicitly
+        defining object types as elements of arrays.
+        * inspector/InspectorPageAgent.h:
+        * inspector/InspectorReplayAgent.cpp: Disambiguate between internal and protocol types.
+        (WebCore::buildInspectorObjectForSessionState):
+        (WebCore::buildInspectorObjectForSegmentState):
+        (WebCore::InspectorReplayAgent::sessionState):
+        (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
+        (WebCore::InspectorReplayAgent::frameNavigated):
+        (WebCore::InspectorReplayAgent::frameDetached):
+        (WebCore::InspectorReplayAgent::willDispatchEvent):
+        (WebCore::InspectorReplayAgent::startCapturing):
+        (WebCore::InspectorReplayAgent::stopCapturing):
+        (WebCore::InspectorReplayAgent::replayToPosition):
+        (WebCore::InspectorReplayAgent::replayToCompletion):
+        (WebCore::InspectorReplayAgent::pausePlayback):
+        (WebCore::InspectorReplayAgent::cancelPlayback):
+        (WebCore::InspectorReplayAgent::switchSession):
+        (WebCore::InspectorReplayAgent::insertSessionSegment):
+        (WebCore::InspectorReplayAgent::removeSessionSegment):
+        (WebCore::InspectorReplayAgent::currentReplayState):
+        (WebCore::InspectorReplayAgent::getAvailableSessions):
+        (WebCore::InspectorReplayAgent::getSessionData):
+        (WebCore::InspectorReplayAgent::getSegmentData):
+        * inspector/InspectorReplayAgent.h:
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::willSendRequest):
+        * inspector/InspectorStyleSheet.cpp: Convert to scoped enums. Extract CSSProperty::Status
+        because scoped enums defined in a class scope trigger compiler bugs in GCC 4.8.
+        (WebCore::buildMediaObject):
+        (WebCore::InspectorStyle::styleWithProperties): Work around compiler disagreements.
+        (WebCore::InspectorStyleSheet::create):
+        (WebCore::InspectorStyleSheet::InspectorStyleSheet):
+        (WebCore::InspectorStyleSheetForInlineStyle::create):
+        (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
+        * inspector/InspectorStyleSheet.h:
+
+        * inspector/InspectorTimelineAgent.cpp: Convert to scoped enums and BindingTraits.
+        (WebCore::toProtocol):
+        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
+        (WebCore::InspectorTimelineAgent::sendEvent):
+
+        * inspector/protocol/CSS.json: Extract CSSProperty::Status.
+        * inspector/protocol/Page.json: Extract FrameResourceTree::Resources.
+
</ins><span class="cx"> 2014-08-15  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EME][Mac] Adopt AVStreamSession.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/DerivedSources.make        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1151,8 +1151,18 @@
</span><span class="cx"> endif
</span><span class="cx"> 
</span><span class="cx"> INSPECTOR_GENERATOR_SCRIPTS = \
</span><del>-        $(InspectorScripts)/CodeGeneratorInspector.py \
-        $(InspectorScripts)/CodeGeneratorInspectorStrings.py \
</del><ins>+    $(InspectorScripts)/generate_backend_commands.py \
+    $(InspectorScripts)/generate_backend_dispatcher_header.py \
+    $(InspectorScripts)/generate_backend_dispatcher_implementation.py \
+    $(InspectorScripts)/generate_frontend_dispatcher_header.py \
+    $(InspectorScripts)/generate_frontend_dispatcher_implementation.py \
+    $(InspectorScripts)/generate_type_builder_header.py \
+    $(InspectorScripts)/generate_type_builder_implementation.py \
+    $(InspectorScripts)/generator_templates.py \
+    $(InspectorScripts)/generator.py \
+    $(InspectorScripts)/generate-combined-inspector-json.py \
+    $(InspectorScripts)/generate-inspector-protocol-bindings.py \
+    $(InspectorScripts)/models.py \
</ins><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> all : InspectorWeb.json
</span><span class="lines">@@ -1170,7 +1180,7 @@
</span><span class="cx"> all : InspectorWebFrontendDispatchers.h
</span><span class="cx"> 
</span><span class="cx"> InspectorWebFrontendDispatchers.h : InspectorWeb.json $(InspectorScripts)/InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS)
</span><del>-        $(PYTHON) $(InspectorScripts)/CodeGeneratorInspector.py ./InspectorWeb.json $(InspectorScripts)/InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type Web
</del><ins>+        $(PYTHON) $(InspectorScripts)/generate-inspector-protocol-bindings.py --framework WebCore --outputDir . ./InspectorWeb.json $(InspectorScripts)/InspectorJS.json
</ins><span class="cx"> 
</span><span class="cx"> all : InspectorOverlayPage.h
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorCommandLineAPIHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/CommandLineAPIHost.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> void CommandLineAPIHost::inspectImpl(PassRefPtr&lt;InspectorValue&gt; object, PassRefPtr&lt;InspectorValue&gt; hints)
</span><span class="cx"> {
</span><span class="cx">     if (m_inspectorAgent) {
</span><del>-        RefPtr&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt; remoteObject = Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(object);
</del><ins>+        RefPtr&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt; remoteObject = BindingTraits&lt;Inspector::TypeBuilder::Runtime::RemoteObject&gt;::runtimeCast(object);
</ins><span class="cx">         m_inspectorAgent-&gt;inspect(remoteObject, hints-&gt;asObject());
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1000,9 +1000,9 @@
</span><span class="cx">     return it-&gt;value.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum InspectorCSSAgent::detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument)
</del><ins>+Inspector::TypeBuilder::CSS::StyleSheetOrigin InspectorCSSAgent::detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument)
</ins><span class="cx"> {
</span><del>-    Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum origin = Inspector::TypeBuilder::CSS::StyleSheetOrigin::Regular;
</del><ins>+    Inspector::TypeBuilder::CSS::StyleSheetOrigin origin = Inspector::TypeBuilder::CSS::StyleSheetOrigin::Regular;
</ins><span class="cx">     if (pageStyleSheet &amp;&amp; !pageStyleSheet-&gt;ownerNode() &amp;&amp; pageStyleSheet-&gt;href().isEmpty())
</span><span class="cx">         origin = Inspector::TypeBuilder::CSS::StyleSheetOrigin::UserAgent;
</span><span class="cx">     else if (pageStyleSheet &amp;&amp; pageStyleSheet-&gt;ownerNode() &amp;&amp; pageStyleSheet-&gt;ownerNode()-&gt;nodeName() == &quot;#document&quot;)
</span><span class="lines">@@ -1106,7 +1106,7 @@
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::CSS::Region&gt;&gt; regions = Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::CSS::Region&gt;::create();
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; regionList-&gt;length(); ++i) {
</span><del>-        Inspector::TypeBuilder::CSS::Region::RegionOverset::Enum regionOverset;
</del><ins>+        Inspector::TypeBuilder::CSS::Region::RegionOverset regionOverset;
</ins><span class="cx"> 
</span><span class="cx">         switch (toElement(regionList-&gt;item(i))-&gt;regionOversetState()) {
</span><span class="cx">         case RegionFit:
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*);
</span><span class="cx">     InspectorStyleSheet* viaInspectorStyleSheet(Document*, bool createIfAbsent);
</span><span class="cx">     InspectorStyleSheet* assertStyleSheetForId(ErrorString*, const String&amp;);
</span><del>-    Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
</del><ins>+    Inspector::TypeBuilder::CSS::StyleSheetOrigin detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
</ins><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;Inspector::TypeBuilder::CSS::CSSRule&gt; buildObjectForRule(StyleRule*, StyleResolver&amp;);
</span><span class="cx">     PassRefPtr&lt;Inspector::TypeBuilder::CSS::CSSRule&gt; buildObjectForRule(CSSStyleRule*);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1445,7 +1445,7 @@
</span><span class="cx"> 
</span><span class="cx">     Node* activeDescendantNode = nullptr;
</span><span class="cx">     bool busy = false;
</span><del>-    TypeBuilder::DOM::AccessibilityProperties::Checked::Enum checked = TypeBuilder::DOM::AccessibilityProperties::Checked::False;
</del><ins>+    TypeBuilder::DOM::AccessibilityProperties::Checked checked = TypeBuilder::DOM::AccessibilityProperties::Checked::False;
</ins><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Array&lt;int&gt;&gt; childNodeIds;
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Array&lt;int&gt;&gt; controlledNodeIds;
</span><span class="cx">     bool exists = false;
</span><span class="lines">@@ -1455,12 +1455,12 @@
</span><span class="cx">     bool focused = false;
</span><span class="cx">     bool ignored = true;
</span><span class="cx">     bool ignoredByDefault = false;
</span><del>-    TypeBuilder::DOM::AccessibilityProperties::Invalid::Enum invalid = TypeBuilder::DOM::AccessibilityProperties::Invalid::False;
</del><ins>+    TypeBuilder::DOM::AccessibilityProperties::Invalid invalid = TypeBuilder::DOM::AccessibilityProperties::Invalid::False;
</ins><span class="cx">     bool hidden = false;
</span><span class="cx">     String label;
</span><span class="cx">     bool liveRegionAtomic = false;
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Array&lt;String&gt;&gt; liveRegionRelevant;
</span><del>-    TypeBuilder::DOM::AccessibilityProperties::LiveRegionStatus::Enum liveRegionStatus = TypeBuilder::DOM::AccessibilityProperties::LiveRegionStatus::Off;
</del><ins>+    TypeBuilder::DOM::AccessibilityProperties::LiveRegionStatus liveRegionStatus = TypeBuilder::DOM::AccessibilityProperties::LiveRegionStatus::Off;
</ins><span class="cx">     Node* mouseEventNode = nullptr;
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Array&lt;int&gt;&gt; ownedNodeIds;
</span><span class="cx">     Node* parentNode = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx">     return cachedResource;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Inspector::TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::resourceTypeJson(InspectorPageAgent::ResourceType resourceType)
</del><ins>+Inspector::TypeBuilder::Page::ResourceType InspectorPageAgent::resourceTypeJson(InspectorPageAgent::ResourceType resourceType)
</ins><span class="cx"> {
</span><span class="cx">     switch (resourceType) {
</span><span class="cx">     case DocumentResource:
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">     return InspectorPageAgent::OtherResource;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Inspector::TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResourceTypeJson(const CachedResource&amp; cachedResource)
</del><ins>+Inspector::TypeBuilder::Page::ResourceType InspectorPageAgent::cachedResourceTypeJson(const CachedResource&amp; cachedResource)
</ins><span class="cx"> {
</span><span class="cx">     return resourceTypeJson(cachedResourceType(cachedResource));
</span><span class="cx"> }
</span><span class="lines">@@ -706,7 +706,7 @@
</span><span class="cx">         mainFrame()-&gt;view()-&gt;invalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, InspectorPageBackendDispatcherHandler::Result::Enum* status)
</del><ins>+void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, InspectorPageBackendDispatcherHandler::Result* status)
</ins><span class="cx"> {
</span><span class="cx">     bool disabledByScriptController = false;
</span><span class="cx">     bool disabledInSettings = false;
</span><span class="lines">@@ -963,13 +963,13 @@
</span><span class="cx"> PassRefPtr&lt;Inspector::TypeBuilder::Page::FrameResourceTree&gt; InspectorPageAgent::buildObjectForFrameTree(Frame* frame)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Page::Frame&gt; frameObject = buildObjectForFrame(frame);
</span><del>-    RefPtr&lt;Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::Page::FrameResourceTree::Resources&gt;&gt; subresources = Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::Page::FrameResourceTree::Resources&gt;::create();
</del><ins>+    RefPtr&lt;Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::Page::FrameResource&gt;&gt; subresources = Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::Page::FrameResource&gt;::create();
</ins><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Page::FrameResourceTree&gt; result = Inspector::TypeBuilder::Page::FrameResourceTree::create()
</span><span class="cx">          .setFrame(frameObject)
</span><span class="cx">          .setResources(subresources);
</span><span class="cx"> 
</span><span class="cx">     for (auto* cachedResource : cachedResourcesForFrame(frame)) {
</span><del>-        RefPtr&lt;Inspector::TypeBuilder::Page::FrameResourceTree::Resources&gt; resourceObject = Inspector::TypeBuilder::Page::FrameResourceTree::Resources::create()
</del><ins>+        RefPtr&lt;Inspector::TypeBuilder::Page::FrameResource&gt; resourceObject = Inspector::TypeBuilder::Page::FrameResource::create()
</ins><span class="cx">             .setUrl(cachedResource-&gt;url())
</span><span class="cx">             .setType(cachedResourceTypeJson(*cachedResource))
</span><span class="cx">             .setMimeType(cachedResource-&gt;response().mimeType());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -90,9 +90,9 @@
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;SharedBuffer&gt; resourceData(Frame*, const URL&amp;, String* textEncodingName);
</span><span class="cx">     static CachedResource* cachedResource(Frame*, const URL&amp;);
</span><del>-    static Inspector::TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType);
</del><ins>+    static Inspector::TypeBuilder::Page::ResourceType resourceTypeJson(ResourceType);
</ins><span class="cx">     static ResourceType cachedResourceType(const CachedResource&amp;);
</span><del>-    static Inspector::TypeBuilder::Page::ResourceType::Enum cachedResourceTypeJson(const CachedResource&amp;);
</del><ins>+    static Inspector::TypeBuilder::Page::ResourceType cachedResourceTypeJson(const CachedResource&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Page API for InspectorFrontend
</span><span class="cx">     virtual void enable(ErrorString*) override;
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">     virtual void setShowFPSCounter(ErrorString*, bool show) override;
</span><span class="cx">     virtual void canContinuouslyPaint(ErrorString*, bool*) override;
</span><span class="cx">     virtual void setContinuousPaintingEnabled(ErrorString*, bool enabled) override;
</span><del>-    virtual void getScriptExecutionStatus(ErrorString*, Inspector::InspectorPageBackendDispatcherHandler::Result::Enum*) override;
</del><ins>+    virtual void getScriptExecutionStatus(ErrorString*, Inspector::InspectorPageBackendDispatcherHandler::Result*) override;
</ins><span class="cx">     virtual void setScriptExecutionDisabled(ErrorString*, bool) override;
</span><span class="cx">     virtual void setTouchEmulationEnabled(ErrorString*, bool) override;
</span><span class="cx">     virtual void setEmulatedMedia(ErrorString*, const String&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorReplayAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -90,22 +90,22 @@
</span><span class="cx">     return sessionObject.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Replay::SessionState::Enum buildInspectorObjectForSessionState(SessionState sessionState)
</del><ins>+static TypeBuilder::Replay::SessionState buildInspectorObjectForSessionState(WebCore::SessionState sessionState)
</ins><span class="cx"> {
</span><span class="cx">     switch (sessionState) {
</span><del>-    case SessionState::Capturing: return Inspector::TypeBuilder::Replay::SessionState::Capturing;
-    case SessionState::Inactive: return Inspector::TypeBuilder::Replay::SessionState::Inactive;
-    case SessionState::Replaying: return Inspector::TypeBuilder::Replay::SessionState::Replaying;
</del><ins>+    case WebCore::SessionState::Capturing: return TypeBuilder::Replay::SessionState::Capturing;
+    case WebCore::SessionState::Inactive: return TypeBuilder::Replay::SessionState::Inactive;
+    case WebCore::SessionState::Replaying: return TypeBuilder::Replay::SessionState::Replaying;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Replay::SegmentState::Enum buildInspectorObjectForSegmentState(SegmentState segmentState)
</del><ins>+static TypeBuilder::Replay::SegmentState buildInspectorObjectForSegmentState(WebCore::SegmentState segmentState)
</ins><span class="cx"> {
</span><span class="cx">     switch (segmentState) {
</span><del>-    case SegmentState::Appending: return Inspector::TypeBuilder::Replay::SegmentState::Appending;
-    case SegmentState::Unloaded: return Inspector::TypeBuilder::Replay::SegmentState::Unloaded;
-    case SegmentState::Loaded: return Inspector::TypeBuilder::Replay::SegmentState::Loaded;
-    case SegmentState::Dispatching: return Inspector::TypeBuilder::Replay::SegmentState::Dispatching;
</del><ins>+    case WebCore::SegmentState::Appending: return TypeBuilder::Replay::SegmentState::Appending;
+    case WebCore::SegmentState::Unloaded: return TypeBuilder::Replay::SegmentState::Unloaded;
+    case WebCore::SegmentState::Loaded: return TypeBuilder::Replay::SegmentState::Loaded;
+    case WebCore::SegmentState::Dispatching: return TypeBuilder::Replay::SegmentState::Dispatching;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">     ASSERT(!m_segmentsMap.size());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SessionState InspectorReplayAgent::sessionState() const
</del><ins>+WebCore::SessionState InspectorReplayAgent::sessionState() const
</ins><span class="cx"> {
</span><span class="cx">     return m_page.replayController().sessionState();
</span><span class="cx"> }
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">     m_backendDispatcher = InspectorReplayBackendDispatcher::create(backendDispatcher, this);
</span><span class="cx"> 
</span><span class="cx">     m_instrumentingAgents-&gt;setInspectorReplayAgent(this);
</span><del>-    ASSERT(sessionState() == SessionState::Inactive);
</del><ins>+    ASSERT(sessionState() == WebCore::SessionState::Inactive);
</ins><span class="cx"> 
</span><span class="cx">     // Keep track of the (default) session currently loaded by ReplayController,
</span><span class="cx">     // and any segments within the session.
</span><span class="lines">@@ -204,19 +204,19 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::frameNavigated(DocumentLoader* loader)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Inactive)
</del><ins>+    if (sessionState() != WebCore::SessionState::Inactive)
</ins><span class="cx">         m_page.replayController().frameNavigated(loader);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::frameDetached(Frame* frame)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Inactive)
</del><ins>+    if (sessionState() != WebCore::SessionState::Inactive)
</ins><span class="cx">         m_page.replayController().frameDetached(frame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::willDispatchEvent(const Event&amp; event, Frame* frame)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Inactive)
</del><ins>+    if (sessionState() != WebCore::SessionState::Inactive)
</ins><span class="cx">         m_page.replayController().willDispatchEvent(event, frame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::startCapturing(ErrorString* errorString)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Inactive) {
</del><ins>+    if (sessionState() != WebCore::SessionState::Inactive) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't start capturing if the session is already capturing or replaying.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::stopCapturing(ErrorString* errorString)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Capturing) {
</del><ins>+    if (sessionState() != WebCore::SessionState::Capturing) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't stop capturing if capture is not in progress.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (sessionState() == SessionState::Capturing) {
</del><ins>+    if (sessionState() == WebCore::SessionState::Capturing) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't start replay while capture is in progress.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -360,7 +360,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::replayToCompletion(ErrorString* errorString, bool fastReplay)
</span><span class="cx"> {
</span><del>-    if (sessionState() == SessionState::Capturing) {
</del><ins>+    if (sessionState() == WebCore::SessionState::Capturing) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't start replay while capture is in progress.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::pausePlayback(ErrorString* errorString)
</span><span class="cx"> {
</span><del>-    if (sessionState() != SessionState::Replaying) {
</del><ins>+    if (sessionState() != WebCore::SessionState::Replaying) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't pause playback if playback is not in progress.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorReplayAgent::cancelPlayback(ErrorString* errorString)
</span><span class="cx"> {
</span><del>-    if (sessionState() == SessionState::Capturing) {
</del><ins>+    if (sessionState() == WebCore::SessionState::Capturing) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't cancel playback if capture is in progress.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -388,11 +388,11 @@
</span><span class="cx">     m_page.replayController().cancelPlayback();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::switchSession(ErrorString* errorString, SessionIdentifier identifier)
</del><ins>+void InspectorReplayAgent::switchSession(ErrorString* errorString, TypeBuilder::Replay::SessionIdentifier identifier)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(identifier &gt; 0);
</span><span class="cx"> 
</span><del>-    if (sessionState() != SessionState::Inactive) {
</del><ins>+    if (sessionState() != WebCore::SessionState::Inactive) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't switch sessions unless the session is neither capturing or replaying.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">     m_page.replayController().switchSession(session);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::insertSessionSegment(ErrorString* errorString, SessionIdentifier sessionIdentifier, SegmentIdentifier segmentIdentifier, int segmentIndex)
</del><ins>+void InspectorReplayAgent::insertSessionSegment(ErrorString* errorString, TypeBuilder::Replay::SessionIdentifier sessionIdentifier, SegmentIdentifier segmentIdentifier, int segmentIndex)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(sessionIdentifier &gt; 0);
</span><span class="cx">     ASSERT(segmentIdentifier &gt; 0);
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (session == m_page.replayController().loadedSession() &amp;&amp; sessionState() != SessionState::Inactive) {
</del><ins>+    if (session == m_page.replayController().loadedSession() &amp;&amp; sessionState() != WebCore::SessionState::Inactive) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't modify a loaded session unless the session is inactive.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx">     sessionModified(session);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::removeSessionSegment(ErrorString* errorString, SessionIdentifier identifier, int segmentIndex)
</del><ins>+void InspectorReplayAgent::removeSessionSegment(ErrorString* errorString, TypeBuilder::Replay::SessionIdentifier identifier, int segmentIndex)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(identifier &gt; 0);
</span><span class="cx">     ASSERT(segmentIndex &gt;= 0);
</span><span class="lines">@@ -445,7 +445,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (session == m_page.replayController().loadedSession() &amp;&amp; sessionState() != SessionState::Inactive) {
</del><ins>+    if (session == m_page.replayController().loadedSession() &amp;&amp; sessionState() != WebCore::SessionState::Inactive) {
</ins><span class="cx">         *errorString = ASCIILiteral(&quot;Can't modify a loaded session unless the session is inactive.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -480,7 +480,7 @@
</span><span class="cx">     return it-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::currentReplayState(ErrorString*, SessionIdentifier* sessionIdentifier, Inspector::TypeBuilder::OptOutput&lt;int&gt;* segmentIdentifier, Inspector::TypeBuilder::Replay::SessionState::Enum* sessionState, Inspector::TypeBuilder::Replay::SegmentState::Enum* segmentState, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplayPosition&gt;&amp; replayPosition)
</del><ins>+void InspectorReplayAgent::currentReplayState(ErrorString*, TypeBuilder::Replay::SessionIdentifier* sessionIdentifier, TypeBuilder::OptOutput&lt;TypeBuilder::Replay::SegmentIdentifier&gt;* segmentIdentifier, TypeBuilder::Replay::SessionState* sessionState, TypeBuilder::Replay::SegmentState* segmentState, RefPtr&lt;TypeBuilder::Replay::ReplayPosition&gt;&amp; replayPosition)
</ins><span class="cx"> {
</span><span class="cx">     *sessionState = buildInspectorObjectForSessionState(m_page.replayController().sessionState());
</span><span class="cx">     *segmentState = buildInspectorObjectForSegmentState(m_page.replayController().segmentState());
</span><span class="lines">@@ -492,14 +492,14 @@
</span><span class="cx">     replayPosition = buildInspectorObjectForPosition(m_page.replayController().currentPosition());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::getAvailableSessions(ErrorString*, RefPtr&lt;Inspector::TypeBuilder::Array&lt;SessionIdentifier&gt;&gt;&amp; sessionsList)
</del><ins>+void InspectorReplayAgent::getAvailableSessions(ErrorString*, RefPtr&lt;TypeBuilder::Array&lt;SessionIdentifier&gt;&gt;&amp; sessionsList)
</ins><span class="cx"> {
</span><del>-    sessionsList = TypeBuilder::Array&lt;SessionIdentifier&gt;::create();
</del><ins>+    sessionsList = TypeBuilder::Array&lt;TypeBuilder::Replay::SessionIdentifier&gt;::create();
</ins><span class="cx">     for (auto&amp; pair : m_sessionsMap)
</span><span class="cx">         sessionsList-&gt;addItem(pair.key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::getSessionData(ErrorString* errorString, SessionIdentifier identifier, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplaySession&gt;&amp; serializedObject)
</del><ins>+void InspectorReplayAgent::getSessionData(ErrorString* errorString, TypeBuilder::Replay::SessionIdentifier identifier, RefPtr&lt;TypeBuilder::Replay::ReplaySession&gt;&amp; serializedObject)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ReplaySession&gt; session = findSession(errorString, identifier);
</span><span class="cx">     if (!session) {
</span><span class="lines">@@ -510,7 +510,7 @@
</span><span class="cx">     serializedObject = buildInspectorObjectForSession(session);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorReplayAgent::getSegmentData(ErrorString* errorString, SegmentIdentifier identifier, RefPtr&lt;Inspector::TypeBuilder::Replay::SessionSegment&gt;&amp; serializedObject)
</del><ins>+void InspectorReplayAgent::getSegmentData(ErrorString* errorString, TypeBuilder::Replay::SegmentIdentifier identifier, RefPtr&lt;TypeBuilder::Replay::SessionSegment&gt;&amp; serializedObject)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ReplaySessionSegment&gt; segment = findSegment(errorString, identifier);
</span><span class="cx">     if (!segment) {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorReplayAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorReplayAgent.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -101,18 +101,18 @@
</span><span class="cx">     virtual void cancelPlayback(ErrorString*) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void switchSession(ErrorString*, SessionIdentifier) override;
</span><del>-    virtual void insertSessionSegment(ErrorString*, SessionIdentifier, SegmentIdentifier, int segmentIndex) override;
-    virtual void removeSessionSegment(ErrorString*, SessionIdentifier, int segmentIndex) override;
</del><ins>+    virtual void insertSessionSegment(ErrorString*, Inspector::TypeBuilder::Replay::SessionIdentifier, Inspector::TypeBuilder::Replay::SegmentIdentifier, int segmentIndex) override;
+    virtual void removeSessionSegment(ErrorString*, Inspector::TypeBuilder::Replay::SessionIdentifier, int segmentIndex) override;
</ins><span class="cx"> 
</span><del>-    virtual void currentReplayState(ErrorString*, SessionIdentifier*, Inspector::TypeBuilder::OptOutput&lt;int&gt;* segmentIdentifier, Inspector::TypeBuilder::Replay::SessionState::Enum* sessionState, Inspector::TypeBuilder::Replay::SegmentState::Enum* segmentState, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplayPosition&gt;&amp;) override;
-    virtual void getAvailableSessions(ErrorString*, RefPtr&lt;Inspector::TypeBuilder::Array&lt;SessionIdentifier&gt;&gt;&amp;) override;
-    virtual void getSessionData(ErrorString*, SessionIdentifier, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplaySession&gt;&amp;) override;
-    virtual void getSegmentData(ErrorString*, SegmentIdentifier, RefPtr&lt;Inspector::TypeBuilder::Replay::SessionSegment&gt;&amp;) override;
</del><ins>+    virtual void currentReplayState(ErrorString*, Inspector::TypeBuilder::Replay::SessionIdentifier*, Inspector::TypeBuilder::OptOutput&lt;Inspector::TypeBuilder::Replay::SegmentIdentifier&gt;*, Inspector::TypeBuilder::Replay::SessionState*, Inspector::TypeBuilder::Replay::SegmentState* segmentState, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplayPosition&gt;&amp;) override;
+    virtual void getAvailableSessions(ErrorString*, RefPtr&lt;Inspector::TypeBuilder::Array&lt;Inspector::TypeBuilder::Replay::SessionIdentifier&gt;&gt;&amp;) override;
+    virtual void getSessionData(ErrorString*, Inspector::TypeBuilder::Replay::SessionIdentifier, RefPtr&lt;Inspector::TypeBuilder::Replay::ReplaySession&gt;&amp;) override;
+    virtual void getSegmentData(ErrorString*, Inspector::TypeBuilder::Replay::SegmentIdentifier, RefPtr&lt;Inspector::TypeBuilder::Replay::SessionSegment&gt;&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PassRefPtr&lt;ReplaySession&gt; findSession(ErrorString*, SessionIdentifier);
</span><span class="cx">     PassRefPtr&lt;ReplaySessionSegment&gt; findSegment(ErrorString*, SegmentIdentifier);
</span><del>-    SessionState sessionState() const;
</del><ins>+    WebCore::SessionState sessionState() const;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;Inspector::InspectorReplayFrontendDispatcher&gt; m_frontendDispatcher;
</span><span class="cx">     RefPtr&lt;Inspector::InspectorReplayBackendDispatcher&gt; m_backendDispatcher;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx">         request.setHTTPHeaderField(HTTPHeaderName::CacheControl, &quot;no-cache&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Inspector::TypeBuilder::Page::ResourceType::Enum resourceType = InspectorPageAgent::resourceTypeJson(type);
</del><ins>+    Inspector::TypeBuilder::Page::ResourceType resourceType = InspectorPageAgent::resourceTypeJson(type);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Inspector::TypeBuilder::Network::Initiator&gt; initiatorObject = buildInitiatorObject(loader-&gt;frame() ? loader-&gt;frame()-&gt;document() : nullptr);
</span><span class="cx">     m_frontendDispatcher-&gt;requestWillBeSent(requestId, m_pageAgent-&gt;frameId(loader-&gt;frame()), m_pageAgent-&gt;loaderId(loader), loader-&gt;url().string(), buildObjectForResourceRequest(request), currentTime(), initiatorObject, buildObjectForResourceResponse(redirectResponse, loader), type != InspectorPageAgent::OtherResource ? &amp;resourceType : nullptr);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> static PassRefPtr&lt;Inspector::TypeBuilder::CSS::CSSMedia&gt; buildMediaObject(const MediaList* media, MediaListSource mediaListSource, const String&amp; sourceURL)
</span><span class="cx"> {
</span><span class="cx">     // Make certain compilers happy by initializing |source| up-front.
</span><del>-    Inspector::TypeBuilder::CSS::CSSMedia::Source::Enum source = Inspector::TypeBuilder::CSS::CSSMedia::Source::InlineSheet;
</del><ins>+    Inspector::TypeBuilder::CSS::CSSMedia::Source source = Inspector::TypeBuilder::CSS::CSSMedia::Source::InlineSheet;
</ins><span class="cx">     switch (mediaListSource) {
</span><span class="cx">     case MediaListSourceMediaRule:
</span><span class="cx">         source = Inspector::TypeBuilder::CSS::CSSMedia::Source::MediaRule;
</span><span class="lines">@@ -528,7 +528,13 @@
</span><span class="cx">         const CSSPropertySourceData&amp; propertyEntry = it-&gt;sourceData;
</span><span class="cx">         const String&amp; name = propertyEntry.name;
</span><span class="cx"> 
</span><del>-        Inspector::TypeBuilder::CSS::CSSProperty::Status::Enum status = it-&gt;disabled ? Inspector::TypeBuilder::CSS::CSSProperty::Status::Disabled : Inspector::TypeBuilder::CSS::CSSProperty::Status::Active;
</del><ins>+        // Visual Studio disagrees with other compilers as to whether 'class' is needed here.
+#if COMPILER(MSVC)
+        enum class Inspector::TypeBuilder::CSS::CSSPropertyStatus status;
+#else
+        enum Inspector::TypeBuilder::CSS::CSSPropertyStatus status;
+#endif
+        status = it-&gt;disabled ? Inspector::TypeBuilder::CSS::CSSPropertyStatus::Disabled : Inspector::TypeBuilder::CSS::CSSPropertyStatus::Active;
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;Inspector::TypeBuilder::CSS::CSSProperty&gt; property = Inspector::TypeBuilder::CSS::CSSProperty::create()
</span><span class="cx">             .setName(name.lower())
</span><span class="lines">@@ -571,9 +577,9 @@
</span><span class="cx">                         if (successStatus &amp;&amp; previousStatus != &quot;inactive&quot;) {
</span><span class="cx">                             if (propertyEntry.important || !successPriority) // Priority not set == &quot;not important&quot;.
</span><span class="cx">                                 shouldInactivate = true;
</span><del>-                            else if (status == Inspector::TypeBuilder::CSS::CSSProperty::Status::Active) {
</del><ins>+                            else if (status == Inspector::TypeBuilder::CSS::CSSPropertyStatus::Active) {
</ins><span class="cx">                                 // Inactivate a non-important property following the same-named important property.
</span><del>-                                status = Inspector::TypeBuilder::CSS::CSSProperty::Status::Inactive;
</del><ins>+                                status = Inspector::TypeBuilder::CSS::CSSPropertyStatus::Inactive;
</ins><span class="cx">                             }
</span><span class="cx">                         }
</span><span class="cx">                     } else {
</span><span class="lines">@@ -586,7 +592,7 @@
</span><span class="cx">                     propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property);
</span><span class="cx"> 
</span><span class="cx">                 if (shouldInactivate) {
</span><del>-                    activeIt-&gt;value-&gt;setStatus(Inspector::TypeBuilder::CSS::CSSProperty::Status::Inactive);
</del><ins>+                    activeIt-&gt;value-&gt;setStatus(Inspector::TypeBuilder::CSS::CSSPropertyStatus::Inactive);
</ins><span class="cx">                     propertyNameToPreviousActiveProperty.set(canonicalPropertyName, property);
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><span class="lines">@@ -594,7 +600,7 @@
</span><span class="cx">                 // Default &quot;implicit&quot; == false.
</span><span class="cx">                 if (implicit)
</span><span class="cx">                     property-&gt;setImplicit(true);
</span><del>-                status = Inspector::TypeBuilder::CSS::CSSProperty::Status::Style;
</del><ins>+                status = Inspector::TypeBuilder::CSS::CSSPropertyStatus::Style;
</ins><span class="cx"> 
</span><span class="cx">                 String shorthand = m_style-&gt;getPropertyShorthand(name);
</span><span class="cx">                 if (!shorthand.isEmpty()) {
</span><span class="lines">@@ -610,7 +616,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Default &quot;status&quot; == &quot;style&quot;.
</span><del>-        if (status != Inspector::TypeBuilder::CSS::CSSProperty::Status::Style)
</del><ins>+        if (status != Inspector::TypeBuilder::CSS::CSSPropertyStatus::Style)
</ins><span class="cx">             property-&gt;setStatus(status);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -749,7 +755,7 @@
</span><span class="cx">     return m_format;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;InspectorStyleSheet&gt; InspectorStyleSheet::create(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String&amp; documentURL, Listener* listener)
</del><ins>+PassRefPtr&lt;InspectorStyleSheet&gt; InspectorStyleSheet::create(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin origin, const String&amp; documentURL, Listener* listener)
</ins><span class="cx"> {
</span><span class="cx">     return adoptRef(new InspectorStyleSheet(pageAgent, id, pageStyleSheet, origin, documentURL, listener));
</span><span class="cx"> }
</span><span class="lines">@@ -762,7 +768,7 @@
</span><span class="cx">     return emptyString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorStyleSheet::InspectorStyleSheet(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String&amp; documentURL, Listener* listener)
</del><ins>+InspectorStyleSheet::InspectorStyleSheet(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin origin, const String&amp; documentURL, Listener* listener)
</ins><span class="cx">     : m_pageAgent(pageAgent)
</span><span class="cx">     , m_id(id)
</span><span class="cx">     , m_pageStyleSheet(pageStyleSheet)
</span><span class="lines">@@ -1426,12 +1432,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;InspectorStyleSheetForInlineStyle&gt; InspectorStyleSheetForInlineStyle::create(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;Element&gt; element, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
</del><ins>+PassRefPtr&lt;InspectorStyleSheetForInlineStyle&gt; InspectorStyleSheetForInlineStyle::create(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;Element&gt; element, Inspector::TypeBuilder::CSS::StyleSheetOrigin origin, Listener* listener)
</ins><span class="cx"> {
</span><span class="cx">     return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, id, element, origin, listener));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;Element&gt; element, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
</del><ins>+InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPageAgent* pageAgent, const String&amp; id, PassRefPtr&lt;Element&gt; element, Inspector::TypeBuilder::CSS::StyleSheetOrigin origin, Listener* listener)
</ins><span class="cx">     : InspectorStyleSheet(pageAgent, id, nullptr, origin, &quot;&quot;, listener)
</span><span class="cx">     , m_element(element)
</span><span class="cx">     , m_ruleSourceData(nullptr)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.h (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.h        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     typedef HashMap&lt;CSSStyleDeclaration*, RefPtr&lt;InspectorStyle&gt;&gt; InspectorStyleMap;
</span><del>-    static PassRefPtr&lt;InspectorStyleSheet&gt; create(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum, const String&amp; documentURL, Listener*);
</del><ins>+    static PassRefPtr&lt;InspectorStyleSheet&gt; create(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin, const String&amp; documentURL, Listener*);
</ins><span class="cx">     static String styleSheetURL(CSSStyleSheet* pageStyleSheet);
</span><span class="cx"> 
</span><span class="cx">     virtual ~InspectorStyleSheet();
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx">     InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyleId(style); }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    InspectorStyleSheet(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum, const String&amp; documentURL, Listener*);
</del><ins>+    InspectorStyleSheet(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;CSSStyleSheet&gt; pageStyleSheet, Inspector::TypeBuilder::CSS::StyleSheetOrigin, const String&amp; documentURL, Listener*);
</ins><span class="cx"> 
</span><span class="cx">     bool canBind() const { return m_origin != Inspector::TypeBuilder::CSS::StyleSheetOrigin::UserAgent &amp;&amp; m_origin != Inspector::TypeBuilder::CSS::StyleSheetOrigin::User; }
</span><span class="cx">     InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
</span><span class="lines">@@ -248,7 +248,7 @@
</span><span class="cx">     InspectorPageAgent* m_pageAgent;
</span><span class="cx">     String m_id;
</span><span class="cx">     RefPtr&lt;CSSStyleSheet&gt; m_pageStyleSheet;
</span><del>-    Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
</del><ins>+    Inspector::TypeBuilder::CSS::StyleSheetOrigin m_origin;
</ins><span class="cx">     String m_documentURL;
</span><span class="cx">     bool m_isRevalidating;
</span><span class="cx">     ParsedStyleSheet* m_parsedStyleSheet;
</span><span class="lines">@@ -259,14 +259,14 @@
</span><span class="cx"> 
</span><span class="cx"> class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;InspectorStyleSheetForInlineStyle&gt; create(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;Element&gt;, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
</del><ins>+    static PassRefPtr&lt;InspectorStyleSheetForInlineStyle&gt; create(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;Element&gt;, Inspector::TypeBuilder::CSS::StyleSheetOrigin, Listener*);
</ins><span class="cx"> 
</span><span class="cx">     void didModifyElementAttribute();
</span><span class="cx">     virtual bool getText(String* result) const override;
</span><span class="cx">     virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&amp; id) const override { ASSERT_UNUSED(id, !id.ordinal()); return inlineStyle(); }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    InspectorStyleSheetForInlineStyle(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;Element&gt;, Inspector::TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
</del><ins>+    InspectorStyleSheetForInlineStyle(InspectorPageAgent*, const String&amp; id, PassRefPtr&lt;Element&gt;, Inspector::TypeBuilder::CSS::StyleSheetOrigin, Listener*);
</ins><span class="cx"> 
</span><span class="cx">     virtual Document* ownerDocument() const override;
</span><span class="cx">     virtual RefPtr&lt;CSSRuleSourceData&gt; ruleSourceDataFor(CSSStyleDeclaration* style) const override { ASSERT_UNUSED(style, style == inlineStyle()); return m_ruleSourceData; }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -554,7 +554,7 @@
</span><span class="cx">     appendRecord(TimelineRecordFactory::createProbeSampleData(action, hitCount), TimelineRecordType::ProbeSample, false, frameFromExecState(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Inspector::TypeBuilder::Timeline::EventType::Enum toProtocol(TimelineRecordType type)
</del><ins>+static Inspector::TypeBuilder::Timeline::EventType toProtocol(TimelineRecordType type)
</ins><span class="cx"> {
</span><span class="cx">     switch (type) {
</span><span class="cx">     case TimelineRecordType::EventDispatch:
</span><span class="lines">@@ -646,7 +646,7 @@
</span><span class="cx"> {
</span><span class="cx">     prpRecord-&gt;setString(&quot;type&quot;, Inspector::TypeBuilder::getWebEnumConstantValue(toProtocol(type)));
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt; record = Inspector::TypeBuilder::Timeline::TimelineEvent::runtimeCast(prpRecord);
</del><ins>+    RefPtr&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt; record = BindingTraits&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt;::runtimeCast(prpRecord);
</ins><span class="cx"> 
</span><span class="cx">     if (m_recordStack.isEmpty())
</span><span class="cx">         sendEvent(record.release());
</span><span class="lines">@@ -714,7 +714,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
</span><del>-    RefPtr&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt; recordChecked = Inspector::TypeBuilder::Timeline::TimelineEvent::runtimeCast(event);
</del><ins>+    RefPtr&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt; recordChecked = BindingTraits&lt;Inspector::TypeBuilder::Timeline::TimelineEvent&gt;::runtimeCast(event);
</ins><span class="cx">     m_frontendDispatcher-&gt;eventRecorded(recordChecked.release());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolCSSjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/CSS.json (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/CSS.json        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/protocol/CSS.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -163,6 +163,12 @@
</span><span class="cx">             &quot;description&quot;: &quot;CSS style representation.&quot;
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;id&quot;: &quot;CSSPropertyStatus&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;],
+            &quot;description&quot;: &quot;The property status: \&quot;active\&quot; if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; (implied if absent) if the property is reported by the browser rather than by the CSS source parser.&quot;
+        },
+        {
</ins><span class="cx">             &quot;id&quot;: &quot;CSSProperty&quot;,
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="lines">@@ -172,7 +178,7 @@
</span><span class="cx">                 { &quot;name&quot;: &quot;implicit&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is implicit (implies &lt;code&gt;false&lt;/code&gt; if absent).&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;text&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The full property text as specified in the style.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;parsedOk&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is understood by the browser (implies &lt;code&gt;true&lt;/code&gt; if absent).&quot; },
</span><del>-                { &quot;name&quot;: &quot;status&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;], &quot;optional&quot;: true, &quot;description&quot;: &quot;The property status: \&quot;active\&quot; if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; (implied if absent) if the property is reported by the browser rather than by the CSS source parser.&quot; },
</del><ins>+                { &quot;name&quot;: &quot;status&quot;, &quot;$ref&quot;: &quot;CSSPropertyStatus&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is active or disabled.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;range&quot;, &quot;$ref&quot;: &quot;SourceRange&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The entire property range in the enclosing style declaration (if available).&quot; }
</span><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;CSS style effective visual dimensions and source offsets.&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolPagejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/Page.json (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/Page.json        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebCore/inspector/protocol/Page.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -29,26 +29,25 @@
</span><span class="cx">             ]
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;id&quot;: &quot;FrameResource&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
+                { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
+                { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
+                { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
+                { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; },
+                { &quot;name&quot;: &quot;sourceMapURL&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;URL of source map associated with this resource (if any).&quot; }
+            ]
+        },
+        {
</ins><span class="cx">             &quot;id&quot;: &quot;FrameResourceTree&quot;,
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;description&quot;: &quot;Information about the Frame hierarchy along with their cached resources.&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;frame&quot;, &quot;$ref&quot;: &quot;Frame&quot;, &quot;description&quot;: &quot;Frame information for this tree item.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;childFrames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResourceTree&quot; }, &quot;description&quot;: &quot;Child frames.&quot; },
</span><del>-                { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;,
-                    &quot;items&quot;: {
-                        &quot;type&quot;: &quot;object&quot;,
-                        &quot;properties&quot;: [
-                            { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
-                            { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
-                            { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
-                            { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
-                            { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; },
-                            { &quot;name&quot;: &quot;sourceMapURL&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;URL of source map associated with this resource (if any).&quot; }
-                        ]
-                    },
-                    &quot;description&quot;: &quot;Information about frame resources.&quot;
-                }
</del><ins>+                { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResource&quot; }, &quot;description&quot;: &quot;Information about frame resources.&quot; }
</ins><span class="cx">             ]
</span><span class="cx">         },
</span><span class="cx">         {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
+        https://bugs.webkit.org/show_bug.cgi?id=131596
+
+        Reviewed by Joseph Pecoraro.
+
+        Also apply type extraction refactorings to old protocol versions for consistency.
+
+        * Versions/Inspector-iOS-6.0.json:
+        * Versions/Inspector-iOS-7.0.json:
+
</ins><span class="cx"> 2014-08-15  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Probe details sidebar data grids do not show data
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIVersionsInspectoriOS60json"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-6.0.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -68,25 +68,24 @@
</span><span class="cx">                 ]
</span><span class="cx">             },
</span><span class="cx">             {
</span><ins>+                &quot;id&quot;: &quot;FrameResource&quot;,
+                &quot;type&quot;: &quot;object&quot;,
+                &quot;properties&quot;: [
+                    { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
+                    { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
+                    { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
+                    { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
+                    { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; }
+                ]
+            },
+            {
</ins><span class="cx">                 &quot;id&quot;: &quot;FrameResourceTree&quot;,
</span><span class="cx">                 &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">                 &quot;description&quot;: &quot;Information about the Frame hierarchy along with their cached resources.&quot;,
</span><span class="cx">                 &quot;properties&quot;: [
</span><span class="cx">                     { &quot;name&quot;: &quot;frame&quot;, &quot;$ref&quot;: &quot;Frame&quot;, &quot;description&quot;: &quot;Frame information for this tree item.&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;childFrames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResourceTree&quot; }, &quot;description&quot;: &quot;Child frames.&quot; },
</span><del>-                    { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;,
-                        &quot;items&quot;: {
-                            &quot;type&quot;: &quot;object&quot;,
-                            &quot;properties&quot;: [
-                                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
-                                { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
-                                { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
-                                { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
-                                { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; }
-                            ]
-                        },
-                        &quot;description&quot;: &quot;Information about frame resources.&quot;
-                    }
</del><ins>+                    { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResource&quot; }, &quot;description&quot;: &quot;Information about frame resources.&quot; }
</ins><span class="cx">                 ]
</span><span class="cx">             },
</span><span class="cx">             {
</span><span class="lines">@@ -1587,7 +1586,7 @@
</span><span class="cx">                     { &quot;name&quot;: &quot;name&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Computed style property name.&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;value&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Computed style property value.&quot; }
</span><span class="cx">                 ]
</span><del>-            },            
</del><ins>+            },
</ins><span class="cx">             {
</span><span class="cx">                 &quot;id&quot;: &quot;CSSStyle&quot;,
</span><span class="cx">                 &quot;type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -1603,6 +1602,12 @@
</span><span class="cx">                 &quot;description&quot;: &quot;CSS style representation.&quot;
</span><span class="cx">             },
</span><span class="cx">             {
</span><ins>+                &quot;id&quot;: &quot;CSSPropertyStatus&quot;,
+                &quot;type&quot;: &quot;string&quot;,
+                &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;],
+                &quot;description&quot;: &quot;The property status: \&quot;active\&quot; (implied if absent) if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; if the property is reported by the browser rather than by the CSS source parser.&quot;
+            },
+            {
</ins><span class="cx">                 &quot;id&quot;: &quot;CSSProperty&quot;,
</span><span class="cx">                 &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">                 &quot;properties&quot;: [
</span><span class="lines">@@ -1612,7 +1617,7 @@
</span><span class="cx">                     { &quot;name&quot;: &quot;implicit&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is implicit (implies &lt;code&gt;false&lt;/code&gt; if absent).&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;text&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The full property text as specified in the style.&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;parsedOk&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is understood by the browser (implies &lt;code&gt;true&lt;/code&gt; if absent).&quot; },
</span><del>-                    { &quot;name&quot;: &quot;status&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;], &quot;optional&quot;: true, &quot;description&quot;: &quot;The property status: \&quot;active\&quot; (implied if absent) if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; if the property is reported by the browser rather than by the CSS source parser.&quot; },
</del><ins>+                    { &quot;name&quot;: &quot;status&quot;, &quot;$ref&quot;: &quot;CSSPropertyStatus&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is active or disabled.&quot; },
</ins><span class="cx">                     { &quot;name&quot;: &quot;shorthandName&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The related shorthand property name (absent if this property is not a longhand).&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;range&quot;, &quot;$ref&quot;: &quot;SourceRange&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The entire property range in the enclosing style declaration (if available).&quot; }
</span><span class="cx">                 ],
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIVersionsInspectoriOS70json"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -65,26 +65,25 @@
</span><span class="cx">                 ]
</span><span class="cx">             },
</span><span class="cx">             {
</span><ins>+                &quot;id&quot;: &quot;FrameResource&quot;,
+                &quot;type&quot;: &quot;object&quot;,
+                &quot;properties&quot;: [
+                    { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
+                    { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
+                    { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
+                    { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
+                    { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; },
+                    { &quot;name&quot;: &quot;sourceMapURL&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;URL of source map associated with this resource (if any).&quot; }
+                ]
+            },
+            {
</ins><span class="cx">                 &quot;id&quot;: &quot;FrameResourceTree&quot;,
</span><span class="cx">                 &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">                 &quot;description&quot;: &quot;Information about the Frame hierarchy along with their cached resources.&quot;,
</span><span class="cx">                 &quot;properties&quot;: [
</span><span class="cx">                     { &quot;name&quot;: &quot;frame&quot;, &quot;$ref&quot;: &quot;Frame&quot;, &quot;description&quot;: &quot;Frame information for this tree item.&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;childFrames&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResourceTree&quot; }, &quot;description&quot;: &quot;Child frames.&quot; },
</span><del>-                    { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;,
-                        &quot;items&quot;: {
-                            &quot;type&quot;: &quot;object&quot;,
-                            &quot;properties&quot;: [
-                                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource URL.&quot; },
-                                { &quot;name&quot;: &quot;type&quot;, &quot;$ref&quot;: &quot;ResourceType&quot;, &quot;description&quot;: &quot;Type of this resource.&quot; },
-                                { &quot;name&quot;: &quot;mimeType&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Resource mimeType as determined by the browser.&quot; },
-                                { &quot;name&quot;: &quot;failed&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource failed to load.&quot; },
-                                { &quot;name&quot;: &quot;canceled&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if the resource was canceled during loading.&quot; },
-                                { &quot;name&quot;: &quot;sourceMapURL&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;URL of source map associated with this resource (if any).&quot; }
-                            ]
-                        },
-                        &quot;description&quot;: &quot;Information about frame resources.&quot;
-                    }
</del><ins>+                    { &quot;name&quot;: &quot;resources&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;FrameResource&quot; }, &quot;description&quot;: &quot;Information about frame resources.&quot; }
</ins><span class="cx">                 ]
</span><span class="cx">             },
</span><span class="cx">             {
</span><span class="lines">@@ -1917,6 +1916,12 @@
</span><span class="cx">                 &quot;description&quot;: &quot;CSS style representation.&quot;
</span><span class="cx">             },
</span><span class="cx">             {
</span><ins>+                &quot;id&quot;: &quot;CSSPropertyStatus&quot;,
+                &quot;type&quot;: &quot;string&quot;,
+                &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;],
+                &quot;description&quot;: &quot;The property status: \&quot;active\&quot; (implied if absent) if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; if the property is reported by the browser rather than by the CSS source parser.&quot;
+            },
+            {
</ins><span class="cx">                 &quot;id&quot;: &quot;CSSProperty&quot;,
</span><span class="cx">                 &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">                 &quot;properties&quot;: [
</span><span class="lines">@@ -1926,7 +1931,7 @@
</span><span class="cx">                     { &quot;name&quot;: &quot;implicit&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is implicit (implies &lt;code&gt;false&lt;/code&gt; if absent).&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;text&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The full property text as specified in the style.&quot; },
</span><span class="cx">                     { &quot;name&quot;: &quot;parsedOk&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is understood by the browser (implies &lt;code&gt;true&lt;/code&gt; if absent).&quot; },
</span><del>-                    { &quot;name&quot;: &quot;status&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;active&quot;, &quot;inactive&quot;, &quot;disabled&quot;, &quot;style&quot;], &quot;optional&quot;: true, &quot;description&quot;: &quot;The property status: \&quot;active\&quot; if the property is effective in the style, \&quot;inactive\&quot; if the property is overridden by a same-named property in this style later on, \&quot;disabled\&quot; if the property is disabled by the user, \&quot;style\&quot; (implied if absent) if the property is reported by the browser rather than by the CSS source parser.&quot; },
</del><ins>+                    { &quot;name&quot;: &quot;status&quot;, &quot;$ref&quot;: &quot;CSSPropertyStatus&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Whether the property is active or disabled.&quot; },
</ins><span class="cx">                     { &quot;name&quot;: &quot;range&quot;, &quot;$ref&quot;: &quot;SourceRange&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The entire property range in the enclosing style declaration (if available).&quot; }
</span><span class="cx">                 ],
</span><span class="cx">                 &quot;description&quot;: &quot;CSS style effective visual dimensions and source offsets.&quot;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (172654 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-08-15 21:48:36 UTC (rev 172654)
+++ trunk/Tools/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
+        https://bugs.webkit.org/show_bug.cgi?id=131596
+
+        Reviewed by Joseph Pecoraro.
+
+        * Scripts/run-inspector-generator-tests: Added.
+        (main):
+        * Scripts/webkitpy/inspector/__init__.py: Added.
+        * Scripts/webkitpy/inspector/main.py: Added.
+        (InspectorGeneratorTests):
+        (InspectorGeneratorTests.__init__):
+        (InspectorGeneratorTests.generate_from_json):
+        (InspectorGeneratorTests.write_error_file):
+        (InspectorGeneratorTests.detect_changes):
+        (InspectorGeneratorTests.run_tests):
+        (InspectorGeneratorTests.main):
+
</ins><span class="cx"> 2014-08-15  Rebecca Hauck  &lt;rhauck@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         run-webkit-tests should skip 'support' directories
</span></span></pre></div>
<a id="trunkToolsScriptsruninspectorgeneratortests"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/run-inspector-generator-tests (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/run-inspector-generator-tests                                (rev 0)
+++ trunk/Tools/Scripts/run-inspector-generator-tests        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+#!/usr/bin/env python
+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+import sys
+from webkitpy.common.system import executive
+
+def main(argv):
+    &quot;&quot;&quot;Runs replay input code generator on test specification files and compares
+    the results with reference files.
+
+    Options:
+       --reset-results: Overwrites the reference files with the generated results.
+
+    &quot;&quot;&quot;
+    reset_results = &quot;--reset-results&quot; in argv
+
+    from webkitpy.inspector.main import InspectorGeneratorTests
+    return InspectorGeneratorTests(reset_results, executive.Executive()).main()
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv))
</ins><span class="cx">Property changes on: trunk/Tools/Scripts/run-inspector-generator-tests
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkToolsScriptswebkitpyinspector__init__py"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/inspector/__init__.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/inspector/__init__.py                                (rev 0)
+++ trunk/Tools/Scripts/webkitpy/inspector/__init__.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+# Required for Python to search this directory for module files
</ins></span></pre></div>
<a id="trunkToolsScriptswebkitpyinspectormainpy"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/inspector/main.py (0 => 172655)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/inspector/main.py                                (rev 0)
+++ trunk/Tools/Scripts/webkitpy/inspector/main.py        2014-08-15 22:40:33 UTC (rev 172655)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+# Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2014 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+# IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import os.path
+import shutil
+import sys
+import tempfile
+from webkitpy.common.checkout.scm.detection import detect_scm_system
+from webkitpy.common.system.executive import ScriptError
+
+
+class InspectorGeneratorTests:
+
+    def __init__(self, reset_results, executive):
+        self.reset_results = reset_results
+        self.executive = executive
+
+    def generate_from_json(self, json_file, output_directory):
+        cmd = ['python',
+               'JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py',
+               '--outputDir', output_directory,
+               '--force',
+               '--framework', 'Test',
+               '--test',
+               json_file]
+
+        exit_code = 0
+        try:
+            stderr_output = self.executive.run_command(cmd)
+            if stderr_output:
+                self.write_error_file(json_file, output_directory, stderr_output)
+        except ScriptError, e:
+            print e.output
+            exit_code = e.exit_code
+        return exit_code
+
+    def write_error_file(self, input_filepath, output_directory, error_output):
+        output_filepath = os.path.join(output_directory, os.path.basename(input_filepath) + '-error')
+
+        with open(output_filepath, &quot;w&quot;) as output_file:
+            output_file.write(error_output)
+
+    def detect_changes(self, work_directory, reference_directory):
+        changes_found = False
+        for output_file in os.listdir(work_directory):
+            cmd = ['diff',
+                   '-u',
+                   '-N',
+                   os.path.join(reference_directory, output_file),
+                   os.path.join(work_directory, output_file)]
+
+            exit_code = 0
+            try:
+                output = self.executive.run_command(cmd)
+            except ScriptError, e:
+                output = e.output
+                exit_code = e.exit_code
+
+            if exit_code or output:
+                print 'FAIL: %s' % output_file
+                print output
+                changes_found = True
+            else:
+                print 'PASS: %s' % output_file
+        return changes_found
+
+    def run_tests(self, input_directory, reference_directory):
+        work_directory = reference_directory
+
+        passed = True
+        for input_file in os.listdir(input_directory):
+            (name, extension) = os.path.splitext(input_file)
+            if extension != '.json':
+                continue
+            # Generate output into the work directory (either the given one or a
+            # temp one if not reset_results is performed)
+            if not self.reset_results:
+                work_directory = tempfile.mkdtemp()
+
+            if self.generate_from_json(os.path.join(input_directory, input_file), work_directory):
+                passed = False
+
+            if self.reset_results:
+                print &quot;Reset results for test: %s&quot; % (input_file)
+                continue
+
+            # Detect changes
+            if self.detect_changes(work_directory, reference_directory):
+                passed = False
+            shutil.rmtree(work_directory)
+
+        return passed
+
+    def main(self):
+        current_scm = detect_scm_system(os.curdir)
+        os.chdir(os.path.join(current_scm.checkout_root, 'Source'))
+
+        all_tests_passed = True
+
+        input_directory = os.path.join('JavaScriptCore', 'inspector', 'scripts', 'tests')
+        reference_directory = os.path.join('JavaScriptCore', 'inspector', 'scripts', 'tests', 'expected')
+        if not self.run_tests(input_directory, reference_directory):
+            all_tests_passed = False
+
+        print ''
+        if all_tests_passed:
+            print 'All tests PASS!'
+            return 0
+        else:
+            print 'Some tests FAIL! (To update the reference files, execute &quot;run-inspector-generator-tests --reset-results&quot;)'
+            return -1
</ins></span></pre>
</div>
</div>

</body>
</html>