<!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>[176329] trunk/Source/JavaScriptCore</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/176329">176329</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-11-19 11:16:23 -0800 (Wed, 19 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: standardize language-specific protocol generator file, class, and method prefixes
https://bugs.webkit.org/show_bug.cgi?id=138237

Reviewed by Joseph Pecoraro.

Settle on cpp/objc/js file prefixes and Cpp/ObjC/JS class prefixes for generators.
Move C++-specific static methods into CppGenerator and add cpp_ prefixes where relevant.
Split the templates file into language-specific template files.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/codegen/__init__.py:
* inspector/scripts/codegen/cpp_generator.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator.py.
* inspector/scripts/codegen/cpp_generator_templates.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py.
(CppGeneratorTemplates):
* inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py.
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py.
* inspector/scripts/codegen/generate_js_backend_commands.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py.
* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_objc_configuration_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py.
* inspector/scripts/codegen/generate_objc_configuration_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py.
* inspector/scripts/codegen/generate_objc_conversion_helpers.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py.
* inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_objc_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py.
* inspector/scripts/codegen/generate_objc_internal_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py.
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py.
* inspector/scripts/codegen/generator.py:
* inspector/scripts/codegen/generator_templates.py:
* inspector/scripts/codegen/objc_generator.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py.
* inspector/scripts/codegen/objc_generator_templates.py: Added.
* inspector/scripts/generate-inspector-protocol-bindings.py:</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="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegen__init__py">trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.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="#trunkSourceJavaScriptCoreinspectorscriptsgenerateinspectorprotocolbindingspy">trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegencpp_generatorpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegencpp_generator_templatespy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_alternate_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_backend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_frontend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_frontend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_protocol_types_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_protocol_types_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_js_backend_commandspy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_backend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_configuration_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_configuration_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_conversion_helperspy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_conversion_helpers.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_frontend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_internal_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_protocol_types_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegenobjc_generatorpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegenobjc_generator_templatespy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_alternate_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.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_objective_cpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_conversion_helperspy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_frontend_dispatcher_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_internal_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_types_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_headerpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_implementationpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengenerator_templatespy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.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 (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -992,13 +992,15 @@
</span><span class="cx"> 
</span><span class="cx"> set(JavaScriptCore_INSPECTOR_PROTOCOL_SCRIPTS
</span><span class="cx">     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/generate-inspector-protocol-bindings.py
</span><del>-    ${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_protocol_types_header.py
-    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_protocol_types_implementation.py
</del><ins>+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/cpp_generator_templates.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_js_backend_commands.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_backend_dispatcher_implementation.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_frontend_dispatcher_implementation.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_header.py
+    ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generate_cpp_protocol_types_implementation.py
</ins><span class="cx">     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator.py
</span><span class="cx">     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/generator_templates.py
</span><span class="cx">     ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/codegen/__init__.py
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2014-11-18  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Inspector: standardize language-specific protocol generator file, class, and method prefixes
+        https://bugs.webkit.org/show_bug.cgi?id=138237
+
+        Reviewed by Joseph Pecoraro.
+
+        Settle on cpp/objc/js file prefixes and Cpp/ObjC/JS class prefixes for generators.
+        Move C++-specific static methods into CppGenerator and add cpp_ prefixes where relevant.
+        Split the templates file into language-specific template files.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/scripts/codegen/__init__.py:
+        * inspector/scripts/codegen/cpp_generator.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator.py.
+        * inspector/scripts/codegen/cpp_generator_templates.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py.
+        (CppGeneratorTemplates):
+        * inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
+        * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py.
+        * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py.
+        * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py.
+        * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py.
+        * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py.
+        * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py.
+        * inspector/scripts/codegen/generate_js_backend_commands.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py.
+        * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py.
+        * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py.
+        * inspector/scripts/codegen/generate_objc_configuration_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py.
+        * inspector/scripts/codegen/generate_objc_configuration_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py.
+        * inspector/scripts/codegen/generate_objc_conversion_helpers.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py.
+        * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py.
+        * inspector/scripts/codegen/generate_objc_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py.
+        * inspector/scripts/codegen/generate_objc_internal_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py.
+        * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py.
+        * inspector/scripts/codegen/generator.py:
+        * inspector/scripts/codegen/generator_templates.py:
+        * inspector/scripts/codegen/objc_generator.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py.
+        * inspector/scripts/codegen/objc_generator_templates.py: Added.
+        * inspector/scripts/generate-inspector-protocol-bindings.py:
+
</ins><span class="cx"> 2014-11-19  Juergen Ributzka  &lt;juergen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update WebKit to build with LLVM TOT
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources.make (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources.make        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/DerivedSources.make        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -144,13 +144,15 @@
</span><span class="cx"> 
</span><span class="cx"> INSPECTOR_GENERATOR_SCRIPTS = \
</span><span class="cx">         $(JavaScriptCore)/inspector/scripts/codegen/__init__.py \
</span><del>-        $(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_protocol_types_header.py \
-        $(JavaScriptCore)/inspector/scripts/codegen/generate_protocol_types_implementation.py \
</del><ins>+        $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator_templates.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_header.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py \
+        $(JavaScriptCore)/inspector/scripts/codegen/generate_js_backend_commands.py \
</ins><span class="cx">         $(JavaScriptCore)/inspector/scripts/codegen/generator_templates.py \
</span><span class="cx">         $(JavaScriptCore)/inspector/scripts/codegen/generator.py \
</span><span class="cx">         $(JavaScriptCore)/inspector/scripts/codegen/models.py \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1658,13 +1658,15 @@
</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><del>-    &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_protocol_types_header.py&quot; /&gt;
-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_protocol_types_implementation.py&quot; /&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\cpp_generator.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\cpp_generator_templates.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_backend_dispatcher_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_backend_dispatcher_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_frontend_dispatcher_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_frontend_dispatcher_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_protocol_types_header.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_protocol_types_implementation.py&quot; /&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_js_backend_commands.py&quot; /&gt;
</ins><span class="cx">     &lt;None Include=&quot;..\inspector\scripts\codegen\generator.py&quot; /&gt;
</span><span class="cx">     &lt;None Include=&quot;..\inspector\scripts\codegen\generator_templates.py&quot; /&gt;
</span><span class="cx">     &lt;None Include=&quot;..\inspector\scripts\codegen\models.py&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -4197,27 +4197,33 @@
</span><span class="cx">     &lt;None Include=&quot;..\inspector\scripts\codegen\__init__.py&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_commands.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\cpp_generator.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_header.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\cpp_generator_templates.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_backend_dispatcher_implementation.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_backend_dispatcher_header.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_header.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_backend_dispatcher_implementation.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_frontend_dispatcher_implementation.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_frontend_dispatcher_header.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_protocol_types_header.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_frontend_dispatcher_implementation.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><del>-    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_protocol_types_implementation.py&quot;&gt;
</del><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_protocol_types_header.py&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><ins>+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_cpp_protocol_types_implementation.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
+    &lt;None Include=&quot;..\inspector\scripts\codegen\generate_js_backend_commands.py&quot;&gt;
+      &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
+    &lt;/None&gt;
</ins><span class="cx">     &lt;None Include=&quot;..\inspector\scripts\codegen\generator.py&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;inspector\scripts\codegen&lt;/Filter&gt;
</span><span class="cx">     &lt;/None&gt;
</span><span class="lines">@@ -4350,4 +4356,4 @@
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/MASM&gt;
</span><span class="cx">   &lt;/ItemGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1188,18 +1188,17 @@
</span><span class="cx">                 A5EA70E719F5B1010098F5EC /* AugmentableInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70E419F5B1010098F5EC /* AugmentableInspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5EA70E819F5B1010098F5EC /* AugmentableInspectorControllerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70E519F5B1010098F5EC /* AugmentableInspectorControllerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5EA70E919F5B1010098F5EC /* AlternateDispatchableAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70E619F5B1010098F5EC /* AlternateDispatchableAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                A5EA70EC19F5B3EA0098F5EC /* generate_alternate_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70EA19F5B3D50098F5EC /* generate_alternate_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                A5EA70EC19F5B3EA0098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70EA19F5B3D50098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A5EA70EE19F5B5C40098F5EC /* JSContextRefInspectorSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70ED19F5B5C40098F5EC /* JSContextRefInspectorSupport.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                A5EA710319F6DE6F0098F5EC /* generate_objective_c_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70EF19F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710419F6DE720098F5EC /* generate_objective_c_backend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F019F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710519F6DE740098F5EC /* generate_objective_c_configuration_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F119F6DE5A0098F5EC /* generate_objective_c_configuration_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710619F6DE760098F5EC /* generate_objective_c_configuration_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F219F6DE5A0098F5EC /* generate_objective_c_configuration_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710719F6DE780098F5EC /* generate_objective_c_conversion_helpers.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F319F6DE5A0098F5EC /* generate_objective_c_conversion_helpers.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710819F6DE7A0098F5EC /* generate_objective_c_frontend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F419F6DE5A0098F5EC /* generate_objective_c_frontend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710919F6DE7C0098F5EC /* generate_objective_c_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F519F6DE5A0098F5EC /* generate_objective_c_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710A19F6DE7E0098F5EC /* generate_objective_c_internal_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F619F6DE5A0098F5EC /* generate_objective_c_internal_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710B19F6DE800098F5EC /* generate_objective_c_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F719F6DE5A0098F5EC /* generate_objective_c_types_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                A5EA710C19F6DE820098F5EC /* generate_objective_c.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F819F6DE5A0098F5EC /* generate_objective_c.py */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                A5EA710319F6DE6F0098F5EC /* generate_objc_backend_dispatcher_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70EF19F6DE5A0098F5EC /* generate_objc_backend_dispatcher_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710419F6DE720098F5EC /* generate_objc_backend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F019F6DE5A0098F5EC /* generate_objc_backend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710519F6DE740098F5EC /* generate_objc_configuration_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F119F6DE5A0098F5EC /* generate_objc_configuration_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710619F6DE760098F5EC /* generate_objc_configuration_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F219F6DE5A0098F5EC /* generate_objc_configuration_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710719F6DE780098F5EC /* generate_objc_conversion_helpers.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F319F6DE5A0098F5EC /* generate_objc_conversion_helpers.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710819F6DE7A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F419F6DE5A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710919F6DE7C0098F5EC /* generate_objc_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F519F6DE5A0098F5EC /* generate_objc_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710A19F6DE7E0098F5EC /* generate_objc_internal_header.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                A5EA710C19F6DE820098F5EC /* objc_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = A5EA70F819F6DE5A0098F5EC /* objc_generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A5EA710E19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EA710D19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5FD0067189AFE9C00633231 /* ScriptArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5FD0065189AFE9C00633231 /* ScriptArguments.cpp */; };
</span><span class="cx">                 A5FD0068189AFE9C00633231 /* ScriptArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0066189AFE9C00633231 /* ScriptArguments.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1566,16 +1565,33 @@
</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><span class="cx">                 C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CBF192844960013FBEA /* generate-inspector-protocol-bindings.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                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, ); }; };
</del><ins>+                C4703CCE192844CC0013FBEA /* generate_js_backend_commands.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CC3192844CC0013FBEA /* generate_js_backend_commands.py */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 C4703CD5192844CC0013FBEA /* generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCA192844CC0013FBEA /* generator_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C4703CD6192844CC0013FBEA /* generator.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCB192844CC0013FBEA /* generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C4703CD7192844CC0013FBEA /* models.py in Headers */ = {isa = PBXBuildFile; fileRef = C4703CCC192844CC0013FBEA /* models.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                C49FE4AB19AAC86100F40CE9 /* generate_protocol_types_header.py in Headers */ = {isa = PBXBuildFile; fileRef = C49FE4A719AAC83E00F40CE9 /* generate_protocol_types_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                C49FE4AC19AAC86100F40CE9 /* generate_protocol_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C49FE4A819AAC83E00F40CE9 /* generate_protocol_types_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                C4F4B6D91A05C76F005CAB76 /* cpp_generator_templates.py in Resources */ = {isa = PBXBuildFile; fileRef = C4F4B6CF1A05C76F005CAB76 /* cpp_generator_templates.py */; };
+                C4F4B6DA1A05C76F005CAB76 /* cpp_generator.py in Resources */ = {isa = PBXBuildFile; fileRef = C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */; };
+                C4F4B6E11A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */; };
+                C4F4B6E21A05C76F005CAB76 /* objc_generator_templates.py in Resources */ = {isa = PBXBuildFile; fileRef = C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */; };
+                C4F4B6E31A05C810005CAB76 /* __init__.py in Resources */ = {isa = PBXBuildFile; fileRef = C4703CC2192844CC0013FBEA /* __init__.py */; };
+                C4F4B6E41A05C811005CAB76 /* generate_cpp_alternate_backend_dispatcher_header.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70EA19F5B3D50098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py */; };
+                C4F4B6E61A05C811005CAB76 /* generate_objc_backend_dispatcher_header.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70EF19F6DE5A0098F5EC /* generate_objc_backend_dispatcher_header.py */; };
+                C4F4B6E71A05C811005CAB76 /* generate_objc_backend_dispatcher_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F019F6DE5A0098F5EC /* generate_objc_backend_dispatcher_implementation.py */; };
+                C4F4B6E81A05C811005CAB76 /* generate_objc_configuration_header.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F119F6DE5A0098F5EC /* generate_objc_configuration_header.py */; };
+                C4F4B6E91A05C811005CAB76 /* generate_objc_configuration_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F219F6DE5A0098F5EC /* generate_objc_configuration_implementation.py */; };
+                C4F4B6EA1A05C811005CAB76 /* generate_objc_conversion_helpers.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F319F6DE5A0098F5EC /* generate_objc_conversion_helpers.py */; };
+                C4F4B6EB1A05C811005CAB76 /* generate_objc_frontend_dispatcher_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F419F6DE5A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py */; };
+                C4F4B6EC1A05C811005CAB76 /* generate_objc_header.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F519F6DE5A0098F5EC /* generate_objc_header.py */; };
+                C4F4B6ED1A05C811005CAB76 /* generate_objc_internal_header.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */; };
+                C4F4B6EE1A05C811005CAB76 /* generator_templates.py in Resources */ = {isa = PBXBuildFile; fileRef = C4703CCA192844CC0013FBEA /* generator_templates.py */; };
+                C4F4B6EF1A05C811005CAB76 /* generator.py in Resources */ = {isa = PBXBuildFile; fileRef = C4703CCB192844CC0013FBEA /* generator.py */; };
+                C4F4B6F01A05C811005CAB76 /* models.py in Resources */ = {isa = PBXBuildFile; fileRef = C4703CCC192844CC0013FBEA /* models.py */; };
+                C4F4B6F11A05C811005CAB76 /* objc_generator.py in Resources */ = {isa = PBXBuildFile; fileRef = A5EA70F819F6DE5A0098F5EC /* objc_generator.py */; };
+                C4F4B6F21A05C8AC005CAB76 /* generate_js_backend_commands.py in Resources */ = {isa = PBXBuildFile; fileRef = C4703CC3192844CC0013FBEA /* generate_js_backend_commands.py */; };
+                C4F4B6F31A05C944005CAB76 /* cpp_generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6CF1A05C76F005CAB76 /* cpp_generator_templates.py */; };
+                C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */; };
+                C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */; };
+                C4F4B6F61A05C984005CAB76 /* objc_generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */; };
</ins><span class="cx">                 DC00039319D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h in Headers */ = {isa = PBXBuildFile; fileRef = DC00039019D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 DC00039819DBA70600023EB0 /* DFGPutLocalSinkingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC00039619DBA70600023EB0 /* DFGPutLocalSinkingPhase.cpp */; };
</span><span class="cx">                 DC00039919DBA70600023EB0 /* DFGPutLocalSinkingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = DC00039719DBA70600023EB0 /* DFGPutLocalSinkingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2871,18 +2887,17 @@
</span><span class="cx">                 A5EA70E419F5B1010098F5EC /* AugmentableInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AugmentableInspectorController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5EA70E519F5B1010098F5EC /* AugmentableInspectorControllerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AugmentableInspectorControllerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5EA70E619F5B1010098F5EC /* AlternateDispatchableAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternateDispatchableAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A5EA70EA19F5B3D50098F5EC /* generate_alternate_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_alternate_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                A5EA70EA19F5B3D50098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_alternate_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5EA70ED19F5B5C40098F5EC /* JSContextRefInspectorSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContextRefInspectorSupport.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A5EA70EF19F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F019F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_backend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F119F6DE5A0098F5EC /* generate_objective_c_configuration_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_configuration_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F219F6DE5A0098F5EC /* generate_objective_c_configuration_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_configuration_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F319F6DE5A0098F5EC /* generate_objective_c_conversion_helpers.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_conversion_helpers.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F419F6DE5A0098F5EC /* generate_objective_c_frontend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_frontend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F519F6DE5A0098F5EC /* generate_objective_c_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F619F6DE5A0098F5EC /* generate_objective_c_internal_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_internal_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F719F6DE5A0098F5EC /* generate_objective_c_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c_types_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                A5EA70F819F6DE5A0098F5EC /* generate_objective_c.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objective_c.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                A5EA70EF19F6DE5A0098F5EC /* generate_objc_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F019F6DE5A0098F5EC /* generate_objc_backend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_backend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F119F6DE5A0098F5EC /* generate_objc_configuration_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_configuration_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F219F6DE5A0098F5EC /* generate_objc_configuration_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_configuration_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F319F6DE5A0098F5EC /* generate_objc_conversion_helpers.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_conversion_helpers.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F419F6DE5A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_frontend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F519F6DE5A0098F5EC /* generate_objc_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_internal_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5EA70F819F6DE5A0098F5EC /* objc_generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = objc_generator.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5EA710D19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAlternateBackendDispatchers.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5FD0065189AFE9C00633231 /* ScriptArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArguments.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5FD0066189AFE9C00633231 /* ScriptArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArguments.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3243,16 +3258,20 @@
</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><span class="cx">                 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;; };
</span><span class="cx">                 C4703CC2192844CC0013FBEA /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                C4703CC3192844CC0013FBEA /* generate_backend_commands.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; 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; 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; 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; 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; path = generate_frontend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                C4703CC3192844CC0013FBEA /* generate_js_backend_commands.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_js_backend_commands.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 C4703CCA192844CC0013FBEA /* generator_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generator_templates.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C4703CCB192844CC0013FBEA /* generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generator.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C4703CCC192844CC0013FBEA /* models.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = models.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                C49FE4A719AAC83E00F40CE9 /* generate_protocol_types_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_protocol_types_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
-                C49FE4A819AAC83E00F40CE9 /* generate_protocol_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_protocol_types_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                C4F4B6CF1A05C76F005CAB76 /* cpp_generator_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cpp_generator_templates.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cpp_generator.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D11A05C76F005CAB76 /* generate_cpp_backend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_backend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D21A05C76F005CAB76 /* generate_cpp_backend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_backend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D31A05C76F005CAB76 /* generate_cpp_frontend_dispatcher_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_frontend_dispatcher_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D41A05C76F005CAB76 /* generate_cpp_frontend_dispatcher_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_frontend_dispatcher_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D51A05C76F005CAB76 /* generate_cpp_protocol_types_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_protocol_types_header.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D61A05C76F005CAB76 /* generate_cpp_protocol_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_cpp_protocol_types_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_protocol_types_implementation.py; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = objc_generator_templates.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">                 DC00039019D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPreciseLocalClobberize.h; path = dfg/DFGPreciseLocalClobberize.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5283,27 +5302,30 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 C4703CC2192844CC0013FBEA /* __init__.py */,
</span><del>-                                A5EA70EA19F5B3D50098F5EC /* generate_alternate_backend_dispatcher_header.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 */,
-                                A5EA70EF19F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_header.py */,
-                                A5EA70F019F6DE5A0098F5EC /* generate_objective_c_backend_dispatcher_implementation.py */,
-                                A5EA70F119F6DE5A0098F5EC /* generate_objective_c_configuration_header.py */,
-                                A5EA70F219F6DE5A0098F5EC /* generate_objective_c_configuration_implementation.py */,
-                                A5EA70F319F6DE5A0098F5EC /* generate_objective_c_conversion_helpers.py */,
-                                A5EA70F419F6DE5A0098F5EC /* generate_objective_c_frontend_dispatcher_implementation.py */,
-                                A5EA70F519F6DE5A0098F5EC /* generate_objective_c_header.py */,
-                                A5EA70F619F6DE5A0098F5EC /* generate_objective_c_internal_header.py */,
-                                A5EA70F719F6DE5A0098F5EC /* generate_objective_c_types_implementation.py */,
-                                A5EA70F819F6DE5A0098F5EC /* generate_objective_c.py */,
-                                C49FE4A719AAC83E00F40CE9 /* generate_protocol_types_header.py */,
-                                C49FE4A819AAC83E00F40CE9 /* generate_protocol_types_implementation.py */,
</del><ins>+                                C4F4B6CF1A05C76F005CAB76 /* cpp_generator_templates.py */,
+                                C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */,
+                                A5EA70EA19F5B3D50098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py */,
+                                C4F4B6D11A05C76F005CAB76 /* generate_cpp_backend_dispatcher_header.py */,
+                                C4F4B6D21A05C76F005CAB76 /* generate_cpp_backend_dispatcher_implementation.py */,
+                                C4F4B6D31A05C76F005CAB76 /* generate_cpp_frontend_dispatcher_header.py */,
+                                C4F4B6D41A05C76F005CAB76 /* generate_cpp_frontend_dispatcher_implementation.py */,
+                                C4F4B6D51A05C76F005CAB76 /* generate_cpp_protocol_types_header.py */,
+                                C4F4B6D61A05C76F005CAB76 /* generate_cpp_protocol_types_implementation.py */,
+                                C4703CC3192844CC0013FBEA /* generate_js_backend_commands.py */,
+                                A5EA70EF19F6DE5A0098F5EC /* generate_objc_backend_dispatcher_header.py */,
+                                A5EA70F019F6DE5A0098F5EC /* generate_objc_backend_dispatcher_implementation.py */,
+                                A5EA70F119F6DE5A0098F5EC /* generate_objc_configuration_header.py */,
+                                A5EA70F219F6DE5A0098F5EC /* generate_objc_configuration_implementation.py */,
+                                A5EA70F319F6DE5A0098F5EC /* generate_objc_conversion_helpers.py */,
+                                A5EA70F419F6DE5A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py */,
+                                A5EA70F519F6DE5A0098F5EC /* generate_objc_header.py */,
+                                A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */,
+                                C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */,
</ins><span class="cx">                                 C4703CCA192844CC0013FBEA /* generator_templates.py */,
</span><span class="cx">                                 C4703CCB192844CC0013FBEA /* generator.py */,
</span><span class="cx">                                 C4703CCC192844CC0013FBEA /* models.py */,
</span><ins>+                                C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */,
+                                A5EA70F819F6DE5A0098F5EC /* objc_generator.py */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = codegen;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -5353,10 +5375,8 @@
</span><span class="cx">                                 A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
</span><span class="cx">                                 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
</span><span class="cx">                                 A5EA710E19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h in Headers */,
</span><del>-                                C49FE4AB19AAC86100F40CE9 /* generate_protocol_types_header.py in Headers */,
-                                A5EA70EC19F5B3EA0098F5EC /* generate_alternate_backend_dispatcher_header.py in Headers */,
</del><ins>+                                A5EA70EC19F5B3EA0098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py in Headers */,
</ins><span class="cx">                                 6AD2CB4D19B9140100065719 /* DebuggerEvalEnabler.h in Headers */,
</span><del>-                                C49FE4AC19AAC86100F40CE9 /* generate_protocol_types_implementation.py in Headers */,
</del><span class="cx">                                 658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */,
</span><span class="cx">                                 2AD2EDFB19799E38004D6478 /* EnumerationMode.h in Headers */,
</span><span class="cx">                                 147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
</span><span class="lines">@@ -5367,25 +5387,20 @@
</span><span class="cx">                                 C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */,
</span><span class="cx">                                 A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
</span><span class="cx">                                 A5840E27187C981E00843B10 /* cssmin.py in Headers */,
</span><del>-                                C4703CD2192844CC0013FBEA /* generate_frontend_dispatcher_implementation.py in Headers */,
-                                A5EA710419F6DE720098F5EC /* generate_objective_c_backend_dispatcher_implementation.py in Headers */,
-                                C4703CD1192844CC0013FBEA /* generate_frontend_dispatcher_header.py in Headers */,
</del><ins>+                                A5EA710419F6DE720098F5EC /* generate_objc_backend_dispatcher_implementation.py in Headers */,
</ins><span class="cx">                                 C4703CD5192844CC0013FBEA /* generator_templates.py in Headers */,
</span><del>-                                A5EA710519F6DE740098F5EC /* generate_objective_c_configuration_header.py in Headers */,
-                                A5EA710619F6DE760098F5EC /* generate_objective_c_configuration_implementation.py in Headers */,
-                                A5EA710719F6DE780098F5EC /* generate_objective_c_conversion_helpers.py in Headers */,
-                                A5EA710819F6DE7A0098F5EC /* generate_objective_c_frontend_dispatcher_implementation.py in Headers */,
-                                A5EA710A19F6DE7E0098F5EC /* generate_objective_c_internal_header.py in Headers */,
-                                A5EA710B19F6DE800098F5EC /* generate_objective_c_types_implementation.py in Headers */,
-                                A5EA710C19F6DE820098F5EC /* generate_objective_c.py in Headers */,
-                                A5EA710919F6DE7C0098F5EC /* generate_objective_c_header.py in Headers */,
</del><ins>+                                A5EA710519F6DE740098F5EC /* generate_objc_configuration_header.py in Headers */,
+                                A5EA710619F6DE760098F5EC /* generate_objc_configuration_implementation.py in Headers */,
+                                A5EA710719F6DE780098F5EC /* generate_objc_conversion_helpers.py in Headers */,
+                                A5EA710819F6DE7A0098F5EC /* generate_objc_frontend_dispatcher_implementation.py in Headers */,
+                                A5EA710A19F6DE7E0098F5EC /* generate_objc_internal_header.py in Headers */,
+                                A5EA710C19F6DE820098F5EC /* objc_generator.py in Headers */,
+                                A5EA710919F6DE7C0098F5EC /* generate_objc_header.py in Headers */,
</ins><span class="cx">                                 C4703CD6192844CC0013FBEA /* generator.py in Headers */,
</span><del>-                                C4703CCF192844CC0013FBEA /* generate_backend_dispatcher_header.py in Headers */,
</del><span class="cx">                                 C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */,
</span><del>-                                C4703CD0192844CC0013FBEA /* generate_backend_dispatcher_implementation.py in Headers */,
-                                C4703CCE192844CC0013FBEA /* generate_backend_commands.py in Headers */,
</del><ins>+                                C4703CCE192844CC0013FBEA /* generate_js_backend_commands.py in Headers */,
</ins><span class="cx">                                 C4703CD7192844CC0013FBEA /* models.py in Headers */,
</span><del>-                                A5EA710319F6DE6F0098F5EC /* generate_objective_c_backend_dispatcher_header.py in Headers */,
</del><ins>+                                A5EA710319F6DE6F0098F5EC /* generate_objc_backend_dispatcher_header.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">@@ -6107,6 +6122,10 @@
</span><span class="cx">                                 A57D23EE1891B5540031C7FA /* RegularExpression.h in Headers */,
</span><span class="cx">                                 0F682FB319BCB36400FA3BAD /* DFGSSACalculator.h in Headers */,
</span><span class="cx">                                 0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */,
</span><ins>+                                C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */,
+                                C4F4B6F61A05C984005CAB76 /* objc_generator_templates.py in Headers */,
+                                C4F4B6F31A05C944005CAB76 /* cpp_generator_templates.py in Headers */,
+                                C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */,
</ins><span class="cx">                                 0F2D4DEA19832DAC007D4B19 /* TypeLocation.h in Headers */,
</span><span class="cx">                                 A5BA15E8182340B300A82E69 /* RemoteInspector.h in Headers */,
</span><span class="cx">                                 A5BA15EA182340B400A82E69 /* RemoteInspectorConstants.h in Headers */,
</span><span class="lines">@@ -6422,7 +6441,26 @@
</span><span class="cx">                         isa = PBXResourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                C4F4B6F21A05C8AC005CAB76 /* generate_js_backend_commands.py in Resources */,
</ins><span class="cx">                                 A53F1AC018C90F8F0072EB6D /* framework.sb in Resources */,
</span><ins>+                                C4F4B6E31A05C810005CAB76 /* __init__.py in Resources */,
+                                C4F4B6D91A05C76F005CAB76 /* cpp_generator_templates.py in Resources */,
+                                C4F4B6DA1A05C76F005CAB76 /* cpp_generator.py in Resources */,
+                                C4F4B6E41A05C811005CAB76 /* generate_cpp_alternate_backend_dispatcher_header.py in Resources */,
+                                C4F4B6E61A05C811005CAB76 /* generate_objc_backend_dispatcher_header.py in Resources */,
+                                C4F4B6E71A05C811005CAB76 /* generate_objc_backend_dispatcher_implementation.py in Resources */,
+                                C4F4B6E81A05C811005CAB76 /* generate_objc_configuration_header.py in Resources */,
+                                C4F4B6E91A05C811005CAB76 /* generate_objc_configuration_implementation.py in Resources */,
+                                C4F4B6EA1A05C811005CAB76 /* generate_objc_conversion_helpers.py in Resources */,
+                                C4F4B6EB1A05C811005CAB76 /* generate_objc_frontend_dispatcher_implementation.py in Resources */,
+                                C4F4B6EC1A05C811005CAB76 /* generate_objc_header.py in Resources */,
+                                C4F4B6ED1A05C811005CAB76 /* generate_objc_internal_header.py in Resources */,
+                                C4F4B6E11A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py in Resources */,
+                                C4F4B6EE1A05C811005CAB76 /* generator_templates.py in Resources */,
+                                C4F4B6EF1A05C811005CAB76 /* generator.py in Resources */,
+                                C4F4B6F01A05C811005CAB76 /* models.py in Resources */,
+                                C4F4B6E21A05C76F005CAB76 /* objc_generator_templates.py in Resources */,
+                                C4F4B6F11A05C811005CAB76 /* objc_generator.py in Resources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegen__init__py"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/__init__.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -2,21 +2,23 @@
</span><span class="cx"> 
</span><span class="cx"> from models import *
</span><span class="cx"> from generator import *
</span><ins>+from cpp_generator import *
+from objc_generator import *
</ins><span class="cx"> 
</span><del>-from generate_alternate_backend_dispatcher_header 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_objective_c_backend_dispatcher_header import *
-from generate_objective_c_backend_dispatcher_implementation import *
-from generate_objective_c_configuration_header import *
-from generate_objective_c_configuration_implementation import *
-from generate_objective_c_conversion_helpers import *
-from generate_objective_c_frontend_dispatcher_implementation import *
-from generate_objective_c_header import *
-from generate_objective_c_internal_header import *
-from generate_objective_c_types_implementation import *
-from generate_protocol_types_header import *
-from generate_protocol_types_implementation import *
</del><ins>+from generate_cpp_alternate_backend_dispatcher_header import *
+from generate_cpp_backend_dispatcher_header import *
+from generate_cpp_backend_dispatcher_implementation import *
+from generate_cpp_frontend_dispatcher_header import *
+from generate_cpp_frontend_dispatcher_implementation import *
+from generate_cpp_protocol_types_header import *
+from generate_cpp_protocol_types_implementation import *
+from generate_js_backend_commands import *
+from generate_objc_backend_dispatcher_header import *
+from generate_objc_backend_dispatcher_implementation import *
+from generate_objc_configuration_header import *
+from generate_objc_configuration_implementation import *
+from generate_objc_conversion_helpers import *
+from generate_objc_frontend_dispatcher_implementation import *
+from generate_objc_header import *
+from generate_objc_internal_header import *
+from generate_objc_protocol_types_implementation import *
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegencpp_generatorpy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,301 @@
</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 generator import ucfirst
+from models import PrimitiveType, ObjectType, ArrayType, EnumType, AliasedType, Frameworks
+
+log = logging.getLogger('global')
+
+_PRIMITIVE_TO_CPP_NAME_MAP = {
+    'boolean': 'bool',
+    'integer': 'int',
+    'number': 'double',
+    'string': 'String',
+    'object': 'Inspector::InspectorObject',
+    'any': 'Inspector::InspectorValue'
+}
+
+# This class contains extra static methods used for generation, but does
+# not participate in any inheritance hierarchy. File generators should
+# extend the generic &quot;Generator&quot; class instead.
+class CppGenerator:
+
+    # Miscellaneous text manipulation routines.
+    @staticmethod
+    def cpp_getter_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 'getInteger'
+            elif _type.raw_name() is 'number':
+                return 'getDouble'
+            elif _type.raw_name() is 'any':
+                return 'getValue'
+            else:
+                return 'get' + ucfirst(_type.raw_name())
+        if isinstance(_type, AliasedType):
+            return CppGenerator.cpp_getter_method_for_type(_type.aliased_type)
+        if isinstance(_type, EnumType):
+            return CppGenerator.cpp_getter_method_for_type(_type.primitive_type)
+
+    @staticmethod
+    def cpp_setter_method_for_type(_type):
+        if isinstance(_type, ObjectType):
+            return 'setObject'
+        if isinstance(_type, ArrayType):
+            return 'setArray'
+        if isinstance(_type, PrimitiveType):
+            if _type.raw_name() is 'integer':
+                return 'setInteger'
+            elif _type.raw_name() is 'number':
+                return 'setDouble'
+            elif _type.raw_name() is 'any':
+                return 'setValue'
+            else:
+                return 'set' + ucfirst(_type.raw_name())
+        if isinstance(_type, AliasedType):
+            return CppGenerator.cpp_setter_method_for_type(_type.aliased_type)
+        if isinstance(_type, EnumType):
+            return CppGenerator.cpp_setter_method_for_type(_type.primitive_type)
+
+    # Generate type representations for various situations.
+    @staticmethod
+    def cpp_protocol_type_for_type(_type):
+        if isinstance(_type, ObjectType) and len(_type.members) == 0:
+            return 'Inspector::InspectorObject'
+        if isinstance(_type, (ObjectType, AliasedType, EnumType)):
+            return 'Inspector::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+        if isinstance(_type, ArrayType):
+            return 'Inspector::Protocol::Array&lt;%s&gt;' % CppGenerator.cpp_protocol_type_for_type(_type.element_type)
+        if isinstance(_type, PrimitiveType):
+            return CppGenerator.cpp_name_for_primitive_type(_type)
+
+    @staticmethod
+    def cpp_protocol_type_for_type_member(type_member, object_declaration):
+        if isinstance(type_member.type, EnumType) and type_member.type.is_anonymous:
+            return '::'.join([CppGenerator.cpp_protocol_type_for_type(object_declaration.type), ucfirst(type_member.member_name)])
+        else:
+            return CppGenerator.cpp_protocol_type_for_type(type_member.type)
+
+    @staticmethod
+    def cpp_type_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 = CppGenerator.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 cpp_type_for_checked_formal_event_parameter(parameter):
+        return CppGenerator.cpp_type_for_type_with_name(parameter.type, parameter.parameter_name, parameter.is_optional)
+
+    @staticmethod
+    def cpp_type_for_type_member(member):
+        return CppGenerator.cpp_type_for_type_with_name(member.type, member.member_name, False)
+
+    @staticmethod
+    def cpp_type_for_type_with_name(_type, type_name, is_optional):
+        if isinstance(_type, (ArrayType, ObjectType)):
+            return 'PassRefPtr&lt;%s&gt;' % CppGenerator.cpp_protocol_type_for_type(_type)
+        if isinstance(_type, AliasedType):
+            builder_type = CppGenerator.cpp_protocol_type_for_type(_type)
+            if is_optional:
+                return 'const %s* const' % builder_type
+            elif _type.aliased_type.qualified_name() in ['integer', 'number']:
+                return CppGenerator.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 = CppGenerator.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::Protocol::%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 cpp_type_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;' % CppGenerator.cpp_protocol_type_for_type(_type)
+        if isinstance(_type, PrimitiveType):
+            cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::Protocol::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::Protocol::%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 cpp_type_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;' % CppGenerator.cpp_protocol_type_for_type(_type)
+        if isinstance(_type, PrimitiveType):
+            cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::Protocol::OptOutput&lt;%s&gt;*&quot; % cpp_name
+            elif _type.qualified_name() in ['integer', 'number']:
+                return CppGenerator.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 cpp_type_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 = CppGenerator.cpp_name_for_primitive_type(_type)
+            if _type.qualified_name() in ['any', 'object']:
+                return &quot;RefPtr&lt;%s&gt;&quot; % CppGenerator.cpp_name_for_primitive_type(_type)
+            elif parameter.is_optional and _type.qualified_name() not in ['boolean', 'string', 'integer']:
+                return &quot;Inspector::Protocol::OptOutput&lt;%s&gt;&quot; % cpp_name
+            else:
+                return cpp_name
+
+    @staticmethod
+    def cpp_type_for_stack_out_parameter(parameter):
+        _type = parameter.type
+        if isinstance(_type, (ArrayType, ObjectType)):
+            return 'RefPtr&lt;%s&gt;' % CppGenerator.cpp_protocol_type_for_type(_type)
+        if isinstance(_type, AliasedType):
+            builder_type = CppGenerator.cpp_protocol_type_for_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::Protocol::OptOutput&lt;%s&gt;&quot; % builder_type
+            return '%s' % builder_type
+        if isinstance(_type, PrimitiveType):
+            cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
+            if parameter.is_optional:
+                return &quot;Inspector::Protocol::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::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+
+    @staticmethod
+    def cpp_assertion_method_for_type_member(type_member, object_declaration):
+
+        def assertion_method_for_type(_type):
+            return 'BindingTraits&lt;%s&gt;::assertValueHasExpectedType' % CppGenerator.cpp_protocol_type_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' % CppGenerator.cpp_protocol_type_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())
+
+    # 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="trunkSourceJavaScriptCoreinspectorscriptscodegencpp_generator_templatespyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerator_templatespy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,276 @@
</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 CppGeneratorTemplates:
+
+    HeaderPrelude = (
+    &quot;&quot;&quot;#ifndef ${headerGuardString}
+#define ${headerGuardString}
+
+#if ENABLE(INSPECTOR)
+
+${includes}
+
+namespace Inspector {
+
+${typedefs}&quot;&quot;&quot;)
+
+    HeaderPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(${headerGuardString})&quot;&quot;&quot;)
+
+    ImplementationPrelude = (
+    &quot;&quot;&quot;#include &quot;config.h&quot;
+#include ${primaryInclude}
+
+#if ENABLE(INSPECTOR)
+
+${secondaryIncludes}
+
+namespace Inspector {&quot;&quot;&quot;)
+
+    ImplementationPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+&quot;&quot;&quot;)
+
+    AlternateDispatchersHeaderPrelude = (
+    &quot;&quot;&quot;#ifndef ${headerGuardString}
+#define ${headerGuardString}
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+${includes}
+
+namespace Inspector {
+
+class AlternateInspectorBackendDispatcher {
+public:
+    void setBackendDispatcher(PassRefPtr&lt;InspectorBackendDispatcher&gt; dispatcher) { m_backendDispatcher = dispatcher; }
+    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
+private:
+    RefPtr&lt;InspectorBackendDispatcher&gt; m_backendDispatcher;
+};
+&quot;&quot;&quot;)
+
+    AlternateDispatchersHeaderPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+#endif // !defined(${headerGuardString})&quot;&quot;&quot;)
+
+    AlternateBackendDispatcherHeaderDomainHandlerInterfaceDeclaration = (
+    &quot;&quot;&quot;class AlternateInspector${domainName}BackendDispatcher : public AlternateInspectorBackendDispatcher {
+public:
+    virtual ~AlternateInspector${domainName}BackendDispatcher() { }
+${commandDeclarations}
+};&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;
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+public:
+    void setAlternateDispatcher(AlternateInspector${domainName}BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+private:
+    AlternateInspector${domainName}BackendDispatcher* m_alternateDispatcher;
+#endif
+};&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderAsyncCommandDeclaration = (
+    &quot;&quot;&quot;    ${classAndExportMacro} ${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, makeString('\\'', &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, makeString('\\'', &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)
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    , m_alternateDispatcher(nullptr)
+#endif
+{
+    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;)
+
+    ProtocolObjectBuilderDeclarationPrelude = (
+&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;)
+
+    ProtocolObjectBuilderDeclarationPostlude = (
+&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::Protocol::StructItemTraits ItemTraits;&quot;&quot;&quot;)
+
+    ProtocolObjectRuntimeCast = (
+&quot;&quot;&quot;PassRefPtr&lt;${objectType}&gt; BindingTraits&lt;${objectType}&gt;::runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
+{
+    RefPtr&lt;Inspector::InspectorObject&gt; result;
+    bool castSucceeded = value-&gt;asObject(result);
+    ASSERT_UNUSED(castSucceeded, castSucceeded);
+#if !ASSERT_DISABLED
+    BindingTraits&lt;${objectType}&gt;::assertValueHasExpectedType(result.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;(result.get()));
+}
+&quot;&quot;&quot;)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_alternate_backend_dispatcher_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-#!/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
-import re
-from string import Template
-
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-
-log = logging.getLogger('global')
-
-
-class AlternateBackendDispatcherHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return 'InspectorAlternateBackendDispatchers.h'
-
-    def generate_output(self):
-        headers = [
-            '&quot;InspectorProtocolTypes.h&quot;',
-            '&lt;JavaScriptCore/InspectorBackendDispatcher.h&gt;',
-        ]
-
-        header_args = {
-            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
-            'includes': '\n'.join(['#include ' + header for header in headers]),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.AlternateDispatchersHeaderPrelude).substitute(None, **header_args))
-        sections.append('\n'.join(filter(None, map(self._generate_handler_declarations_for_domain, domains))))
-        sections.append(Template(Templates.AlternateDispatchersHeaderPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_handler_declarations_for_domain(self, domain):
-        if not domain.commands:
-            return ''
-
-        command_declarations = []
-        for command in domain.commands:
-            command_declarations.append(self._generate_handler_declaration_for_command(command))
-
-        handler_args = {
-            'domainName': domain.domain_name,
-            'commandDeclarations': '\n'.join(command_declarations),
-        }
-
-        return self.wrap_with_guard_for_domain(domain, Template(Templates.AlternateBackendDispatcherHeaderDomainHandlerInterfaceDeclaration).substitute(None, **handler_args))
-
-    def _generate_handler_declaration_for_command(self, command):
-        lines = []
-        parameters = ['long callId']
-        for _parameter in command.call_parameters:
-            parameters.append('%s in_%s' % (Generator.type_string_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
-
-        command_args = {
-            'commandName': command.command_name,
-            'parameters': ', '.join(parameters),
-        }
-        lines.append('    virtual void %(commandName)s(%(parameters)s) = 0;' % command_args)
-        return '\n'.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_commandspy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-#!/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;InspectorBackendCommands.js&quot;
-
-    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)
-
-        def is_anonymous_enum_param(param):
-            return isinstance(param.type, EnumType) and param.type.is_anonymous
-
-        for event in domain.events:
-            for param in filter(is_anonymous_enum_param, event.event_parameters):
-                enum_args = {
-                    'domain': domain.domain_name,
-                    'enumName': '%s%s' % (ucfirst(event.event_name), ucfirst(param.parameter_name)),
-                    'enumMap': &quot;, &quot;.join(['%s: &quot;%s&quot;' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in param.type.enum_values()])
-                }
-                lines.append('InspectorBackend.registerEnum(&quot;%(domain)s.%(enumName)s&quot;, {%(enumMap)s});' % enum_args)
-
-            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)
-
-        if domain.commands or domain.events:
-            activate_args = {
-                'domain': domain.domain_name,
-                'availability': domain.availability,
-            }
-            if domain.availability:
-                lines.append('InspectorBackend.activateDomain(&quot;%(domain)s&quot;, &quot;%(availability)s&quot;);' % activate_args)
-            else:
-                lines.append('InspectorBackend.activateDomain(&quot;%(domain)s&quot;);' % activate_args)
-
-        return &quot;\n&quot;.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,200 +0,0 @@
</span><del>-#!/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;InspectorBackendDispatchers.h&quot;
-
-    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;InspectorProtocolObjects.h&quot;',
-            '&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]),
-        }
-
-        domains = self.domains_to_generate()
-
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.CppHeaderPrelude).substitute(None, **header_args))
-        sections.append(self._generate_alternate_handler_forward_declarations_for_domains(domains))
-        sections.extend(map(self._generate_handler_declarations_for_domain, domains))
-        sections.extend(map(self._generate_dispatcher_declarations_for_domain, domains))
-        sections.append(Template(Templates.CppHeaderPostlude).substitute(None, **header_args))
-        return &quot;\n\n&quot;.join(sections)
-
-    # Private methods.
-
-    def _generate_alternate_handler_forward_declarations_for_domains(self, domains):
-        if not domains:
-            return ''
-
-        lines = []
-        lines.append('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
-        for domain in domains:
-            lines.append(self.wrap_with_guard_for_domain(domain, 'class AlternateInspector%sBackendDispatcher;' % domain.domain_name))
-        lines.append('#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
-        return '\n'.join(lines)
-
-    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 self.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&amp;']
-        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&amp;']
-        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))
-
-        class_components = ['class']
-        export_macro = self.model().framework.setting('export_macro', None)
-        if export_macro:
-            class_components.append(export_macro)
-
-        command_args = {
-            'classAndExportMacro': ' '.join(class_components),
-            '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 self.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
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,286 +0,0 @@
</span><del>-#!/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;InspectorBackendDispatchers.cpp&quot;
-
-    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;']
-
-        secondary_includes = ['#include %s' % header for header in secondary_headers]
-        secondary_includes.append('')
-        secondary_includes.append('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
-        secondary_includes.append('#include &quot;InspectorAlternateBackendDispatchers.h&quot;')
-        secondary_includes.append('#endif')
-
-        header_args = {
-            'primaryInclude': '&quot;InspectorBackendDispatchers.h&quot;',
-            'secondaryIncludes': '\n'.join(secondary_includes),
-        }
-
-        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 self.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 self.wrap_with_guard_for_domain(domain, '\n\n'.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 = {
-                '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::Protocol::getEnumConstantValue(%(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 = []
-        alternate_dispatcher_method_parameters = ['callId']
-        method_parameters = ['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:
-                optional_in_parameter_string = '%(parameterName)s_valueFound ? &amp;in_%(parameterName)s : nullptr' % param_args
-                alternate_dispatcher_method_parameters.append(optional_in_parameter_string)
-                method_parameters.append(optional_in_parameter_string)
-            else:
-                alternate_dispatcher_method_parameters.append('in_' + parameter.parameter_name)
-                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),
-
-                }
-
-                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::Protocol::getEnumConstantValue(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': '\n'.join(in_parameter_declarations),
-            'invocationParameters': ', '.join(method_parameters),
-            'alternateInvocationParameters': ', '.join(alternate_dispatcher_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('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
-        lines.append('    if (m_alternateDispatcher) {')
-        lines.append('        m_alternateDispatcher-&gt;%(commandName)s(%(alternateInvocationParameters)s);' % command_args)
-        lines.append('        return;')
-        lines.append('    }')
-        lines.append('#endif')
-        lines.append('')
-
-        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)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_alternate_backend_dispatcher_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_alternate_backend_dispatcher_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,92 @@
</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
+import re
+from string import Template
+
+from cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator
+
+log = logging.getLogger('global')
+
+
+class CppAlternateBackendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return 'InspectorAlternateBackendDispatchers.h'
+
+    def generate_output(self):
+        headers = [
+            '&quot;InspectorProtocolTypes.h&quot;',
+            '&lt;JavaScriptCore/InspectorBackendDispatcher.h&gt;',
+        ]
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in headers]),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.AlternateDispatchersHeaderPrelude).substitute(None, **header_args))
+        sections.append('\n'.join(filter(None, map(self._generate_handler_declarations_for_domain, domains))))
+        sections.append(Template(CppTemplates.AlternateDispatchersHeaderPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_handler_declarations_for_domain(self, domain):
+        if not domain.commands:
+            return ''
+
+        command_declarations = []
+        for command in domain.commands:
+            command_declarations.append(self._generate_handler_declaration_for_command(command))
+
+        handler_args = {
+            'domainName': domain.domain_name,
+            'commandDeclarations': '\n'.join(command_declarations),
+        }
+
+        return self.wrap_with_guard_for_domain(domain, Template(CppTemplates.AlternateBackendDispatcherHeaderDomainHandlerInterfaceDeclaration).substitute(None, **handler_args))
+
+    def _generate_handler_declaration_for_command(self, command):
+        lines = []
+        parameters = ['long callId']
+        for _parameter in command.call_parameters:
+            parameters.append('%s in_%s' % (CppGenerator.cpp_type_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
+
+        command_args = {
+            'commandName': command.command_name,
+            'parameters': ', '.join(parameters),
+        }
+        lines.append('    virtual void %(commandName)s(%(parameters)s) = 0;' % command_args)
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_cpp_backend_dispatcher_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,201 @@
</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 cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import EnumType
+
+log = logging.getLogger('global')
+
+
+class CppBackendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorBackendDispatchers.h&quot;
+
+    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;InspectorProtocolObjects.h&quot;',
+            '&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]),
+        }
+
+        domains = self.domains_to_generate()
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.HeaderPrelude).substitute(None, **header_args))
+        sections.append(self._generate_alternate_handler_forward_declarations_for_domains(domains))
+        sections.extend(map(self._generate_handler_declarations_for_domain, domains))
+        sections.extend(map(self._generate_dispatcher_declarations_for_domain, domains))
+        sections.append(Template(CppTemplates.HeaderPostlude).substitute(None, **header_args))
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_alternate_handler_forward_declarations_for_domains(self, domains):
+        if not domains:
+            return ''
+
+        lines = []
+        lines.append('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
+        for domain in domains:
+            lines.append(self.wrap_with_guard_for_domain(domain, 'class AlternateInspector%sBackendDispatcher;' % domain.domain_name))
+        lines.append('#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
+        return '\n'.join(lines)
+
+    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 self.wrap_with_guard_for_domain(domain, Template(CppTemplates.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&amp;']
+        for _parameter in command.call_parameters:
+            parameters.append(&quot;%s in_%s&quot; % (CppGenerator.cpp_type_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; % (CppGenerator.cpp_type_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&amp;']
+        for _parameter in command.call_parameters:
+            in_parameters.append(&quot;%s in_%s&quot; % (CppGenerator.cpp_type_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; % (CppGenerator.cpp_type_for_formal_async_parameter(_parameter), _parameter.parameter_name))
+
+        class_components = ['class']
+        export_macro = self.model().framework.setting('export_macro', None)
+        if export_macro:
+            class_components.append(export_macro)
+
+        command_args = {
+            'classAndExportMacro': ' '.join(class_components),
+            'callbackName': callbackName,
+            'commandName': command.command_name,
+            'inParameters': &quot;, &quot;.join(in_parameters),
+            'outParameters': &quot;, &quot;.join(out_parameters),
+        }
+
+        return Template(CppTemplates.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 self.wrap_with_guard_for_domain(domain, Template(CppTemplates.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_cpp_backend_dispatcher_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_dispatcher_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,287 @@
</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 cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import ObjectType, ArrayType
+
+log = logging.getLogger('global')
+
+
+class CppBackendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorBackendDispatchers.cpp&quot;
+
+    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;']
+
+        secondary_includes = ['#include %s' % header for header in secondary_headers]
+        secondary_includes.append('')
+        secondary_includes.append('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
+        secondary_includes.append('#include &quot;InspectorAlternateBackendDispatchers.h&quot;')
+        secondary_includes.append('#endif')
+
+        header_args = {
+            'primaryInclude': '&quot;InspectorBackendDispatchers.h&quot;',
+            'secondaryIncludes': '\n'.join(secondary_includes),
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.ImplementationPrelude).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(CppTemplates.ImplementationPostlude).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 self.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(CppTemplates.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 self.wrap_with_guard_for_domain(domain, '\n\n'.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(CppTemplates.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(CppTemplates.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 = {
+                'keyedSetMethod': CppGenerator.cpp_setter_method_for_type(parameter.type),
+                'parameterName': parameter.parameter_name,
+                'parameterType': CppGenerator.cpp_type_for_stack_in_parameter(parameter),
+            }
+
+            formal_parameters.append('%s %s' % (CppGenerator.cpp_type_for_formal_async_parameter(parameter), parameter.parameter_name))
+
+            if parameter.is_optional:
+                if CppGenerator.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::Protocol::getEnumConstantValue(%(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(CppTemplates.BackendDispatcherImplementationAsyncCommand).substitute(None, **async_args)
+
+    def _generate_dispatcher_implementation_for_command(self, command, domain):
+        in_parameter_declarations = []
+        out_parameter_declarations = []
+        out_parameter_assignments = []
+        alternate_dispatcher_method_parameters = ['callId']
+        method_parameters = ['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': CppGenerator.cpp_type_for_stack_in_parameter(parameter),
+                'parameterName': parameter.parameter_name,
+                'keyedGetMethod': CppGenerator.cpp_getter_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:
+                optional_in_parameter_string = '%(parameterName)s_valueFound ? &amp;in_%(parameterName)s : nullptr' % param_args
+                alternate_dispatcher_method_parameters.append(optional_in_parameter_string)
+                method_parameters.append(optional_in_parameter_string)
+            else:
+                alternate_dispatcher_method_parameters.append('in_' + parameter.parameter_name)
+                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': CppGenerator.cpp_type_for_stack_out_parameter(parameter),
+                    'parameterName': parameter.parameter_name,
+                    'keyedSetMethod': CppGenerator.cpp_setter_method_for_type(parameter.type),
+
+                }
+
+                out_parameter_declarations.append('    %(parameterType)s out_%(parameterName)s;' % param_args)
+                if parameter.is_optional:
+                    if CppGenerator.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::Protocol::getEnumConstantValue(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 CppGenerator.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': '\n'.join(in_parameter_declarations),
+            'invocationParameters': ', '.join(method_parameters),
+            'alternateInvocationParameters': ', '.join(alternate_dispatcher_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(CppTemplates.BackendDispatcherImplementationPrepareCommandArguments).substitute(None, **command_args))
+
+        lines.append('#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)')
+        lines.append('    if (m_alternateDispatcher) {')
+        lines.append('        m_alternateDispatcher-&gt;%(commandName)s(%(alternateInvocationParameters)s);' % command_args)
+        lines.append('        return;')
+        lines.append('    }')
+        lines.append('#endif')
+        lines.append('')
+
+        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_cpp_frontend_dispatcher_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</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 cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import EnumType
+
+log = logging.getLogger('global')
+
+
+class CppFrontendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorFrontendDispatchers.h&quot;
+
+    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;InspectorProtocolObjects.h&quot;',
+            '&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': '',
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.HeaderPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_dispatcher_declarations_for_domain, self.domains_to_generate()))
+        sections.append(Template(CppTemplates.HeaderPostlude).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 self.wrap_with_guard_for_domain(domain, Template(CppTemplates.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' % (CppGenerator.cpp_type_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_cpp_frontend_dispatcher_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,121 @@
</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 cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import ObjectType, ArrayType
+
+log = logging.getLogger('global')
+
+
+class CppFrontendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorFrontendDispatchers.cpp&quot;
+
+    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;InspectorFrontendDispatchers.h&quot;',
+            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.ImplementationPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_dispatcher_implementations_for_domain, self.domains_to_generate()))
+        sections.append(Template(CppTemplates.ImplementationPostlude).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 self.wrap_with_guard_for_domain(domain, '\n\n'.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 CppGenerator.should_pass_by_copy_for_return_type(parameter.type):
+                parameter_value = '*' + parameter_value
+            if parameter.type.is_enum():
+                parameter_value = 'Inspector::Protocol::getEnumConstantValue(%s)' % parameter_value
+
+            parameter_args = {
+                'parameterType': CppGenerator.cpp_type_for_stack_out_parameter(parameter),
+                'parameterName': parameter.parameter_name,
+                'parameterValue': parameter_value,
+                'keyedSetMethod': CppGenerator.cpp_setter_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' % (CppGenerator.cpp_type_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_cpp_protocol_types_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,341 @@
</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 cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import EnumType, ObjectType, PrimitiveType, AliasedType, ArrayType, Frameworks
+
+log = logging.getLogger('global')
+
+
+class CppProtocolTypesHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorProtocolObjects.h&quot;
+
+    def generate_output(self):
+        domains = self.domains_to_generate()
+        self.calculate_types_requiring_shape_assertions(domains)
+
+        headers = set([
+            '&lt;inspector/InspectorProtocolTypes.h&gt;',
+            '&lt;wtf/Assertions.h&gt;',
+            '&lt;wtf/PassRefPtr.h&gt;'
+        ])
+
+        export_macro = self.model().framework.setting('export_macro', None)
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in sorted(headers)]),
+            'typedefs': '',
+        }
+
+        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(CppTemplates.HeaderPrelude).substitute(None, **header_args))
+        sections.append('namespace Protocol {')
+        sections.append(self._generate_forward_declarations(domains))
+        sections.append(self._generate_typedefs(domains))
+        sections.append('%s getEnumConstantValue(int code);' % ' '.join(return_type_with_export_macro))
+        sections.append('\n'.join([
+            'template&lt;typename T&gt; %s getEnumConstantValue(T enumValue)' % return_type,
+            '{',
+            '    return getEnumConstantValue(static_cast&lt;int&gt;(enumValue));',
+            '}']))
+
+        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 Protocol')
+        sections.append(Template(CppTemplates.HeaderPostlude).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(self.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 = CppGenerator.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 self.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 self.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(CppTemplates.ProtocolObjectBuilderDeclarationPrelude).substitute(None, **builder_args))
+        for type_member in required_members:
+            lines.append(self._generate_builder_setter_for_member(type_member, domain))
+        lines.append(Template(CppTemplates.ProtocolObjectBuilderDeclarationPostlude).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:
+                export_macro = self.model().framework.setting('export_macro', None)
+                lines.append('    %s static const char* %s;' % (export_macro, 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),
+            'keyedSet': CppGenerator.cpp_setter_method_for_type(type_member.type),
+            'name': type_member.member_name,
+            'parameterType': CppGenerator.cpp_type_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::Protocol::getEnumConstantValue(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),
+            'keyedSet': CppGenerator.cpp_setter_method_for_type(type_member.type),
+            'name': type_member.member_name,
+            'parameterType': CppGenerator.cpp_type_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::Protocol::getEnumConstantValue(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((CppGenerator.cpp_protocol_type_for_type_member(type_member, type_declaration), False))
+
+                if isinstance(type_declaration.type, ObjectType):
+                    type_arguments.append((CppGenerator.cpp_protocol_type_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_cpp_protocol_types_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</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 string
+from string import Template
+
+from cpp_generator import CppGenerator
+from cpp_generator_templates import CppGeneratorTemplates as CppTemplates
+from generator import Generator, ucfirst
+from models import AliasedType, ArrayType, EnumType, ObjectType
+
+log = logging.getLogger('global')
+
+
+class CppProtocolTypesImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorProtocolObjects.cpp&quot;
+
+    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;InspectorProtocolObjects.h&quot;',
+            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
+        }
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(CppTemplates.ImplementationPrelude).substitute(None, **header_args))
+        sections.append('namespace Protocol {')
+        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 Protocol')
+        sections.append(Template(CppTemplates.ImplementationPostlude).substitute(None, **header_args))
+
+        return &quot;\n\n&quot;.join(sections)
+
+    # Private methods.
+
+    def _generate_enum_mapping(self):
+        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 getEnumConstantValue(int code) {')
+        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', 'Protocol', 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': CppGenerator.cpp_protocol_type_for_type(object_declaration.type)
+        }
+        return Template(CppTemplates.ProtocolObjectRuntimeCast).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)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
+        lines.append(&quot;&quot;&quot;{
+    RefPtr&lt;InspectorObject&gt; object;
+    bool castSucceeded = value-&gt;asObject(object);
+    ASSERT_UNUSED(castSucceeded, castSucceeded);&quot;&quot;&quot;)
+        for type_member in required_members:
+            args = {
+                'memberName': type_member.member_name,
+                'assertMethod': CppGenerator.cpp_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': CppGenerator.cpp_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)' % CppGenerator.cpp_assertion_method_for_type_member(enum_member, object_declaration))
+        lines.append('{')
+        lines.append('    String result;')
+        lines.append('    bool castSucceeded = value-&gt;asString(result);')
+        lines.append('    ASSERT(castSucceeded);')
+
+        assert_condition = ' || '.join(['result == &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="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,117 +0,0 @@
</span><del>-#!/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;InspectorFrontendDispatchers.h&quot;
-
-    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;InspectorProtocolObjects.h&quot;',
-            '&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': '',
-        }
-
-        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 self.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)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_frontend_dispatcher_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-#!/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;InspectorFrontendDispatchers.cpp&quot;
-
-    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;InspectorFrontendDispatchers.h&quot;',
-            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
-        }
-
-        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 self.wrap_with_guard_for_domain(domain, '\n\n'.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():
-                parameter_value = 'Inspector::Protocol::getEnumConstantValue(%s)' % 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)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_js_backend_commandspyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_backend_commandspy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,137 @@
</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 JSBackendCommandsGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return &quot;InspectorBackendCommands.js&quot;
+
+    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)
+
+        def is_anonymous_enum_param(param):
+            return isinstance(param.type, EnumType) and param.type.is_anonymous
+
+        for event in domain.events:
+            for param in filter(is_anonymous_enum_param, event.event_parameters):
+                enum_args = {
+                    'domain': domain.domain_name,
+                    'enumName': '%s%s' % (ucfirst(event.event_name), ucfirst(param.parameter_name)),
+                    'enumMap': &quot;, &quot;.join(['%s: &quot;%s&quot;' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in param.type.enum_values()])
+                }
+                lines.append('InspectorBackend.registerEnum(&quot;%(domain)s.%(enumName)s&quot;, {%(enumMap)s});' % enum_args)
+
+            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)
+
+        if domain.commands or domain.events:
+            activate_args = {
+                'domain': domain.domain_name,
+                'availability': domain.availability,
+            }
+            if domain.availability:
+                lines.append('InspectorBackend.activateDomain(&quot;%(domain)s&quot;, &quot;%(availability)s&quot;);' % activate_args)
+            else:
+                lines.append('InspectorBackend.activateDomain(&quot;%(domain)s&quot;);' % activate_args)
+
+        return &quot;\n&quot;.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_backend_dispatcher_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,109 @@
</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
+import re
+from string import Template
+
+from cpp_generator import CppGenerator
+from generator import Generator
+from models import Frameworks
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCBackendDispatcherHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sBackendDispatchers.h' % ObjCGenerator.OBJC_PREFIX
+
+    def domains_to_generate(self):
+        return filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        headers = [
+            '&lt;JavaScriptCore/InspectorAlternateBackendDispatchers.h&gt;',
+            '&lt;wtf/RetainPtr.h&gt;',
+        ]
+
+        header_args = {
+            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
+            'includes': '\n'.join(['#include ' + header for header in headers]),
+            'forwardDeclarations': self._generate_objc_forward_declarations(),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.BackendDispatcherHeaderPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_objc_handler_declarations_for_domain, domains))
+        sections.append(Template(ObjCTemplates.BackendDispatcherHeaderPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_objc_forward_declarations(self):
+        lines = ['@protocol %s%sDomainHandler;' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name) for domain in self.domains_to_generate()]
+        return '\n'.join(lines)
+
+    def _generate_objc_forward_declarations_for_domains(self, domains):
+        lines = []
+        for domain in domains:
+            lines.append('@class %s%sDomainHandler;' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name))
+        return '\n'.join(lines)
+
+    def _generate_objc_handler_declarations_for_domain(self, domain):
+        if not domain.commands:
+            return ''
+
+        command_declarations = []
+        for command in domain.commands:
+            command_declarations.append(self._generate_objc_handler_declaration_for_command(command))
+
+        handler_args = {
+            'domainName': domain.domain_name,
+            'commandDeclarations': '\n'.join(command_declarations),
+            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
+        }
+
+        return self.wrap_with_guard_for_domain(domain, Template(ObjCTemplates.BackendDispatcherHeaderDomainHandlerObjCDeclaration).substitute(None, **handler_args))
+
+    def _generate_objc_handler_declaration_for_command(self, command):
+        lines = []
+        parameters = ['long callId']
+        for _parameter in command.call_parameters:
+            parameters.append('%s in_%s' % (CppGenerator.cpp_type_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
+
+        command_args = {
+            'commandName': command.command_name,
+            'parameters': ', '.join(parameters),
+        }
+        lines.append('    virtual void %(commandName)s(%(parameters)s) override;' % command_args)
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_backend_dispatcher_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,177 @@
</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
+import re
+from string import Template
+
+from cpp_generator import CppGenerator
+from generator import Generator
+from models import Frameworks
+from objc_generator import ObjCTypeCategory, ObjCGenerator, join_type_and_name
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCConfigurationImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sBackendDispatchers.mm' % ObjCGenerator.OBJC_PREFIX
+
+    def domains_to_generate(self):
+        return filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        secondary_headers = [
+            '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&lt;JavaScriptCore/InspectorFrontendChannel.h&gt;',
+            '&lt;JavaScriptCore/InspectorValues.h&gt;',
+        ]
+
+        header_args = {
+            'primaryInclude': '&quot;%sBackendDispatchers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            'secondaryIncludes': '\n'.join(['#include %s' % header for header in secondary_headers]),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.BackendDispatcherImplementationPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_handler_implementation_for_domain, domains))
+        sections.append(Template(ObjCTemplates.BackendDispatcherImplementationPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_handler_implementation_for_domain(self, domain):
+        if not domain.commands:
+            return ''
+
+        command_declarations = []
+        for command in domain.commands:
+            command_declarations.append(self._generate_handler_implementation_for_command(domain, command))
+
+        return '\n'.join(command_declarations)
+
+    def _generate_handler_implementation_for_command(self, domain, command):
+        lines = []
+        parameters = ['long callId']
+        for parameter in command.call_parameters:
+            parameters.append('%s in_%s' % (CppGenerator.cpp_type_for_unchecked_formal_in_parameter(parameter), parameter.parameter_name))
+
+        command_args = {
+            'domainName': domain.domain_name,
+            'commandName': command.command_name,
+            'parameters': ', '.join(parameters),
+            'successCallback': self._generate_success_block_for_command(domain, command),
+            'conversions': self._generate_conversions_for_command(domain, command),
+            'invocation': self._generate_invocation_for_command(domain, command),
+        }
+
+        return self.wrap_with_guard_for_domain(domain, Template(ObjCTemplates.BackendDispatcherHeaderDomainHandlerImplementation).substitute(None, **command_args))
+
+    def _generate_success_block_for_command(self, domain, command):
+        lines = []
+
+        if command.return_parameters:
+            success_block_parameters = []
+            for parameter in command.return_parameters:
+                objc_type = ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter)
+                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+                success_block_parameters.append(join_type_and_name(objc_type, var_name))
+            lines.append('    id successCallback = ^(%s) {' % ', '.join(success_block_parameters))
+        else:
+            lines.append('    id successCallback = ^{')
+
+        if command.return_parameters:
+            lines.append('        RefPtr&lt;InspectorObject&gt; resultObject = InspectorObject::create();')
+
+            required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
+            for parameter in required_pointer_parameters:
+                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+                lines.append('        THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
+
+            optional_pointer_parameters = filter(lambda parameter: parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
+            for parameter in optional_pointer_parameters:
+                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+                lines.append('        THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
+
+            for parameter in command.return_parameters:
+                keyed_set_method = CppGenerator.cpp_setter_method_for_type(parameter.type)
+                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+                var_expression = '*%s' % var_name if parameter.is_optional else var_name
+                export_expression = ObjCGenerator.objc_protocol_export_expression_for_variable(parameter.type, var_expression)
+                if not parameter.is_optional:
+                    lines.append('        resultObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
+                else:
+                    lines.append('        if (%s)' % var_name)
+                    lines.append('            resultObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
+            lines.append('        backendDispatcher()-&gt;sendResponse(callId, resultObject.release(), String());')
+        else:
+            lines.append('        backendDispatcher()-&gt;sendResponse(callId, InspectorObject::create(), String());')
+
+        lines.append('    };')
+        return '\n'.join(lines)
+
+    def _generate_conversions_for_command(self, domain, command):
+        lines = []
+        if command.call_parameters:
+            lines.append('')
+
+        for parameter in command.call_parameters:
+            in_param_name = 'in_%s' % parameter.parameter_name
+            objc_in_param_name = 'o_%s' % in_param_name
+            objc_type = ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter, False)
+            in_param_optional_safe_name = '*%s' % in_param_name if parameter.is_optional else in_param_name
+            import_expression = ObjCGenerator.objc_protocol_import_expression_for_parameter(in_param_optional_safe_name, domain, command.command_name, parameter)
+            if not parameter.is_optional:
+                lines.append('    %s = %s;' % (join_type_and_name(objc_type, objc_in_param_name), import_expression))
+            else:
+                lines.append('    %s;' % join_type_and_name(objc_type, objc_in_param_name))
+                lines.append('    if (%s)' % in_param_name)
+                lines.append('        %s = %s;' % (objc_in_param_name, import_expression))
+
+        if lines:
+            lines.append('')
+        return '\n'.join(lines)
+
+    def _generate_invocation_for_command(self, domain, command):
+        pairs = []
+        pairs.append('WithErrorCallback:errorCallback')
+        pairs.append('successCallback:successCallback')
+        for parameter in command.call_parameters:
+            in_param_name = 'in_%s' % parameter.parameter_name
+            objc_in_param_name = 'o_%s' % in_param_name
+            if not parameter.is_optional:
+                pairs.append('%s:%s' % (parameter.parameter_name, objc_in_param_name))
+            else:
+                optional_expression = '(%s ? &amp;%s : nil)' % (in_param_name, objc_in_param_name)
+                pairs.append('%s:%s' % (parameter.parameter_name, optional_expression))
+        return '    [m_delegate %s%s];' % (command.command_name, ' '.join(pairs))
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_configuration_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,86 @@
</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
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCConfigurationHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sConfiguration.h' % ObjCGenerator.OBJC_PREFIX
+
+    def generate_output(self):
+        headers = [
+            '&quot;%s.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+        ]
+
+        header_args = {
+            'includes': '\n'.join(['#import ' + header for header in headers]),
+        }
+
+        self._command_filter = ObjCGenerator.should_generate_domain_command_handler_filter(self.model())
+        self._event_filter = ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model())
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.GenericHeaderPrelude).substitute(None, **header_args))
+        sections.append(self._generate_configuration_interface_for_domains(domains))
+        sections.append(Template(ObjCTemplates.GenericHeaderPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_configuration_interface_for_domains(self, domains):
+        lines = []
+        lines.append('@interface RWIProtocolConfiguration : NSObject')
+        for domain in domains:
+            lines.extend(self._generate_properties_for_domain(domain))
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_properties_for_domain(self, domain):
+        property_args = {
+            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
+            'domainName': domain.domain_name,
+            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
+        }
+
+        lines = []
+        if domain.commands and self._command_filter(domain):
+            lines.append(Template(ObjCTemplates.ConfigurationCommandProperty).substitute(None, **property_args))
+        if domain.events and self._event_filter(domain):
+            lines.append(Template(ObjCTemplates.ConfigurationEventProperty).substitute(None, **property_args))
+        return lines
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_configuration_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_configuration_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,150 @@
</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
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCBackendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sConfiguration.mm' % ObjCGenerator.OBJC_PREFIX
+
+    def generate_output(self):
+        secondary_headers = [
+            '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&quot;%sBackendDispatchers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&lt;JavaScriptCore/AlternateDispatchableAgent.h&gt;',
+            '&lt;JavaScriptCore/AugmentableInspectorController.h&gt;',
+            '&lt;JavaScriptCore/InspectorAlternateBackendDispatchers.h&gt;',
+            '&lt;JavaScriptCore/InspectorBackendDispatchers.h&gt;',
+        ]
+
+        header_args = {
+            'primaryInclude': '&quot;%sConfiguration.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
+        }
+
+        self._command_filter = ObjCGenerator.should_generate_domain_command_handler_filter(self.model())
+        self._event_filter = ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model())
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.ImplementationPrelude).substitute(None, **header_args))
+        sections.append(self._generate_configuration_implementation_for_domains(domains))
+        sections.append(Template(ObjCTemplates.ImplementationPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_configuration_implementation_for_domains(self, domains):
+        lines = []
+        lines.append('@implementation RWIProtocolConfiguration')
+        lines.append('{')
+        lines.append('    AugmentableInspectorController* _controller;')
+        lines.extend(self._generate_ivars(domains))
+        lines.append('}')
+        lines.append('')
+        lines.append('- (instancetype)initWithController:(AugmentableInspectorController*)controller')
+        lines.append('{')
+        lines.append('    self = [super init];')
+        lines.append('    if (!self)')
+        lines.append('        return nil;')
+        lines.append('    ASSERT(controller);')
+        lines.append('    _controller = controller;')
+        lines.append('    return self;')
+        lines.append('}')
+        lines.append('')
+        lines.extend(self._generate_dealloc(domains))
+        lines.append('')
+        for domain in domains:
+            if domain.commands and self._command_filter(domain):
+                lines.append(self._generate_handler_setter_for_domain(domain))
+                lines.append('')
+            if domain.events and self._event_filter(domain):
+                lines.append(self._generate_event_dispatcher_getter_for_domain(domain))
+                lines.append('')
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_ivars(self, domains):
+        lines = []
+        for domain in domains:
+            if domain.commands and self._command_filter(domain):
+                objc_class_name = '%s%sDomainHandler' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+                ivar_name = '_%sHandler' % ObjCGenerator.variable_name_prefix_for_domain(domain)
+                lines.append('    id&lt;%s&gt; %s;' % (objc_class_name, ivar_name))
+            if domain.events and self._event_filter(domain):
+                objc_class_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+                ivar_name = '_%sEventDispatcher' % ObjCGenerator.variable_name_prefix_for_domain(domain)
+                lines.append('    %s *%s;' % (objc_class_name, ivar_name))
+        return lines
+
+    def _generate_dealloc(self, domains):
+        lines = []
+        lines.append('- (void)dealloc')
+        lines.append('{')
+        for domain in domains:
+            if domain.commands and self._command_filter(domain):
+                lines.append('    [_%sHandler release];' % ObjCGenerator.variable_name_prefix_for_domain(domain))
+            if domain.events and self._event_filter(domain):
+                lines.append('    [_%sEventDispatcher release];' % ObjCGenerator.variable_name_prefix_for_domain(domain))
+        lines.append('    [super dealloc];')
+        lines.append('}')
+        return lines
+
+    def _generate_handler_setter_for_domain(self, domain):
+        setter_args = {
+            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
+            'domainName': domain.domain_name,
+            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
+        }
+        return Template(ObjCTemplates.ConfigurationCommandPropertyImplementation).substitute(None, **setter_args)
+
+    def _generate_event_dispatcher_getter_for_domain(self, domain):
+        getter_args = {
+            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
+            'domainName': domain.domain_name,
+            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
+        }
+        return Template(ObjCTemplates.ConfigurationGetterImplementation).substitute(None, **getter_args)
+
+    def _variable_name_prefix_for_domain(self, domain):
+        domain_name = domain.domain_name
+        if domain_name.startswith('DOM'):
+            return 'dom' + domain_name[3:]
+        if domain_name.startswith('CSS'):
+            return 'css' + domain_name[3:]
+        return domain_name[:1].lower() + domain_name[1:]
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_conversion_helperspyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_conversion_helperspy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_conversion_helpers.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_conversion_helpers.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_conversion_helpers.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,155 @@
</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
+from models import EnumType
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+def add_newline(lines):
+    if lines and lines[-1] == '':
+        return
+    lines.append('')
+
+
+class ObjCConversionHelpersGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sEnumConversionHelpers.h' % ObjCGenerator.OBJC_PREFIX
+
+    def domains_to_generate(self):
+        return filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        headers = [
+            '&quot;%sArrayConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+        ]
+
+        header_args = {
+            'includes': '\n'.join(['#import ' + header for header in headers]),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.ConversionHelpersPrelude).substitute(None, **header_args))
+        sections.append(Template(ObjCTemplates.ConversionHelpersStandard).substitute(None))
+        sections.extend(map(self._generate_enum_conversion_functions, domains))
+        sections.append(Template(ObjCTemplates.ConversionHelpersPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_enum_conversion_functions(self, domain):
+        lines = []
+
+        # Type enums and member enums.
+        for declaration in domain.type_declarations:
+            if isinstance(declaration.type, EnumType):
+                add_newline(lines)
+                lines.append(self._generate_anonymous_enum_conversion_for_declaration(domain, declaration))
+            else:
+                for member in declaration.type_members:
+                    if (isinstance(member.type, EnumType) and member.type.is_anonymous):
+                        add_newline(lines)
+                        lines.append(self._generate_anonymous_enum_conversion_for_member(domain, declaration, member))
+
+        # Anonymous command enums.
+        for command in domain.commands:
+            for parameter in command.call_parameters:
+                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, command.command_name, parameter))
+            for parameter in command.return_parameters:
+                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, command.command_name, parameter))
+
+        # Anonymous event enums.
+        for event in domain.events:
+            for parameter in event.event_parameters:
+                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, event.event_name, parameter))
+
+        return '\n'.join(lines)
+
+    def _generate_anonymous_enum_conversion_for_declaration(self, domain, declaration):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration(declaration)
+        enum_values = declaration.type.enum_values()
+        lines = []
+        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
+        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
+        return '\n\n'.join(lines)
+
+    def _generate_anonymous_enum_conversion_for_member(self, domain, declaration, member):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
+        enum_values = member.type.enum_values()
+        lines = []
+        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
+        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
+        return '\n\n'.join(lines)
+
+    def _generate_anonymous_enum_conversion_for_parameter(self, domain, event_or_command_name, parameter):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
+        enum_values = parameter.type.enum_values()
+        lines = []
+        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
+        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
+        return '\n\n'.join(lines)
+
+    def _generate_enum_objc_to_protocol_string(self, objc_enum_name, enum_values):
+        lines = []
+        lines.append('inline String toProtocolString(%s value)' % objc_enum_name)
+        lines.append('{')
+        lines.append('    switch(value) {')
+        for enum_value in enum_values:
+            lines.append('    case %s%s:' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value)))
+            lines.append('        return ASCIILiteral(&quot;%s&quot;);' % enum_value)
+        lines.append('    }')
+        lines.append('}')
+        return '\n'.join(lines)
+
+    def _generate_enum_from_protocol_string(self, objc_enum_name, enum_values):
+        lines = []
+        lines.append('template&lt;&gt;')
+        lines.append('inline %s fromProtocolString(String value)' % objc_enum_name)
+        lines.append('{')
+        for enum_value in enum_values:
+            lines.append('    if (value == &quot;%s&quot;)' % enum_value)
+            lines.append('        return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value)))
+        lines.append('    ASSERT_NOT_REACHED();')
+        lines.append('    return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_values[0])))
+        lines.append('}')
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_frontend_dispatcher_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_frontend_dispatcher_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,151 @@
</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 cpp_generator import CppGenerator
+from generator import Generator, ucfirst
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCFrontendDispatcherImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sEventDispatchers.mm' % ObjCGenerator.OBJC_PREFIX
+
+    def domains_to_generate(self):
+        return filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        secondary_headers = [
+            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&lt;JavaScriptCore/InspectorFrontendChannel.h&gt;',
+            '&lt;JavaScriptCore/InspectorValues.h&gt;',
+        ]
+
+        header_args = {
+            'primaryInclude': '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.ImplementationPrelude).substitute(None, **header_args))
+        sections.extend(map(self._generate_event_dispatcher_implementations, domains))
+        sections.append(Template(ObjCTemplates.ImplementationPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_event_dispatcher_implementations(self, domain):
+        if not domain.events:
+            return ''
+
+        lines = []
+        objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+        lines.append('@implementation %s' % objc_name)
+        lines.append('{')
+        lines.append('    AugmentableInspectorController* _controller;')
+        lines.append('}')
+        lines.append('')
+        lines.append('- (instancetype)initWithController:(AugmentableInspectorController*)controller;')
+        lines.append('{')
+        lines.append('    self = [super init];')
+        lines.append('    if (!self)')
+        lines.append('        return nil;')
+        lines.append('    ASSERT(controller);')
+        lines.append('    _controller = controller;')
+        lines.append('    return self;')
+        lines.append('}')
+        lines.append('')
+        for event in domain.events:
+            lines.append(self._generate_event(domain, event))
+            lines.append('')
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_event(self, domain, event):
+        lines = []
+        lines.append(self._generate_event_signature(domain, event))
+        lines.append('{')
+        lines.append('    InspectorFrontendChannel* frontendChannel = _controller-&gt;frontendChannel();')
+        lines.append('    if (!frontendChannel)')
+        lines.append('        return;')
+        lines.append('')
+
+        required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), event.event_parameters)
+        for parameter in required_pointer_parameters:
+            var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+            lines.append('    THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
+
+        optional_pointer_parameters = filter(lambda parameter: parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), event.event_parameters)
+        for parameter in optional_pointer_parameters:
+            var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
+            lines.append('    THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
+
+        if required_pointer_parameters or optional_pointer_parameters:
+            lines.append('')
+
+        lines.append('    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();')
+        lines.append('    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;%s.%s&quot;));' % (domain.domain_name, event.event_name))
+        if event.event_parameters:
+            lines.extend(self._generate_event_out_parameters(domain, event))
+        lines.append('    frontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());')
+        lines.append('}')
+        return '\n'.join(lines)
+
+    def _generate_event_signature(self, domain, event):
+        if not event.event_parameters:
+            return '- (void)%s' % event.event_name
+        pairs = []
+        for parameter in event.event_parameters:
+            param_name = parameter.parameter_name
+            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, event.event_name, parameter), param_name))
+        pairs[0] = ucfirst(pairs[0])
+        return '- (void)%sWith%s' % (event.event_name, ' '.join(pairs))
+
+    def _generate_event_out_parameters(self, domain, event):
+        lines = []
+        lines.append('    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();')
+        for parameter in event.event_parameters:
+            keyed_set_method = CppGenerator.cpp_setter_method_for_type(parameter.type)
+            var_name = parameter.parameter_name
+            safe_var_name = '(*%s)' % var_name if parameter.is_optional else var_name
+            export_expression = ObjCGenerator.objc_protocol_export_expression_for_variable(parameter.type, safe_var_name)
+            if not parameter.is_optional:
+                lines.append('    paramsObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
+            else:
+                lines.append('    if (%s)' % (parameter.parameter_name))
+                lines.append('        paramsObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
+        lines.append('    jsonMessage-&gt;setObject(ASCIILiteral(&quot;params&quot;), paramsObject);')
+        return lines
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,227 @@
</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 models import ObjectType, EnumType
+from objc_generator import ObjCGenerator, join_type_and_name
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+def add_newline(lines):
+    if lines and lines[-1] == '':
+        return
+    lines.append('')
+
+
+class ObjCHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%s.h' % ObjCGenerator.OBJC_PREFIX
+
+    def generate_output(self):
+        headers = set([
+            '&lt;WebInspector/RWIProtocolJSONObject.h&gt;',
+        ])
+
+        header_args = {
+            'includes': '\n'.join(['#import ' + header for header in sorted(headers)]),
+        }
+
+        domains = self.domains_to_generate()
+        type_domains = filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), domains)
+        command_domains = filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), domains)
+        event_domains = filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), domains)
+
+        # FIXME: &lt;https://webkit.org/b/138222&gt; Web Inspector: Reduce unnecessary enums/types generated in ObjC Protocol Interfaces
+        # Currently we generate enums/types for all types in the type_domains. For the built-in
+        # JSC domains (Debugger, Runtime) this produces extra unused types. We only need to
+        # generate these types if they are referenced by the command_domains or event_domains.
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.HeaderPrelude).substitute(None, **header_args))
+        sections.append('\n'.join(filter(None, map(self._generate_forward_declarations, type_domains))))
+        sections.append('\n'.join(filter(None, map(self._generate_enums, type_domains))))
+        sections.append('\n'.join(filter(None, map(self._generate_types, type_domains))))
+        sections.append('\n\n'.join(filter(None, map(self._generate_command_protocols, command_domains))))
+        sections.append('\n\n'.join(filter(None, map(self._generate_event_interfaces, event_domains))))
+        sections.append(Template(ObjCTemplates.HeaderPostlude).substitute(None))
+        return '\n\n'.join(sections)
+
+    def _generate_forward_declarations(self, domain):
+        lines = []
+        for declaration in domain.type_declarations:
+            if (isinstance(declaration.type, ObjectType)):
+                objc_name = ObjCGenerator.objc_name_for_type(declaration.type)
+                lines.append('@class %s;' % objc_name)
+        return '\n'.join(lines)
+
+    def _generate_enums(self, domain):
+        lines = []
+
+        # Type enums and member enums.
+        for declaration in domain.type_declarations:
+            if isinstance(declaration.type, EnumType):
+                add_newline(lines)
+                lines.append(self._generate_anonymous_enum_for_declaration(domain, declaration))
+            else:
+                for member in declaration.type_members:
+                    if isinstance(member.type, EnumType) and member.type.is_anonymous:
+                        add_newline(lines)
+                        lines.append(self._generate_anonymous_enum_for_member(domain, declaration, member))
+
+        # Anonymous command enums.
+        for command in domain.commands:
+            for parameter in command.call_parameters:
+                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_for_parameter(domain, command.command_name, parameter))
+            for parameter in command.return_parameters:
+                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_for_parameter(domain, command.command_name, parameter))
+
+        # Anonymous event enums.
+        for event in domain.events:
+            for parameter in event.event_parameters:
+                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
+                    add_newline(lines)
+                    lines.append(self._generate_anonymous_enum_for_parameter(domain, event.event_name, parameter))
+
+        return '\n'.join(lines)
+
+    def _generate_types(self, domain):
+        lines = []
+        # Type interfaces.
+        for declaration in domain.type_declarations:
+            if isinstance(declaration.type, ObjectType):
+                add_newline(lines)
+                lines.append(self._generate_type_interface(domain, declaration))
+        return '\n'.join(lines)
+
+    def _generate_anonymous_enum_for_declaration(self, domain, declaration):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration(declaration)
+        return self._generate_enum(objc_enum_name, declaration.type.enum_values())
+
+    def _generate_anonymous_enum_for_member(self, domain, declaration, member):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
+        return self._generate_enum(objc_enum_name, member.type.enum_values())
+
+    def _generate_anonymous_enum_for_parameter(self, domain, event_or_command_name, parameter):
+        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
+        return self._generate_enum(objc_enum_name, parameter.type.enum_values())
+
+    def _generate_enum(self, enum_name, enum_values):
+        lines = []
+        lines.append('typedef NS_ENUM(NSInteger, %s) {' % enum_name)
+        for enum_value in enum_values:
+            lines.append('    %s%s,' % (enum_name, Generator.stylized_name_for_enum_value(enum_value)))
+        lines.append('};')
+        return '\n'.join(lines)
+
+    def _generate_type_interface(self, domain, declaration):
+        lines = []
+        objc_name = ObjCGenerator.objc_name_for_type(declaration.type)
+        lines.append('@interface %s : %s' % (objc_name, ObjCGenerator.OBJC_JSON_OBJECT_BASE))
+        required_members = filter(lambda member: not member.is_optional, declaration.type_members)
+        optional_members = filter(lambda member: member.is_optional, declaration.type_members)
+        if required_members:
+            lines.append(self._generate_init_method_for_required_members(domain, declaration, required_members))
+        for member in required_members:
+            lines.append('/* required */ ' + self._generate_member_property(declaration, member))
+        for member in optional_members:
+            lines.append('/* optional */ ' + self._generate_member_property(declaration, member))
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_init_method_for_required_members(self, domain, declaration, required_members):
+        pairs = []
+        for member in required_members:
+            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+            pairs.append('%s:(%s)%s' % (var_name, objc_type, var_name))
+        pairs[0] = ucfirst(pairs[0])
+        return '- (instancetype)initWith%s;' % ' '.join(pairs)
+
+    def _generate_member_property(self, declaration, member):
+        accessor_type = ObjCGenerator.objc_accessor_type_for_member(member)
+        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+        return '@property (nonatomic, %s) %s;' % (accessor_type, join_type_and_name(objc_type, ObjCGenerator.identifier_to_objc_identifier(member.member_name)))
+
+    def _generate_command_protocols(self, domain):
+        lines = []
+        if domain.commands:
+            objc_name = '%s%sDomainHandler' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+            lines.append('@protocol %s &lt;NSObject&gt;' % objc_name)
+            lines.append('@required')
+            for command in domain.commands:
+                lines.append(self._generate_single_command_protocol(domain, command))
+            lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_single_command_protocol(self, domain, command):
+        pairs = []
+        pairs.append('ErrorCallback:(void(^)(NSString *error))errorCallback')
+        pairs.append('successCallback:(%s)successCallback' % self._callback_block_for_command(domain, command))
+        for parameter in command.call_parameters:
+            param_name = parameter.parameter_name
+            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter), param_name))
+        return '- (void)%sWith%s;' % (command.command_name, ' '.join(pairs))
+
+    def _callback_block_for_command(self, domain, command):
+        pairs = []
+        for parameter in command.return_parameters:
+            pairs.append(join_type_and_name(ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter), parameter.parameter_name))
+        return 'void(^)(%s)' % ', '.join(pairs)
+
+    def _generate_event_interfaces(self, domain):
+        lines = []
+        if domain.events:
+            objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+            lines.append('@interface %s : NSObject' % objc_name)
+            for event in domain.events:
+                lines.append(self._generate_single_event_interface(domain, event))
+            lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_single_event_interface(self, domain, event):
+        if not event.event_parameters:
+            return '- (void)%s;' % event.event_name
+        pairs = []
+        for parameter in event.event_parameters:
+            param_name = parameter.parameter_name
+            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, event.event_name, parameter), param_name))
+        pairs[0] = ucfirst(pairs[0])
+        return '- (void)%sWith%s;' % (event.event_name, ' '.join(pairs))
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_internal_headerpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_internal_headerpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,75 @@
</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 objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+class ObjCInternalHeaderGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sInternal.h' % ObjCGenerator.OBJC_PREFIX
+
+    def generate_output(self):
+        headers = set([
+            '&quot;%s.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&quot;RWIProtocolJSONObjectInternal.h&quot;',
+            '&lt;JavaScriptCore/InspectorValues.h&gt;',
+            '&lt;JavaScriptCore/AugmentableInspectorController.h&gt;',
+        ])
+
+        header_args = {
+            'includes': '\n'.join(['#import ' + header for header in sorted(headers)]),
+        }
+
+        domains = self.domains_to_generate()
+        event_domains = filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), domains)
+
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.GenericHeaderPrelude).substitute(None, **header_args))
+        sections.append('\n\n'.join(filter(None, map(self._generate_event_dispatcher_private_interfaces, event_domains))))
+        sections.append(Template(ObjCTemplates.GenericHeaderPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_event_dispatcher_private_interfaces(self, domain):
+        lines = []
+        if domain.events:
+            objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
+            lines.append('@interface %s (Private)' % objc_name)
+            lines.append('- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;')
+            lines.append('@end')
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objc_protocol_types_implementationpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_types_implementationpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,155 @@
</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 models import ObjectType
+from objc_generator import ObjCGenerator
+from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates
+
+log = logging.getLogger('global')
+
+
+def add_newline(lines):
+    if lines and lines[-1] == '':
+        return
+    lines.append('')
+
+
+class ObjCProtocolTypesImplementationGenerator(Generator):
+    def __init__(self, model, input_filepath):
+        Generator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sTypes.mm' % ObjCGenerator.OBJC_PREFIX
+
+    def domains_to_generate(self):
+        return filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), Generator.domains_to_generate(self))
+
+    def generate_output(self):
+        secondary_headers = [
+            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            '&lt;JavaScriptCore/InspectorValues.h&gt;',
+            '&lt;wtf/Assertions.h&gt;',
+            '&lt;wtf/PassRefPtr.h&gt;',
+        ]
+
+        header_args = {
+            'primaryInclude': '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
+            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
+        }
+
+        domains = self.domains_to_generate()
+        sections = []
+        sections.append(self.generate_license())
+        sections.append(Template(ObjCTemplates.ImplementationPrelude).substitute(None, **header_args))
+        sections.extend(map(self.generate_type_implementations, domains))
+        sections.append(Template(ObjCTemplates.ImplementationPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def generate_type_implementations(self, domain):
+        lines = []
+        for declaration in domain.type_declarations:
+            if (isinstance(declaration.type, ObjectType)):
+                add_newline(lines)
+                lines.append(self.generate_type_implementation(domain, declaration))
+        return '\n'.join(lines)
+
+    def generate_type_implementation(self, domain, declaration):
+        lines = []
+        lines.append('@implementation %s' % ObjCGenerator.objc_name_for_type(declaration.type))
+        required_members = filter(lambda member: not member.is_optional, declaration.type_members)
+        if required_members:
+            lines.append('')
+            lines.append(self._generate_init_method_for_required_members(domain, declaration, required_members))
+        for member in declaration.type_members:
+            lines.append('')
+            lines.append(self._generate_setter_for_member(domain, declaration, member))
+            lines.append('')
+            lines.append(self._generate_getter_for_member(domain, declaration, member))
+        lines.append('')
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_init_method_for_required_members(self, domain, declaration, required_members):
+        pairs = []
+        for member in required_members:
+            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+            pairs.append('%s:(%s)%s' % (var_name, objc_type, var_name))
+        pairs[0] = ucfirst(pairs[0])
+        lines = []
+        lines.append('- (instancetype)initWith%s;' % ' '.join(pairs))
+        lines.append('{')
+        lines.append('    self = [super init];')
+        lines.append('    if (!self)')
+        lines.append('        return nil;')
+        lines.append('')
+
+        required_pointer_members = filter(lambda member: ObjCGenerator.is_type_objc_pointer_type(member.type), required_members)
+        if required_pointer_members:
+            for member in required_pointer_members:
+                var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+                lines.append('    THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(%s, @&quot;%s&quot;);' % (var_name, var_name))
+            lines.append('')
+
+        for member in required_members:
+            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+            lines.append('    self.%s = %s;' % (var_name, var_name))
+
+        lines.append('')
+        lines.append('    return self;')
+        lines.append('}')
+        return '\n'.join(lines)
+
+    def _generate_setter_for_member(self, domain, declaration, member):
+        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+        var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+        setter_method = ObjCGenerator.objc_setter_method_for_member(declaration, member)
+        conversion_expression = ObjCGenerator.objc_to_protocol_expression_for_member(declaration, member, var_name)
+        lines = []
+        lines.append('- (void)set%s:(%s)%s' % (ucfirst(var_name), objc_type, var_name))
+        lines.append('{')
+        lines.append('    [super %s:%s forKey:@&quot;%s&quot;];' % (setter_method, conversion_expression, member.member_name))
+        lines.append('}')
+        return '\n'.join(lines)
+
+    def _generate_getter_for_member(self, domain, declaration, member):
+        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+        var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
+        getter_method = ObjCGenerator.objc_getter_method_for_member(declaration, member)
+        basic_expression = '[super %s:@&quot;%s&quot;]' % (getter_method, member.member_name)
+        conversion_expression = ObjCGenerator.protocol_to_objc_expression_for_member(declaration, member, basic_expression)
+        lines = []
+        lines.append('- (%s)%s' % (objc_type, var_name))
+        lines.append('{')
+        lines.append('    return %s;' % conversion_expression)
+        lines.append('}')
+        return '\n'.join(lines)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_cpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,511 +0,0 @@
</span><del>-#!/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 logging
-from generator import Generator, ucfirst
-from models import PrimitiveType, ObjectType, ArrayType, EnumType, AliasedType, Frameworks
-
-log = logging.getLogger('global')
-
-
-def join_type_and_name(type_str, name_str):
-    if type_str.endswith('*'):
-        return type_str + name_str
-    return type_str + ' ' + name_str
-
-
-def strip_block_comment_markers(str):
-    return str.replace('/*', '').replace('*/', '')
-
-
-def remove_duplicate_from_str(str, possible_duplicate):
-    return str.replace(possible_duplicate + possible_duplicate, possible_duplicate)
-
-
-_OBJC_IDENTIFIER_RENAME_MAP = {
-    'this': 'thisObject',  # Debugger.CallFrame.this
-    'description': 'stringRepresentation',  # Runtime.RemoteObject.description
-    'id': 'identifier',  # Page.Frame.id, Runtime.ExecutionContextDescription.id, Debugger.BreakpointAction.id
-}
-
-_OBJC_IDENTIFIER_REVERSE_RENAME_MAP = dict((v, k) for k, v in _OBJC_IDENTIFIER_RENAME_MAP.iteritems())
-
-
-class ObjCTypeCategory:
-    Simple = 0
-    String = 1
-    Object = 2
-    Array = 3
-
-    @staticmethod
-    def category_for_type(_type):
-        if (isinstance(_type, PrimitiveType)):
-            if _type.raw_name() is 'string':
-                return ObjCTypeCategory.String
-            if  _type.raw_name() in ['object', 'any']:
-                return ObjCTypeCategory.Object
-            if _type.raw_name() is 'array':
-                return ObjCTypeCategory.Array
-            return ObjCTypeCategory.Simple
-        if (isinstance(_type, ObjectType)):
-            return ObjCTypeCategory.Object
-        if (isinstance(_type, ArrayType)):
-            return ObjCTypeCategory.Array
-        if (isinstance(_type, AliasedType)):
-            return ObjCTypeCategory.category_for_type(_type.aliased_type)
-        if (isinstance(_type, EnumType)):
-            return ObjCTypeCategory.category_for_type(_type.primitive_type)
-        return None
-
-
-class ObjCGenerator:
-    OBJC_PREFIX = 'RWIProtocol'
-    OBJC_JSON_OBJECT_BASE = '%sJSONObject' % OBJC_PREFIX
-
-    # Adjust identifier names that collide with ObjC keywords.
-
-    @staticmethod
-    def identifier_to_objc_identifier(name):
-        return _OBJC_IDENTIFIER_RENAME_MAP.get(name, name)
-
-    @staticmethod
-    def objc_identifier_to_identifier(name):
-        return _OBJC_IDENTIFIER_REVERSE_RENAME_MAP.get(name, name)
-
-    # Generate ObjC types, command handlers, and event dispatchers for a subset of domains.
-
-    DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', 'Page']
-
-    @staticmethod
-    def should_generate_domain_types_filter(model):
-        def should_generate_domain_types(domain):
-            if model.framework is Frameworks.Test:
-                return True
-            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
-            whitelist.update(set(['Console', 'Debugger', 'Runtime']))
-            return domain.domain_name in whitelist
-        return should_generate_domain_types
-
-    @staticmethod
-    def should_generate_domain_command_handler_filter(model):
-        def should_generate_domain_command_handler(domain):
-            if model.framework is Frameworks.Test:
-                return True
-            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
-            return domain.domain_name in whitelist
-        return should_generate_domain_command_handler
-
-    @staticmethod
-    def should_generate_domain_event_dispatcher_filter(model):
-        def should_generate_domain_event_dispatcher(domain):
-            if model.framework is Frameworks.Test:
-                return True
-            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
-            whitelist.add('Console')
-            return domain.domain_name in whitelist
-        return should_generate_domain_event_dispatcher
-
-    # ObjC enum and type names.
-
-    @staticmethod
-    def objc_name_for_type(type):
-        name = type.qualified_name().replace('.', '')
-        name = remove_duplicate_from_str(name, type.type_domain().domain_name)
-        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
-
-    @staticmethod
-    def objc_enum_name_for_anonymous_enum_declaration(declaration):
-        domain_name = declaration.type.type_domain().domain_name
-        name = '%s%s' % (domain_name, declaration.type.raw_name())
-        name = remove_duplicate_from_str(name, domain_name)
-        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
-
-    @staticmethod
-    def objc_enum_name_for_anonymous_enum_member(declaration, member):
-        domain_name = member.type.type_domain().domain_name
-        name = '%s%s%s' % (domain_name, declaration.type.raw_name(), ucfirst(member.member_name))
-        name = remove_duplicate_from_str(name, domain_name)
-        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
-
-    @staticmethod
-    def objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter):
-        domain_name = domain.domain_name
-        name = '%s%s%s' % (domain_name, ucfirst(event_or_command_name), ucfirst(parameter.parameter_name))
-        name = remove_duplicate_from_str(name, domain_name)
-        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
-
-    @staticmethod
-    def objc_enum_name_for_non_anonymous_enum(_type):
-        domain_name = _type.type_domain().domain_name
-        name = _type.qualified_name().replace('.', '')
-        name = remove_duplicate_from_str(name, domain_name)
-        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
-
-    # Miscellaneous name handling.
-    
-    @staticmethod
-    def variable_name_prefix_for_domain(domain):
-        domain_name = domain.domain_name
-        if domain_name.startswith('DOM'):
-            return 'dom' + domain_name[3:]
-        if domain_name.startswith('CSS'):
-            return 'css' + domain_name[3:]
-        return domain_name[:1].lower() + domain_name[1:]
-
-    # Type basics.
-
-    @staticmethod
-    def objc_accessor_type_for_raw_name(raw_name):
-        if raw_name in ['string', 'array']:
-            return 'copy'
-        if raw_name in ['integer', 'number', 'boolean']:
-            return 'assign'
-        if raw_name in ['any', 'object']:
-            return 'retain'
-        return None
-
-    @staticmethod
-    def objc_type_for_raw_name(raw_name):
-        if raw_name is 'string':
-            return 'NSString *'
-        if raw_name is 'array':
-            return 'NSArray *'
-        if raw_name is 'integer':
-            return 'int'
-        if raw_name is 'number':
-            return 'double'
-        if raw_name is 'boolean':
-            return 'BOOL'
-        if raw_name in ['any', 'object']:
-            return '%s *' % ObjCGenerator.OBJC_JSON_OBJECT_BASE
-        return None
-
-    @staticmethod
-    def objc_class_for_raw_name(raw_name):
-        if raw_name is 'string':
-            return 'NSString'
-        if raw_name is 'array':
-            return 'NSArray'
-        if raw_name in ['integer', 'number', 'boolean']:
-            return 'NSNumber'
-        if raw_name in ['any', 'object']:
-            return ObjCGenerator.OBJC_JSON_OBJECT_BASE
-        return None
-
-    # FIXME: Can these protocol_type functions be removed in favor of C++ generators functions?
-
-    @staticmethod
-    def protocol_type_for_raw_name(raw_name):
-        if raw_name is 'string':
-            return 'String'
-        if raw_name is 'integer':
-            return 'int'
-        if raw_name is 'number':
-            return 'double'
-        if raw_name is 'boolean':
-            return 'bool'
-        if raw_name in ['any', 'object']:
-            return 'InspectorObject'
-        return None
-
-    @staticmethod
-    def protocol_type_for_type(_type):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return ObjCGenerator.protocol_type_for_raw_name(_type.raw_name())
-        if (isinstance(_type, EnumType)):
-            return ObjCGenerator.protocol_type_for_type(_type.primitive_type)
-        if (isinstance(_type, ObjectType)):
-            return 'Inspector::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
-        if (isinstance(_type, ArrayType)):
-            sub_type = ObjCGenerator.protocol_type_for_type(_type.element_type)
-            return 'Inspector::Protocol::Array&lt;%s&gt;' % sub_type
-        return None
-
-    @staticmethod
-    def is_type_objc_pointer_type(_type):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return _type.raw_name() in ['string', 'array', 'any', 'object']
-        if (isinstance(_type, EnumType)):
-            return False
-        if (isinstance(_type, ObjectType)):
-            return True
-        if (isinstance(_type, ArrayType)):
-            return True
-        return None
-
-    @staticmethod
-    def objc_class_for_type(_type):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return ObjCGenerator.objc_class_for_raw_name(_type.raw_name())
-        if (isinstance(_type, EnumType)):
-            return ObjCGenerator.objc_class_for_raw_name(_type.primitive_type.raw_name())
-        if (isinstance(_type, ObjectType)):
-            return ObjCGenerator.objc_name_for_type(_type)
-        if (isinstance(_type, ArrayType)):
-            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
-            return 'NSArray/*&lt;%s&gt;*/' % sub_type
-        return None
-
-    @staticmethod
-    def objc_accessor_type_for_member(member):
-        return ObjCGenerator.objc_accessor_type_for_member_internal(member.type)
-
-    @staticmethod
-    def objc_accessor_type_for_member_internal(_type):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return ObjCGenerator.objc_accessor_type_for_raw_name(_type.raw_name())
-        if (isinstance(_type, EnumType)):
-            return 'assign'
-        if (isinstance(_type, ObjectType)):
-            return 'retain'
-        if (isinstance(_type, ArrayType)):
-            return 'copy'
-        return None
-
-    @staticmethod
-    def objc_type_for_member(declaration, member):
-        return ObjCGenerator.objc_type_for_member_internal(member.type, declaration, member)
-
-    @staticmethod
-    def objc_type_for_member_internal(_type, declaration, member):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return ObjCGenerator.objc_type_for_raw_name(_type.raw_name())
-        if (isinstance(_type, EnumType)):
-            if (_type.is_anonymous):
-                return ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
-            return ObjCGenerator.objc_enum_name_for_non_anonymous_enum(_type)
-        if (isinstance(_type, ObjectType)):
-            return ObjCGenerator.objc_name_for_type(_type) + ' *'
-        if (isinstance(_type, ArrayType)):
-            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
-            return 'NSArray/*&lt;%s&gt;*/ *' % sub_type
-        return None
-
-    @staticmethod
-    def objc_type_for_param(domain, event_or_command_name, parameter, respect_optional=True):
-        objc_type = ObjCGenerator.objc_type_for_param_internal(parameter.type, domain, event_or_command_name, parameter)
-        if respect_optional and parameter.is_optional:
-            if objc_type.endswith('*'):
-                return objc_type + '*'
-            return objc_type + ' *'
-        return objc_type
-
-    @staticmethod
-    def objc_type_for_param_internal(_type, domain, event_or_command_name, parameter):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            return ObjCGenerator.objc_type_for_raw_name(_type.raw_name())
-        if (isinstance(_type, EnumType)):
-            if _type.is_anonymous:
-                return ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
-            return ObjCGenerator.objc_enum_name_for_non_anonymous_enum(_type)
-        if (isinstance(_type, ObjectType)):
-            return ObjCGenerator.objc_name_for_type(_type) + ' *'
-        if (isinstance(_type, ArrayType)):
-            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
-            return 'NSArray/*&lt;%s&gt;*/ *' % sub_type
-        return None
-
-    # ObjC &lt;-&gt; Protocol conversion for commands and events.
-    #   - convert a command call parameter received from Protocol to ObjC for handler
-    #   - convert a command return parameter in callback block from ObjC to Protocol to send
-    #   - convert an event parameter from ObjC API to Protocol to send
-
-    @staticmethod
-    def objc_protocol_export_expression_for_variable(var_type, var_name):
-        category = ObjCTypeCategory.category_for_type(var_type)
-        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
-            if isinstance(var_type, EnumType):
-                return 'toProtocolString(%s)' % var_name
-            return var_name
-        if category is ObjCTypeCategory.Object:
-            return '[%s toInspectorObject]' % var_name
-        if category is ObjCTypeCategory.Array:
-            protocol_type = ObjCGenerator.protocol_type_for_type(var_type.element_type)
-            objc_class = ObjCGenerator.objc_class_for_type(var_type.element_type)
-            if protocol_type == 'Inspector::Protocol::Array&lt;String&gt;':
-                return 'inspectorStringArrayArray(%s)' % var_name
-            if protocol_type is 'String' and objc_class is 'NSString':
-                return 'inspectorStringArray(%s)' % var_name
-            if protocol_type is 'int' and objc_class is 'NSNumber':
-                return 'inspectorIntegerArray(%s)' % var_name
-            if protocol_type is 'double' and objc_class is 'NSNumber':
-                return 'inspectorDoubleArray(%s)' % var_name
-            return 'inspectorObjectArray(%s)' % var_name
-
-    @staticmethod
-    def objc_protocol_import_expression_for_member(name, declaration, member):
-        if isinstance(member.type, EnumType):
-            if member.type.is_anonymous:
-                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member), name)
-            return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(member.type), name)
-        return ObjCGenerator.objc_protocol_import_expression_for_variable(member.type, name)
-
-    @staticmethod
-    def objc_protocol_import_expression_for_parameter(name, domain, event_or_command_name, parameter):
-        if isinstance(parameter.type, EnumType):
-            if parameter.type.is_anonymous:
-                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter), name)
-            return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(parameter.type), name)
-        return ObjCGenerator.objc_protocol_import_expression_for_variable(parameter.type, name)
-
-    @staticmethod
-    def objc_protocol_import_expression_for_variable(var_type, var_name):
-        category = ObjCTypeCategory.category_for_type(var_type)
-        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
-            return var_name
-        if category is ObjCTypeCategory.Object:
-            objc_class = ObjCGenerator.objc_class_for_type(var_type)
-            return '[[[%s alloc] initWithInspectorObject:%s] autorelease]' % (objc_class, var_name)
-        if category is ObjCTypeCategory.Array:
-            objc_class = ObjCGenerator.objc_class_for_type(var_type.element_type)
-            if objc_class is 'NSString':
-                return 'objcStringArray(%s)' % var_name
-            if objc_class is 'NSNumber':  # FIXME: Integer or Double?
-                return 'objcIntegerArray(%s)' % var_name
-            return 'objcArray&lt;%s&gt;(%s)' % (objc_class, var_name)
-
-    # ObjC &lt;-&gt; JSON object conversion for types getters/setters.
-    #   - convert a member setter from ObjC API to JSON object setter
-    #   - convert a member getter from JSON object to ObjC API
-
-    @staticmethod
-    def objc_to_protocol_expression_for_member(declaration, member, sub_expression):
-        category = ObjCTypeCategory.category_for_type(member.type)
-        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
-            if isinstance(member.type, EnumType):
-                return 'toProtocolString(%s)' % sub_expression
-            return sub_expression
-        if category is ObjCTypeCategory.Object:
-            return sub_expression
-        if category is ObjCTypeCategory.Array:
-            objc_class = ObjCGenerator.objc_class_for_type(member.type.element_type)
-            if objc_class is 'NSString':
-                return 'inspectorStringArray(%s)' % sub_expression
-            if objc_class is 'NSNumber':
-                protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
-                if protocol_type is 'double':
-                    return 'inspectorDoubleArray(%s)' % sub_expression
-                return 'inspectorIntegerArray(%s)' % sub_expression
-            return 'inspectorObjectArray(%s)' % sub_expression
-
-    @staticmethod
-    def protocol_to_objc_expression_for_member(declaration, member, sub_expression):
-        category = ObjCTypeCategory.category_for_type(member.type)
-        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
-            if isinstance(member.type, EnumType):
-                if member.type.is_anonymous:
-                    return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member), sub_expression)
-                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(member.type), sub_expression)
-            return sub_expression
-        if category is ObjCTypeCategory.Object:
-            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-            return '(%s)%s' % (objc_type, sub_expression)
-        if category is ObjCTypeCategory.Array:
-            protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
-            objc_class = ObjCGenerator.objc_class_for_type(member.type.element_type)
-            if objc_class is 'NSString':
-                return 'objcStringArray(%s)' % sub_expression
-            if objc_class is 'NSNumber':
-                protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
-                if protocol_type is 'double':
-                    return 'objcDoubleArray(%s)' % sub_expression
-                return 'objcIntegerArray(%s)' % sub_expression
-            return 'objcArray&lt;%s&gt;(%s)' % (objc_class, sub_expression)
-
-    # JSON object setter/getter selectors for types.
-
-    @staticmethod
-    def objc_setter_method_for_member(declaration, member):
-        return ObjCGenerator.objc_setter_method_for_member_internal(member.type, declaration, member)
-
-    @staticmethod
-    def objc_setter_method_for_member_internal(_type, declaration, member):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            raw_name = _type.raw_name()
-            if raw_name is 'boolean':
-                return 'setBool'
-            if raw_name is 'integer':
-                return 'setInteger'
-            if raw_name is 'number':
-                return 'setDouble'
-            if raw_name is 'string':
-                return 'setString'
-            if raw_name in ['any', 'object']:
-                return 'setObject'
-            if raw_name is 'array':
-                return 'setInspectorArray'
-            return None
-        if (isinstance(_type, EnumType)):
-            return 'setString'
-        if (isinstance(_type, ObjectType)):
-            return 'setObject'
-        if (isinstance(_type, ArrayType)):
-            return 'setInspectorArray'
-        return None
-
-    @staticmethod
-    def objc_getter_method_for_member(declaration, member):
-        return ObjCGenerator.objc_getter_method_for_member_internal(member.type, declaration, member)
-
-    @staticmethod
-    def objc_getter_method_for_member_internal(_type, declaration, member):
-        if (isinstance(_type, AliasedType)):
-            _type = _type.aliased_type
-        if (isinstance(_type, PrimitiveType)):
-            raw_name = _type.raw_name()
-            if raw_name is 'boolean':
-                return 'boolForKey'
-            if raw_name is 'integer':
-                return 'integerForKey'
-            if raw_name is 'number':
-                return 'doubleForKey'
-            if raw_name is 'string':
-                return 'stringForKey'
-            if raw_name in ['any', 'object']:
-                return 'objectForKey'
-            if raw_name is 'array':
-                return 'inspectorArrayForKey'
-            return None
-        if (isinstance(_type, EnumType)):
-            return 'stringForKey'
-        if (isinstance(_type, ObjectType)):
-            return 'objectForKey'
-        if (isinstance(_type, ArrayType)):
-            return 'inspectorArrayForKey'
-        return None
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,108 +0,0 @@
</span><del>-#!/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
-import re
-from string import Template
-
-from generate_objective_c import ObjCGenerator
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-from models import Frameworks
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCBackendDispatcherHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sBackendDispatchers.h' % ObjCGenerator.OBJC_PREFIX
-
-    def domains_to_generate(self):
-        return filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), Generator.domains_to_generate(self))
-
-    def generate_output(self):
-        headers = [
-            '&lt;JavaScriptCore/InspectorAlternateBackendDispatchers.h&gt;',
-            '&lt;wtf/RetainPtr.h&gt;',
-        ]
-
-        header_args = {
-            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
-            'includes': '\n'.join(['#include ' + header for header in headers]),
-            'forwardDeclarations': self._generate_objc_forward_declarations(),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCBackendDispatcherHeaderPrelude).substitute(None, **header_args))
-        sections.extend(map(self._generate_objc_handler_declarations_for_domain, domains))
-        sections.append(Template(Templates.ObjCBackendDispatcherHeaderPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_objc_forward_declarations(self):
-        lines = ['@protocol %s%sDomainHandler;' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name) for domain in self.domains_to_generate()]
-        return '\n'.join(lines)
-
-    def _generate_objc_forward_declarations_for_domains(self, domains):
-        lines = []
-        for domain in domains:
-            lines.append('@class %s%sDomainHandler;' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name))
-        return '\n'.join(lines)
-
-    def _generate_objc_handler_declarations_for_domain(self, domain):
-        if not domain.commands:
-            return ''
-
-        command_declarations = []
-        for command in domain.commands:
-            command_declarations.append(self._generate_objc_handler_declaration_for_command(command))
-
-        handler_args = {
-            'domainName': domain.domain_name,
-            'commandDeclarations': '\n'.join(command_declarations),
-            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
-        }
-
-        return self.wrap_with_guard_for_domain(domain, Template(Templates.ObjCBackendDispatcherHeaderDomainHandlerObjCDeclaration).substitute(None, **handler_args))
-
-    def _generate_objc_handler_declaration_for_command(self, command):
-        lines = []
-        parameters = ['long callId']
-        for _parameter in command.call_parameters:
-            parameters.append('%s in_%s' % (Generator.type_string_for_unchecked_formal_in_parameter(_parameter), _parameter.parameter_name))
-
-        command_args = {
-            'commandName': command.command_name,
-            'parameters': ', '.join(parameters),
-        }
-        lines.append('    virtual void %(commandName)s(%(parameters)s) override;' % command_args)
-        return '\n'.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_backend_dispatcher_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,176 +0,0 @@
</span><del>-#!/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
-import re
-from string import Template
-
-from generate_objective_c import ObjCTypeCategory, ObjCGenerator, join_type_and_name
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-from models import Frameworks
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCConfigurationImplementationGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sBackendDispatchers.mm' % ObjCGenerator.OBJC_PREFIX
-
-    def domains_to_generate(self):
-        return filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), Generator.domains_to_generate(self))
-
-    def generate_output(self):
-        secondary_headers = [
-            '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&lt;JavaScriptCore/InspectorFrontendChannel.h&gt;',
-            '&lt;JavaScriptCore/InspectorValues.h&gt;',
-        ]
-
-        header_args = {
-            'primaryInclude': '&quot;%sBackendDispatchers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            'secondaryIncludes': '\n'.join(['#include %s' % header for header in secondary_headers]),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCBackendDispatcherImplementationPrelude).substitute(None, **header_args))
-        sections.extend(map(self._generate_handler_implementation_for_domain, domains))
-        sections.append(Template(Templates.ObjCBackendDispatcherImplementationPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_handler_implementation_for_domain(self, domain):
-        if not domain.commands:
-            return ''
-
-        command_declarations = []
-        for command in domain.commands:
-            command_declarations.append(self._generate_handler_implementation_for_command(domain, command))
-
-        return '\n'.join(command_declarations)
-
-    def _generate_handler_implementation_for_command(self, domain, command):
-        lines = []
-        parameters = ['long callId']
-        for parameter in command.call_parameters:
-            parameters.append('%s in_%s' % (Generator.type_string_for_unchecked_formal_in_parameter(parameter), parameter.parameter_name))
-
-        command_args = {
-            'domainName': domain.domain_name,
-            'commandName': command.command_name,
-            'parameters': ', '.join(parameters),
-            'successCallback': self._generate_success_block_for_command(domain, command),
-            'conversions': self._generate_conversions_for_command(domain, command),
-            'invocation': self._generate_invocation_for_command(domain, command),
-        }
-
-        return self.wrap_with_guard_for_domain(domain, Template(Templates.ObjCBackendDispatcherHeaderDomainHandlerImplementation).substitute(None, **command_args))
-
-    def _generate_success_block_for_command(self, domain, command):
-        lines = []
-
-        if command.return_parameters:
-            success_block_parameters = []
-            for parameter in command.return_parameters:
-                objc_type = ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter)
-                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-                success_block_parameters.append(join_type_and_name(objc_type, var_name))
-            lines.append('    id successCallback = ^(%s) {' % ', '.join(success_block_parameters))
-        else:
-            lines.append('    id successCallback = ^{')
-
-        if command.return_parameters:
-            lines.append('        RefPtr&lt;InspectorObject&gt; resultObject = InspectorObject::create();')
-
-            required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
-            for parameter in required_pointer_parameters:
-                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-                lines.append('        THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
-
-            optional_pointer_parameters = filter(lambda parameter: parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
-            for parameter in optional_pointer_parameters:
-                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-                lines.append('        THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
-
-            for parameter in command.return_parameters:
-                keyed_set_method = Generator.keyed_set_method_for_type(parameter.type)
-                var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-                var_expression = '*%s' % var_name if parameter.is_optional else var_name
-                export_expression = ObjCGenerator.objc_protocol_export_expression_for_variable(parameter.type, var_expression)
-                if not parameter.is_optional:
-                    lines.append('        resultObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
-                else:
-                    lines.append('        if (%s)' % var_name)
-                    lines.append('            resultObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
-            lines.append('        backendDispatcher()-&gt;sendResponse(callId, resultObject.release(), String());')
-        else:
-            lines.append('        backendDispatcher()-&gt;sendResponse(callId, InspectorObject::create(), String());')
-
-        lines.append('    };')
-        return '\n'.join(lines)
-
-    def _generate_conversions_for_command(self, domain, command):
-        lines = []
-        if command.call_parameters:
-            lines.append('')
-
-        for parameter in command.call_parameters:
-            in_param_name = 'in_%s' % parameter.parameter_name
-            objc_in_param_name = 'o_%s' % in_param_name
-            objc_type = ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter, False)
-            in_param_optional_safe_name = '*%s' % in_param_name if parameter.is_optional else in_param_name
-            import_expression = ObjCGenerator.objc_protocol_import_expression_for_parameter(in_param_optional_safe_name, domain, command.command_name, parameter)
-            if not parameter.is_optional:
-                lines.append('    %s = %s;' % (join_type_and_name(objc_type, objc_in_param_name), import_expression))
-            else:
-                lines.append('    %s;' % join_type_and_name(objc_type, objc_in_param_name))
-                lines.append('    if (%s)' % in_param_name)
-                lines.append('        %s = %s;' % (objc_in_param_name, import_expression))
-
-        if lines:
-            lines.append('')
-        return '\n'.join(lines)
-
-    def _generate_invocation_for_command(self, domain, command):
-        pairs = []
-        pairs.append('WithErrorCallback:errorCallback')
-        pairs.append('successCallback:successCallback')
-        for parameter in command.call_parameters:
-            in_param_name = 'in_%s' % parameter.parameter_name
-            objc_in_param_name = 'o_%s' % in_param_name
-            if not parameter.is_optional:
-                pairs.append('%s:%s' % (parameter.parameter_name, objc_in_param_name))
-            else:
-                optional_expression = '(%s ? &amp;%s : nil)' % (in_param_name, objc_in_param_name)
-                pairs.append('%s:%s' % (parameter.parameter_name, optional_expression))
-        return '    [m_delegate %s%s];' % (command.command_name, ' '.join(pairs))
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,86 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCConfigurationHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sConfiguration.h' % ObjCGenerator.OBJC_PREFIX
-
-    def generate_output(self):
-        headers = [
-            '&quot;%s.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-        ]
-
-        header_args = {
-            'includes': '\n'.join(['#import ' + header for header in headers]),
-        }
-
-        self._command_filter = ObjCGenerator.should_generate_domain_command_handler_filter(self.model())
-        self._event_filter = ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model())
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCGenericHeaderPrelude).substitute(None, **header_args))
-        sections.append(self._generate_configuration_interface_for_domains(domains))
-        sections.append(Template(Templates.ObjCGenericHeaderPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_configuration_interface_for_domains(self, domains):
-        lines = []
-        lines.append('@interface RWIProtocolConfiguration : NSObject')
-        for domain in domains:
-            lines.extend(self._generate_properties_for_domain(domain))
-        lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_properties_for_domain(self, domain):
-        property_args = {
-            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
-            'domainName': domain.domain_name,
-            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
-        }
-
-        lines = []
-        if domain.commands and self._command_filter(domain):
-            lines.append(Template(Templates.ObjCConfigurationCommandProperty).substitute(None, **property_args))
-        if domain.events and self._event_filter(domain):
-            lines.append(Template(Templates.ObjCConfigurationEventProperty).substitute(None, **property_args))
-        return lines
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_configuration_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,150 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCBackendDispatcherImplementationGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sConfiguration.mm' % ObjCGenerator.OBJC_PREFIX
-
-    def generate_output(self):
-        secondary_headers = [
-            '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&quot;%sBackendDispatchers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&lt;JavaScriptCore/AlternateDispatchableAgent.h&gt;',
-            '&lt;JavaScriptCore/AugmentableInspectorController.h&gt;',
-            '&lt;JavaScriptCore/InspectorAlternateBackendDispatchers.h&gt;',
-            '&lt;JavaScriptCore/InspectorBackendDispatchers.h&gt;',
-        ]
-
-        header_args = {
-            'primaryInclude': '&quot;%sConfiguration.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
-        }
-
-        self._command_filter = ObjCGenerator.should_generate_domain_command_handler_filter(self.model())
-        self._event_filter = ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model())
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCImplementationPrelude).substitute(None, **header_args))
-        sections.append(self._generate_configuration_implementation_for_domains(domains))
-        sections.append(Template(Templates.ObjCImplementationPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_configuration_implementation_for_domains(self, domains):
-        lines = []
-        lines.append('@implementation RWIProtocolConfiguration')
-        lines.append('{')
-        lines.append('    AugmentableInspectorController* _controller;')
-        lines.extend(self._generate_ivars(domains))
-        lines.append('}')
-        lines.append('')
-        lines.append('- (instancetype)initWithController:(AugmentableInspectorController*)controller')
-        lines.append('{')
-        lines.append('    self = [super init];')
-        lines.append('    if (!self)')
-        lines.append('        return nil;')
-        lines.append('    ASSERT(controller);')
-        lines.append('    _controller = controller;')
-        lines.append('    return self;')
-        lines.append('}')
-        lines.append('')
-        lines.extend(self._generate_dealloc(domains))
-        lines.append('')
-        for domain in domains:
-            if domain.commands and self._command_filter(domain):
-                lines.append(self._generate_handler_setter_for_domain(domain))
-                lines.append('')
-            if domain.events and self._event_filter(domain):
-                lines.append(self._generate_event_dispatcher_getter_for_domain(domain))
-                lines.append('')
-        lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_ivars(self, domains):
-        lines = []
-        for domain in domains:
-            if domain.commands and self._command_filter(domain):
-                objc_class_name = '%s%sDomainHandler' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-                ivar_name = '_%sHandler' % ObjCGenerator.variable_name_prefix_for_domain(domain)
-                lines.append('    id&lt;%s&gt; %s;' % (objc_class_name, ivar_name))
-            if domain.events and self._event_filter(domain):
-                objc_class_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-                ivar_name = '_%sEventDispatcher' % ObjCGenerator.variable_name_prefix_for_domain(domain)
-                lines.append('    %s *%s;' % (objc_class_name, ivar_name))
-        return lines
-
-    def _generate_dealloc(self, domains):
-        lines = []
-        lines.append('- (void)dealloc')
-        lines.append('{')
-        for domain in domains:
-            if domain.commands and self._command_filter(domain):
-                lines.append('    [_%sHandler release];' % ObjCGenerator.variable_name_prefix_for_domain(domain))
-            if domain.events and self._event_filter(domain):
-                lines.append('    [_%sEventDispatcher release];' % ObjCGenerator.variable_name_prefix_for_domain(domain))
-        lines.append('    [super dealloc];')
-        lines.append('}')
-        return lines
-
-    def _generate_handler_setter_for_domain(self, domain):
-        setter_args = {
-            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
-            'domainName': domain.domain_name,
-            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
-        }
-        return Template(Templates.ObjCConfigurationCommandPropertyImplementation).substitute(None, **setter_args)
-
-    def _generate_event_dispatcher_getter_for_domain(self, domain):
-        getter_args = {
-            'objcPrefix': ObjCGenerator.OBJC_PREFIX,
-            'domainName': domain.domain_name,
-            'variableNamePrefix': ObjCGenerator.variable_name_prefix_for_domain(domain),
-        }
-        return Template(Templates.ObjCConfigurationGetterImplementation).substitute(None, **getter_args)
-
-    def _variable_name_prefix_for_domain(self, domain):
-        domain_name = domain.domain_name
-        if domain_name.startswith('DOM'):
-            return 'dom' + domain_name[3:]
-        if domain_name.startswith('CSS'):
-            return 'css' + domain_name[3:]
-        return domain_name[:1].lower() + domain_name[1:]
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_conversion_helperspy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,155 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator
-from generator_templates import GeneratorTemplates as Templates
-from models import EnumType
-
-log = logging.getLogger('global')
-
-
-def add_newline(lines):
-    if lines and lines[-1] == '':
-        return
-    lines.append('')
-
-
-class ObjectiveCConversionHelpersGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sEnumConversionHelpers.h' % ObjCGenerator.OBJC_PREFIX
-
-    def domains_to_generate(self):
-        return filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), Generator.domains_to_generate(self))
-
-    def generate_output(self):
-        headers = [
-            '&quot;%sArrayConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-        ]
-
-        header_args = {
-            'includes': '\n'.join(['#import ' + header for header in headers]),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCConversionHelpersPrelude).substitute(None, **header_args))
-        sections.append(Template(Templates.ObjCConversionHelpersStandard).substitute(None))
-        sections.extend(map(self._generate_enum_conversion_functions, domains))
-        sections.append(Template(Templates.ObjCConversionHelpersPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_enum_conversion_functions(self, domain):
-        lines = []
-
-        # Type enums and member enums.
-        for declaration in domain.type_declarations:
-            if isinstance(declaration.type, EnumType):
-                add_newline(lines)
-                lines.append(self._generate_anonymous_enum_conversion_for_declaration(domain, declaration))
-            else:
-                for member in declaration.type_members:
-                    if (isinstance(member.type, EnumType) and member.type.is_anonymous):
-                        add_newline(lines)
-                        lines.append(self._generate_anonymous_enum_conversion_for_member(domain, declaration, member))
-
-        # Anonymous command enums.
-        for command in domain.commands:
-            for parameter in command.call_parameters:
-                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, command.command_name, parameter))
-            for parameter in command.return_parameters:
-                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, command.command_name, parameter))
-
-        # Anonymous event enums.
-        for event in domain.events:
-            for parameter in event.event_parameters:
-                if (isinstance(parameter.type, EnumType) and parameter.type.is_anonymous):
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_conversion_for_parameter(domain, event.event_name, parameter))
-
-        return '\n'.join(lines)
-
-    def _generate_anonymous_enum_conversion_for_declaration(self, domain, declaration):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration(declaration)
-        enum_values = declaration.type.enum_values()
-        lines = []
-        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
-        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
-        return '\n\n'.join(lines)
-
-    def _generate_anonymous_enum_conversion_for_member(self, domain, declaration, member):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
-        enum_values = member.type.enum_values()
-        lines = []
-        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
-        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
-        return '\n\n'.join(lines)
-
-    def _generate_anonymous_enum_conversion_for_parameter(self, domain, event_or_command_name, parameter):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
-        enum_values = parameter.type.enum_values()
-        lines = []
-        lines.append(self._generate_enum_objc_to_protocol_string(objc_enum_name, enum_values))
-        lines.append(self._generate_enum_from_protocol_string(objc_enum_name, enum_values))
-        return '\n\n'.join(lines)
-
-    def _generate_enum_objc_to_protocol_string(self, objc_enum_name, enum_values):
-        lines = []
-        lines.append('inline String toProtocolString(%s value)' % objc_enum_name)
-        lines.append('{')
-        lines.append('    switch(value) {')
-        for enum_value in enum_values:
-            lines.append('    case %s%s:' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value)))
-            lines.append('        return ASCIILiteral(&quot;%s&quot;);' % enum_value)
-        lines.append('    }')
-        lines.append('}')
-        return '\n'.join(lines)
-
-    def _generate_enum_from_protocol_string(self, objc_enum_name, enum_values):
-        lines = []
-        lines.append('template&lt;&gt;')
-        lines.append('inline %s fromProtocolString(String value)' % objc_enum_name)
-        lines.append('{')
-        for enum_value in enum_values:
-            lines.append('    if (value == &quot;%s&quot;)' % enum_value)
-            lines.append('        return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value)))
-        lines.append('    ASSERT_NOT_REACHED();')
-        lines.append('    return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_values[0])))
-        lines.append('}')
-        return '\n'.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_frontend_dispatcher_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,150 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator, ucfirst
-from generator_templates import GeneratorTemplates as Templates
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCFrontendDispatcherImplementationGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sEventDispatchers.mm' % ObjCGenerator.OBJC_PREFIX
-
-    def domains_to_generate(self):
-        return filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), Generator.domains_to_generate(self))
-
-    def generate_output(self):
-        secondary_headers = [
-            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&lt;JavaScriptCore/InspectorFrontendChannel.h&gt;',
-            '&lt;JavaScriptCore/InspectorValues.h&gt;',
-        ]
-
-        header_args = {
-            'primaryInclude': '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCImplementationPrelude).substitute(None, **header_args))
-        sections.extend(map(self._generate_event_dispatcher_implementations, domains))
-        sections.append(Template(Templates.ObjCImplementationPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_event_dispatcher_implementations(self, domain):
-        if not domain.events:
-            return ''
-
-        lines = []
-        objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-        lines.append('@implementation %s' % objc_name)
-        lines.append('{')
-        lines.append('    AugmentableInspectorController* _controller;')
-        lines.append('}')
-        lines.append('')
-        lines.append('- (instancetype)initWithController:(AugmentableInspectorController*)controller;')
-        lines.append('{')
-        lines.append('    self = [super init];')
-        lines.append('    if (!self)')
-        lines.append('        return nil;')
-        lines.append('    ASSERT(controller);')
-        lines.append('    _controller = controller;')
-        lines.append('    return self;')
-        lines.append('}')
-        lines.append('')
-        for event in domain.events:
-            lines.append(self._generate_event(domain, event))
-            lines.append('')
-        lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_event(self, domain, event):
-        lines = []
-        lines.append(self._generate_event_signature(domain, event))
-        lines.append('{')
-        lines.append('    InspectorFrontendChannel* frontendChannel = _controller-&gt;frontendChannel();')
-        lines.append('    if (!frontendChannel)')
-        lines.append('        return;')
-        lines.append('')
-
-        required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), event.event_parameters)
-        for parameter in required_pointer_parameters:
-            var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-            lines.append('    THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
-
-        optional_pointer_parameters = filter(lambda parameter: parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), event.event_parameters)
-        for parameter in optional_pointer_parameters:
-            var_name = ObjCGenerator.identifier_to_objc_identifier(parameter.parameter_name)
-            lines.append('    THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(%s, @&quot;%s&quot;);' % (var_name, var_name))
-
-        if required_pointer_parameters or optional_pointer_parameters:
-            lines.append('')
-
-        lines.append('    RefPtr&lt;InspectorObject&gt; jsonMessage = InspectorObject::create();')
-        lines.append('    jsonMessage-&gt;setString(ASCIILiteral(&quot;method&quot;), ASCIILiteral(&quot;%s.%s&quot;));' % (domain.domain_name, event.event_name))
-        if event.event_parameters:
-            lines.extend(self._generate_event_out_parameters(domain, event))
-        lines.append('    frontendChannel-&gt;sendMessageToFrontend(jsonMessage-&gt;toJSONString());')
-        lines.append('}')
-        return '\n'.join(lines)
-
-    def _generate_event_signature(self, domain, event):
-        if not event.event_parameters:
-            return '- (void)%s' % event.event_name
-        pairs = []
-        for parameter in event.event_parameters:
-            param_name = parameter.parameter_name
-            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, event.event_name, parameter), param_name))
-        pairs[0] = ucfirst(pairs[0])
-        return '- (void)%sWith%s' % (event.event_name, ' '.join(pairs))
-
-    def _generate_event_out_parameters(self, domain, event):
-        lines = []
-        lines.append('    RefPtr&lt;InspectorObject&gt; paramsObject = InspectorObject::create();')
-        for parameter in event.event_parameters:
-            keyed_set_method = Generator.keyed_set_method_for_type(parameter.type)
-            var_name = parameter.parameter_name
-            safe_var_name = '(*%s)' % var_name if parameter.is_optional else var_name
-            export_expression = ObjCGenerator.objc_protocol_export_expression_for_variable(parameter.type, safe_var_name)
-            if not parameter.is_optional:
-                lines.append('    paramsObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
-            else:
-                lines.append('    if (%s)' % (parameter.parameter_name))
-                lines.append('        paramsObject-&gt;%s(ASCIILiteral(&quot;%s&quot;), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
-        lines.append('    jsonMessage-&gt;setObject(ASCIILiteral(&quot;params&quot;), paramsObject);')
-        return lines
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,227 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator, join_type_and_name
-from generator import Generator, ucfirst
-from generator_templates import GeneratorTemplates as Templates
-from models import ObjectType, EnumType
-
-log = logging.getLogger('global')
-
-
-def add_newline(lines):
-    if lines and lines[-1] == '':
-        return
-    lines.append('')
-
-
-class ObjectiveCHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%s.h' % ObjCGenerator.OBJC_PREFIX
-
-    def generate_output(self):
-        headers = set([
-            '&lt;WebInspector/RWIProtocolJSONObject.h&gt;',
-        ])
-
-        header_args = {
-            'includes': '\n'.join(['#import ' + header for header in sorted(headers)]),
-        }
-
-        domains = self.domains_to_generate()
-        type_domains = filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), domains)
-        command_domains = filter(ObjCGenerator.should_generate_domain_command_handler_filter(self.model()), domains)
-        event_domains = filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), domains)
-
-        # FIXME: &lt;https://webkit.org/b/138222&gt; Web Inspector: Reduce unnecessary enums/types generated in ObjC Protocol Interfaces
-        # Currently we generate enums/types for all types in the type_domains. For the built-in
-        # JSC domains (Debugger, Runtime) this produces extra unused types. We only need to
-        # generate these types if they are referenced by the command_domains or event_domains.
-
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCHeaderPrelude).substitute(None, **header_args))
-        sections.append('\n'.join(filter(None, map(self._generate_forward_declarations, type_domains))))
-        sections.append('\n'.join(filter(None, map(self._generate_enums, type_domains))))
-        sections.append('\n'.join(filter(None, map(self._generate_types, type_domains))))
-        sections.append('\n\n'.join(filter(None, map(self._generate_command_protocols, command_domains))))
-        sections.append('\n\n'.join(filter(None, map(self._generate_event_interfaces, event_domains))))
-        sections.append(Template(Templates.ObjCHeaderPostlude).substitute(None))
-        return '\n\n'.join(sections)
-
-    def _generate_forward_declarations(self, domain):
-        lines = []
-        for declaration in domain.type_declarations:
-            if (isinstance(declaration.type, ObjectType)):
-                objc_name = ObjCGenerator.objc_name_for_type(declaration.type)
-                lines.append('@class %s;' % objc_name)
-        return '\n'.join(lines)
-
-    def _generate_enums(self, domain):
-        lines = []
-
-        # Type enums and member enums.
-        for declaration in domain.type_declarations:
-            if isinstance(declaration.type, EnumType):
-                add_newline(lines)
-                lines.append(self._generate_anonymous_enum_for_declaration(domain, declaration))
-            else:
-                for member in declaration.type_members:
-                    if isinstance(member.type, EnumType) and member.type.is_anonymous:
-                        add_newline(lines)
-                        lines.append(self._generate_anonymous_enum_for_member(domain, declaration, member))
-
-        # Anonymous command enums.
-        for command in domain.commands:
-            for parameter in command.call_parameters:
-                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_for_parameter(domain, command.command_name, parameter))
-            for parameter in command.return_parameters:
-                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_for_parameter(domain, command.command_name, parameter))
-
-        # Anonymous event enums.
-        for event in domain.events:
-            for parameter in event.event_parameters:
-                if isinstance(parameter.type, EnumType) and parameter.type.is_anonymous:
-                    add_newline(lines)
-                    lines.append(self._generate_anonymous_enum_for_parameter(domain, event.event_name, parameter))
-
-        return '\n'.join(lines)
-
-    def _generate_types(self, domain):
-        lines = []
-        # Type interfaces.
-        for declaration in domain.type_declarations:
-            if isinstance(declaration.type, ObjectType):
-                add_newline(lines)
-                lines.append(self._generate_type_interface(domain, declaration))
-        return '\n'.join(lines)
-
-    def _generate_anonymous_enum_for_declaration(self, domain, declaration):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration(declaration)
-        return self._generate_enum(objc_enum_name, declaration.type.enum_values())
-
-    def _generate_anonymous_enum_for_member(self, domain, declaration, member):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
-        return self._generate_enum(objc_enum_name, member.type.enum_values())
-
-    def _generate_anonymous_enum_for_parameter(self, domain, event_or_command_name, parameter):
-        objc_enum_name = ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
-        return self._generate_enum(objc_enum_name, parameter.type.enum_values())
-
-    def _generate_enum(self, enum_name, enum_values):
-        lines = []
-        lines.append('typedef NS_ENUM(NSInteger, %s) {' % enum_name)
-        for enum_value in enum_values:
-            lines.append('    %s%s,' % (enum_name, Generator.stylized_name_for_enum_value(enum_value)))
-        lines.append('};')
-        return '\n'.join(lines)
-
-    def _generate_type_interface(self, domain, declaration):
-        lines = []
-        objc_name = ObjCGenerator.objc_name_for_type(declaration.type)
-        lines.append('@interface %s : %s' % (objc_name, ObjCGenerator.OBJC_JSON_OBJECT_BASE))
-        required_members = filter(lambda member: not member.is_optional, declaration.type_members)
-        optional_members = filter(lambda member: member.is_optional, declaration.type_members)
-        if required_members:
-            lines.append(self._generate_init_method_for_required_members(domain, declaration, required_members))
-        for member in required_members:
-            lines.append('/* required */ ' + self._generate_member_property(declaration, member))
-        for member in optional_members:
-            lines.append('/* optional */ ' + self._generate_member_property(declaration, member))
-        lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_init_method_for_required_members(self, domain, declaration, required_members):
-        pairs = []
-        for member in required_members:
-            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-            pairs.append('%s:(%s)%s' % (var_name, objc_type, var_name))
-        pairs[0] = ucfirst(pairs[0])
-        return '- (instancetype)initWith%s;' % ' '.join(pairs)
-
-    def _generate_member_property(self, declaration, member):
-        accessor_type = ObjCGenerator.objc_accessor_type_for_member(member)
-        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-        return '@property (nonatomic, %s) %s;' % (accessor_type, join_type_and_name(objc_type, ObjCGenerator.identifier_to_objc_identifier(member.member_name)))
-
-    def _generate_command_protocols(self, domain):
-        lines = []
-        if domain.commands:
-            objc_name = '%s%sDomainHandler' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-            lines.append('@protocol %s &lt;NSObject&gt;' % objc_name)
-            lines.append('@required')
-            for command in domain.commands:
-                lines.append(self._generate_single_command_protocol(domain, command))
-            lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_single_command_protocol(self, domain, command):
-        pairs = []
-        pairs.append('ErrorCallback:(void(^)(NSString *error))errorCallback')
-        pairs.append('successCallback:(%s)successCallback' % self._callback_block_for_command(domain, command))
-        for parameter in command.call_parameters:
-            param_name = parameter.parameter_name
-            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter), param_name))
-        return '- (void)%sWith%s;' % (command.command_name, ' '.join(pairs))
-
-    def _callback_block_for_command(self, domain, command):
-        pairs = []
-        for parameter in command.return_parameters:
-            pairs.append(join_type_and_name(ObjCGenerator.objc_type_for_param(domain, command.command_name, parameter), parameter.parameter_name))
-        return 'void(^)(%s)' % ', '.join(pairs)
-
-    def _generate_event_interfaces(self, domain):
-        lines = []
-        if domain.events:
-            objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-            lines.append('@interface %s : NSObject' % objc_name)
-            for event in domain.events:
-                lines.append(self._generate_single_event_interface(domain, event))
-            lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_single_event_interface(self, domain, event):
-        if not event.event_parameters:
-            return '- (void)%s;' % event.event_name
-        pairs = []
-        for parameter in event.event_parameters:
-            param_name = parameter.parameter_name
-            pairs.append('%s:(%s)%s' % (param_name, ObjCGenerator.objc_type_for_param(domain, event.event_name, parameter), param_name))
-        pairs[0] = ucfirst(pairs[0])
-        return '- (void)%sWith%s;' % (event.event_name, ' '.join(pairs))
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_internal_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator, ucfirst
-from generator_templates import GeneratorTemplates as Templates
-
-log = logging.getLogger('global')
-
-
-class ObjectiveCTypesInternalHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sInternal.h' % ObjCGenerator.OBJC_PREFIX
-
-    def generate_output(self):
-        headers = set([
-            '&quot;%s.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&quot;RWIProtocolJSONObjectInternal.h&quot;',
-            '&lt;JavaScriptCore/InspectorValues.h&gt;',
-            '&lt;JavaScriptCore/AugmentableInspectorController.h&gt;',
-        ])
-
-        header_args = {
-            'includes': '\n'.join(['#import ' + header for header in sorted(headers)]),
-        }
-
-        domains = self.domains_to_generate()
-        event_domains = filter(ObjCGenerator.should_generate_domain_event_dispatcher_filter(self.model()), domains)
-
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCGenericHeaderPrelude).substitute(None, **header_args))
-        sections.append('\n\n'.join(filter(None, map(self._generate_event_dispatcher_private_interfaces, event_domains))))
-        sections.append(Template(Templates.ObjCGenericHeaderPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def _generate_event_dispatcher_private_interfaces(self, domain):
-        lines = []
-        if domain.events:
-            objc_name = '%s%sDomainEventDispatcher' % (ObjCGenerator.OBJC_PREFIX, domain.domain_name)
-            lines.append('@interface %s (Private)' % objc_name)
-            lines.append('- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;')
-            lines.append('@end')
-        return '\n'.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_c_types_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,155 +0,0 @@
</span><del>-#!/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 generate_objective_c import ObjCGenerator
-from generator import Generator, ucfirst
-from generator_templates import GeneratorTemplates as Templates
-from models import ObjectType
-
-log = logging.getLogger('global')
-
-
-def add_newline(lines):
-    if lines and lines[-1] == '':
-        return
-    lines.append('')
-
-
-class ObjectiveCTypesImplementationGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return '%sTypes.mm' % ObjCGenerator.OBJC_PREFIX
-
-    def domains_to_generate(self):
-        return filter(ObjCGenerator.should_generate_domain_types_filter(self.model()), Generator.domains_to_generate(self))
-
-    def generate_output(self):
-        secondary_headers = [
-            '&quot;%sEnumConversionHelpers.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            '&lt;JavaScriptCore/InspectorValues.h&gt;',
-            '&lt;wtf/Assertions.h&gt;',
-            '&lt;wtf/PassRefPtr.h&gt;',
-        ]
-
-        header_args = {
-            'primaryInclude': '&quot;%sInternal.h&quot;' % ObjCGenerator.OBJC_PREFIX,
-            'secondaryIncludes': '\n'.join(['#import %s' % header for header in secondary_headers]),
-        }
-
-        domains = self.domains_to_generate()
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.ObjCImplementationPrelude).substitute(None, **header_args))
-        sections.extend(map(self.generate_type_implementations, domains))
-        sections.append(Template(Templates.ObjCImplementationPostlude).substitute(None, **header_args))
-        return '\n\n'.join(sections)
-
-    def generate_type_implementations(self, domain):
-        lines = []
-        for declaration in domain.type_declarations:
-            if (isinstance(declaration.type, ObjectType)):
-                add_newline(lines)
-                lines.append(self.generate_type_implementation(domain, declaration))
-        return '\n'.join(lines)
-
-    def generate_type_implementation(self, domain, declaration):
-        lines = []
-        lines.append('@implementation %s' % ObjCGenerator.objc_name_for_type(declaration.type))
-        required_members = filter(lambda member: not member.is_optional, declaration.type_members)
-        if required_members:
-            lines.append('')
-            lines.append(self._generate_init_method_for_required_members(domain, declaration, required_members))
-        for member in declaration.type_members:
-            lines.append('')
-            lines.append(self._generate_setter_for_member(domain, declaration, member))
-            lines.append('')
-            lines.append(self._generate_getter_for_member(domain, declaration, member))
-        lines.append('')
-        lines.append('@end')
-        return '\n'.join(lines)
-
-    def _generate_init_method_for_required_members(self, domain, declaration, required_members):
-        pairs = []
-        for member in required_members:
-            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-            pairs.append('%s:(%s)%s' % (var_name, objc_type, var_name))
-        pairs[0] = ucfirst(pairs[0])
-        lines = []
-        lines.append('- (instancetype)initWith%s;' % ' '.join(pairs))
-        lines.append('{')
-        lines.append('    self = [super init];')
-        lines.append('    if (!self)')
-        lines.append('        return nil;')
-        lines.append('')
-
-        required_pointer_members = filter(lambda member: ObjCGenerator.is_type_objc_pointer_type(member.type), required_members)
-        if required_pointer_members:
-            for member in required_pointer_members:
-                var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-                lines.append('    THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(%s, @&quot;%s&quot;);' % (var_name, var_name))
-            lines.append('')
-
-        for member in required_members:
-            var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-            lines.append('    self.%s = %s;' % (var_name, var_name))
-
-        lines.append('')
-        lines.append('    return self;')
-        lines.append('}')
-        return '\n'.join(lines)
-
-    def _generate_setter_for_member(self, domain, declaration, member):
-        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-        var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-        setter_method = ObjCGenerator.objc_setter_method_for_member(declaration, member)
-        conversion_expression = ObjCGenerator.objc_to_protocol_expression_for_member(declaration, member, var_name)
-        lines = []
-        lines.append('- (void)set%s:(%s)%s' % (ucfirst(var_name), objc_type, var_name))
-        lines.append('{')
-        lines.append('    [super %s:%s forKey:@&quot;%s&quot;];' % (setter_method, conversion_expression, member.member_name))
-        lines.append('}')
-        return '\n'.join(lines)
-
-    def _generate_getter_for_member(self, domain, declaration, member):
-        objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
-        var_name = ObjCGenerator.identifier_to_objc_identifier(member.member_name)
-        getter_method = ObjCGenerator.objc_getter_method_for_member(declaration, member)
-        basic_expression = '[super %s:@&quot;%s&quot;]' % (getter_method, member.member_name)
-        conversion_expression = ObjCGenerator.protocol_to_objc_expression_for_member(declaration, member, basic_expression)
-        lines = []
-        lines.append('- (%s)%s' % (objc_type, var_name))
-        lines.append('{')
-        lines.append('    return %s;' % conversion_expression)
-        lines.append('}')
-        return '\n'.join(lines)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_headerpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,340 +0,0 @@
</span><del>-#!/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 ProtocolTypesHeaderGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return &quot;InspectorProtocolObjects.h&quot;
-
-    def generate_output(self):
-        domains = self.domains_to_generate()
-        self.calculate_types_requiring_shape_assertions(domains)
-
-        headers = set([
-            '&lt;inspector/InspectorProtocolTypes.h&gt;',
-            '&lt;wtf/Assertions.h&gt;',
-            '&lt;wtf/PassRefPtr.h&gt;'
-        ])
-
-        export_macro = self.model().framework.setting('export_macro', None)
-
-        header_args = {
-            'headerGuardString': re.sub('\W+', '_', self.output_filename()),
-            'includes': '\n'.join(['#include ' + header for header in sorted(headers)]),
-            'typedefs': '',
-        }
-
-        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 Protocol {')
-        sections.append(self._generate_forward_declarations(domains))
-        sections.append(self._generate_typedefs(domains))
-        sections.append('%s getEnumConstantValue(int code);' % ' '.join(return_type_with_export_macro))
-        sections.append('\n'.join([
-            'template&lt;typename T&gt; %s getEnumConstantValue(T enumValue)' % return_type,
-            '{',
-            '    return getEnumConstantValue(static_cast&lt;int&gt;(enumValue));',
-            '}']))
-
-        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 Protocol')
-        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(self.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 self.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 self.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.ProtocolObjectBuilderDeclarationPrelude).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.ProtocolObjectBuilderDeclarationPostlude).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:
-                export_macro = self.model().framework.setting('export_macro', None)
-                lines.append('    %s static const char* %s;' % (export_macro, 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),
-            '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::Protocol::getEnumConstantValue(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),
-            '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::Protocol::getEnumConstantValue(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.protocol_type_string_for_type_member(type_member, type_declaration), False))
-
-                if isinstance(type_declaration.type, ObjectType):
-                    type_arguments.append((Generator.protocol_type_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)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_protocol_types_implementationpy"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -1,180 +0,0 @@
</span><del>-#!/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 ProtocolTypesImplementationGenerator(Generator):
-    def __init__(self, model, input_filepath):
-        Generator.__init__(self, model, input_filepath)
-
-    def output_filename(self):
-        return &quot;InspectorProtocolObjects.cpp&quot;
-
-    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;InspectorProtocolObjects.h&quot;',
-            'secondaryIncludes': &quot;\n&quot;.join(['#include %s' % header for header in secondary_headers]),
-        }
-
-        sections = []
-        sections.append(self.generate_license())
-        sections.append(Template(Templates.CppImplementationPrelude).substitute(None, **header_args))
-        sections.append('namespace Protocol {')
-        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 Protocol')
-        sections.append(Template(Templates.CppImplementationPostlude).substitute(None, **header_args))
-
-        return &quot;\n\n&quot;.join(sections)
-
-    # Private methods.
-
-    def _generate_enum_mapping(self):
-        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 getEnumConstantValue(int code) {')
-        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', 'Protocol', 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.protocol_type_string_for_type(object_declaration.type)
-        }
-        return Template(Templates.ProtocolObjectRuntimeCast).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.protocol_type_string_for_type(object_declaration.type)))
-        lines.append(&quot;&quot;&quot;{
-    RefPtr&lt;InspectorObject&gt; object;
-    bool castSucceeded = value-&gt;asObject(object);
-    ASSERT_UNUSED(castSucceeded, castSucceeded);&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 result;')
-        lines.append('    bool castSucceeded = value-&gt;asString(result);')
-        lines.append('    ASSERT(castSucceeded);')
-
-        assert_condition = ' || '.join(['result == &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)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengeneratorpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -38,15 +38,6 @@
</span><span class="cx"> def ucfirst(str):
</span><span class="cx">     return str[:1].upper() + str[1:]
</span><span class="cx"> 
</span><del>-_PRIMITIVE_TO_CPP_NAME_MAP = {
-    'boolean': 'bool',
-    'integer': 'int',
-    'number': 'double',
-    'string': 'String',
-    'object': 'Inspector::InspectorObject',
-    'any': 'Inspector::InspectorValue'
-}
-
</del><span class="cx"> _ALWAYS_UPPERCASED_ENUM_VALUE_SUBSTRINGS = set(['API', 'CSS', 'DOM', 'HTML', 'XHR', 'XML'])
</span><span class="cx"> 
</span><span class="cx"> # These objects are built manually by creating and setting InspectorValues.
</span><span class="lines">@@ -231,249 +222,6 @@
</span><span class="cx">         return re.sub(re.compile(regex, re.IGNORECASE), replaceCallback, &quot;&quot;.join(subwords))
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><del>-    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 'getInteger'
-            elif _type.raw_name() is 'number':
-                return 'getDouble'
-            elif _type.raw_name() is 'any':
-                return 'getValue'
-            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() is 'integer':
-                return 'setInteger'
-            elif _type.raw_name() is 'number':
-                return 'setDouble'
-            elif _type.raw_name() is '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 protocol_type_string_for_type(_type):
-        if isinstance(_type, ObjectType) and len(_type.members) == 0:
-            return 'Inspector::InspectorObject'
-        if isinstance(_type, (ObjectType, AliasedType, EnumType)):
-            return 'Inspector::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
-        if isinstance(_type, ArrayType):
-            return 'Inspector::Protocol::Array&lt;%s&gt;' % Generator.protocol_type_string_for_type(_type.element_type)
-        if isinstance(_type, PrimitiveType):
-            return Generator.cpp_name_for_primitive_type(_type)
-
-    @staticmethod
-    def protocol_type_string_for_type_member(type_member, object_declaration):
-        if isinstance(type_member.type, EnumType) and type_member.type.is_anonymous:
-            return '::'.join([Generator.protocol_type_string_for_type(object_declaration.type), ucfirst(type_member.member_name)])
-        else:
-            return Generator.protocol_type_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.protocol_type_string_for_type(_type)
-        if isinstance(_type, AliasedType):
-            builder_type = Generator.protocol_type_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::Protocol::%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.protocol_type_string_for_type(_type)
-        if isinstance(_type, PrimitiveType):
-            cpp_name = Generator.cpp_name_for_primitive_type(_type)
-            if parameter.is_optional:
-                return &quot;Inspector::Protocol::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::Protocol::%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.protocol_type_string_for_type(_type)
-        if isinstance(_type, PrimitiveType):
-            cpp_name = Generator.cpp_name_for_primitive_type(_type)
-            if parameter.is_optional:
-                return &quot;Inspector::Protocol::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::Protocol::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.protocol_type_string_for_type(_type)
-        if isinstance(_type, AliasedType):
-            builder_type = Generator.protocol_type_string_for_type(_type)
-            if parameter.is_optional:
-                return &quot;Inspector::Protocol::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::Protocol::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::Protocol::%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.protocol_type_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.protocol_type_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
</del><span class="cx">     def js_name_for_parameter_type(_type):
</span><span class="cx">         _type = _type
</span><span class="cx">         if isinstance(_type, AliasedType):
</span><span class="lines">@@ -490,12 +238,3 @@
</span><span class="cx">                 return 'number'
</span><span class="cx">             else:
</span><span class="cx">                 return _type.qualified_name()
</span><del>-
-    # 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;)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengenerator_templatespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -59,374 +59,3 @@
</span><span class="cx"> 
</span><span class="cx"> // DO NOT EDIT THIS FILE. It is automatically generated from ${inputFilename}
</span><span class="cx"> // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py&quot;&quot;&quot;)
</span><del>-
-    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;)
-
-    AlternateDispatchersHeaderPrelude = (
-    &quot;&quot;&quot;#ifndef ${headerGuardString}
-#define ${headerGuardString}
-
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-
-${includes}
-
-namespace Inspector {
-
-class AlternateInspectorBackendDispatcher {
-public:
-    void setBackendDispatcher(PassRefPtr&lt;InspectorBackendDispatcher&gt; dispatcher) { m_backendDispatcher = dispatcher; }
-    InspectorBackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
-private:
-    RefPtr&lt;InspectorBackendDispatcher&gt; m_backendDispatcher;
-};
-&quot;&quot;&quot;)
-
-    AlternateDispatchersHeaderPostlude = (
-    &quot;&quot;&quot;} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-
-#endif // !defined(${headerGuardString})&quot;&quot;&quot;)
-
-    AlternateBackendDispatcherHeaderDomainHandlerInterfaceDeclaration = (
-    &quot;&quot;&quot;class AlternateInspector${domainName}BackendDispatcher : public AlternateInspectorBackendDispatcher {
-public:
-    virtual ~AlternateInspector${domainName}BackendDispatcher() { }
-${commandDeclarations}
-};&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;
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-public:
-    void setAlternateDispatcher(AlternateInspector${domainName}BackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
-private:
-    AlternateInspector${domainName}BackendDispatcher* m_alternateDispatcher;
-#endif
-};&quot;&quot;&quot;)
-
-    BackendDispatcherHeaderAsyncCommandDeclaration = (
-    &quot;&quot;&quot;    ${classAndExportMacro} ${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, makeString('\\'', &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, makeString('\\'', &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)
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-    , m_alternateDispatcher(nullptr)
-#endif
-{
-    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;)
-
-    ProtocolObjectBuilderDeclarationPrelude = (
-&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;)
-
-    ProtocolObjectBuilderDeclarationPostlude = (
-&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::Protocol::StructItemTraits ItemTraits;&quot;&quot;&quot;)
-
-    ProtocolObjectRuntimeCast = (
-&quot;&quot;&quot;PassRefPtr&lt;${objectType}&gt; BindingTraits&lt;${objectType}&gt;::runtimeCast(PassRefPtr&lt;Inspector::InspectorValue&gt; value)
-{
-    RefPtr&lt;Inspector::InspectorObject&gt; result;
-    bool castSucceeded = value-&gt;asObject(result);
-    ASSERT_UNUSED(castSucceeded, castSucceeded);
-#if !ASSERT_DISABLED
-    BindingTraits&lt;${objectType}&gt;::assertValueHasExpectedType(result.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;(result.get()));
-}
-&quot;&quot;&quot;)
-
-    ObjCHeaderPrelude = (
-    &quot;&quot;&quot;#import &lt;Foundation/Foundation.h&gt;
-
-${includes}
-&quot;&quot;&quot;)
-
-    ObjCHeaderPostlude = (
-    &quot;&quot;&quot;&quot;&quot;&quot;)
-
-    ObjCConversionHelpersPrelude = (
-    &quot;&quot;&quot;${includes}
-
-namespace Inspector {&quot;&quot;&quot;)
-
-    ObjCConversionHelpersPostlude = (
-    &quot;&quot;&quot;} // namespace Inspector
-&quot;&quot;&quot;)
-
-    ObjCGenericHeaderPrelude = (
-    &quot;&quot;&quot;${includes}&quot;&quot;&quot;)
-
-    ObjCGenericHeaderPostlude = (
-    &quot;&quot;&quot;&quot;&quot;&quot;)
-
-    ObjCConversionHelpersStandard = (
-    &quot;&quot;&quot;template&lt;typename ObjCEnumType&gt;
-ObjCEnumType fromProtocolString(String value);&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherHeaderPrelude = (
-    &quot;&quot;&quot;${includes}
-
-${forwardDeclarations}
-
-namespace Inspector {
-&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherHeaderPostlude = (
-    &quot;&quot;&quot;} // namespace Inspector
-&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherImplementationPrelude = (
-    &quot;&quot;&quot;#import &quot;config.h&quot;
-#import ${primaryInclude}
-
-${secondaryIncludes}
-
-namespace Inspector {&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherImplementationPostlude = (
-    &quot;&quot;&quot;} // namespace Inspector
-&quot;&quot;&quot;)
-
-    ObjCImplementationPrelude = (
-    &quot;&quot;&quot;#import &quot;config.h&quot;
-#import ${primaryInclude}
-
-${secondaryIncludes}
-
-using namespace Inspector;&quot;&quot;&quot;)
-
-    ObjCImplementationPostlude = (
-    &quot;&quot;&quot;&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherHeaderDomainHandlerInterfaceDeclaration = (
-    &quot;&quot;&quot;class AlternateInspector${domainName}BackendDispatcher : public AlternateInspectorBackendDispatcher {
-public:
-    virtual ~AlternateInspector${domainName}BackendDispatcher() { }
-${commandDeclarations}
-};&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherHeaderDomainHandlerObjCDeclaration = (
-    &quot;&quot;&quot;class ObjCInspector${domainName}BackendDispatcher final : public AlternateInspector${domainName}BackendDispatcher {
-public:
-    ObjCInspector${domainName}BackendDispatcher(id&lt;${objcPrefix}${domainName}DomainHandler&gt; handler) { m_delegate = handler; }
-${commandDeclarations}
-private:
-    RetainPtr&lt;id&lt;${objcPrefix}${domainName}DomainHandler&gt;&gt; m_delegate;
-};&quot;&quot;&quot;)
-
-    ObjCBackendDispatcherHeaderDomainHandlerImplementation = (
-    &quot;&quot;&quot;void ObjCInspector${domainName}BackendDispatcher::${commandName}(${parameters})
-{
-    id errorCallback = ^(NSString *error) {
-        backendDispatcher()-&gt;sendResponse(callId, InspectorObject::create(), error);
-    };
-
-${successCallback}
-${conversions}
-${invocation}
-}
-&quot;&quot;&quot;)
-
-    ObjCConfigurationCommandProperty = (
-    &quot;&quot;&quot;@property (nonatomic, retain, setter=set${domainName}Handler:) id&lt;${objcPrefix}${domainName}DomainHandler&gt; ${variableNamePrefix}Handler;&quot;&quot;&quot;)
-
-    ObjCConfigurationEventProperty = (
-    &quot;&quot;&quot;@property (nonatomic, readonly) ${objcPrefix}${domainName}DomainEventDispatcher *${variableNamePrefix}EventDispatcher;&quot;&quot;&quot;)
-
-    ObjCConfigurationCommandPropertyImplementation = (
-    &quot;&quot;&quot;- (void)set${domainName}Handler:(id&lt;${objcPrefix}${domainName}DomainHandler&gt;)handler
-{
-    if (handler == _${variableNamePrefix}Handler)
-        return;
-
-    [_${variableNamePrefix}Handler release];
-    _${variableNamePrefix}Handler = [handler retain];
-
-    auto alternateDispatcher = std::make_unique&lt;ObjCInspector${domainName}BackendDispatcher&gt;(handler);
-    auto alternateAgent = std::make_unique&lt;AlternateDispatchableAgent&lt;Inspector${domainName}BackendDispatcher, AlternateInspector${domainName}BackendDispatcher&gt;&gt;(ASCIILiteral(&quot;${domainName}&quot;), WTF::move(alternateDispatcher));
-    _controller-&gt;appendExtraAgent(WTF::move(alternateAgent));
-}
-
-- (id&lt;${objcPrefix}${domainName}DomainHandler&gt;)${variableNamePrefix}Handler
-{
-    return _${variableNamePrefix}Handler;
-}&quot;&quot;&quot;)
-
-    ObjCConfigurationGetterImplementation = (
-    &quot;&quot;&quot;- (${objcPrefix}${domainName}DomainEventDispatcher *)${variableNamePrefix}EventDispatcher
-{
-    if (!_${variableNamePrefix}EventDispatcher)
-        _${variableNamePrefix}EventDispatcher = [[${objcPrefix}${domainName}DomainEventDispatcher alloc] initWithController:_controller];
-    return _${variableNamePrefix}EventDispatcher;
-}&quot;&quot;&quot;)
</del><span class="cx">Property changes on: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="delfile"><h4>Deleted: svn:executable</h4></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegenobjc_generatorpyfromrev176327trunkSourceJavaScriptCoreinspectorscriptscodegengenerate_objective_cpy"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py (from rev 176327, trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py) (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,515 @@
</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 logging
+from generator import Generator, ucfirst
+from models import PrimitiveType, ObjectType, ArrayType, EnumType, AliasedType, Frameworks
+
+log = logging.getLogger('global')
+
+
+def join_type_and_name(type_str, name_str):
+    if type_str.endswith('*'):
+        return type_str + name_str
+    return type_str + ' ' + name_str
+
+
+def strip_block_comment_markers(str):
+    return str.replace('/*', '').replace('*/', '')
+
+
+def remove_duplicate_from_str(str, possible_duplicate):
+    return str.replace(possible_duplicate + possible_duplicate, possible_duplicate)
+
+
+_OBJC_IDENTIFIER_RENAME_MAP = {
+    'this': 'thisObject',  # Debugger.CallFrame.this
+    'description': 'stringRepresentation',  # Runtime.RemoteObject.description
+    'id': 'identifier',  # Page.Frame.id, Runtime.ExecutionContextDescription.id, Debugger.BreakpointAction.id
+}
+
+_OBJC_IDENTIFIER_REVERSE_RENAME_MAP = dict((v, k) for k, v in _OBJC_IDENTIFIER_RENAME_MAP.iteritems())
+
+
+class ObjCTypeCategory:
+    Simple = 0
+    String = 1
+    Object = 2
+    Array = 3
+
+    @staticmethod
+    def category_for_type(_type):
+        if (isinstance(_type, PrimitiveType)):
+            if _type.raw_name() is 'string':
+                return ObjCTypeCategory.String
+            if  _type.raw_name() in ['object', 'any']:
+                return ObjCTypeCategory.Object
+            if _type.raw_name() is 'array':
+                return ObjCTypeCategory.Array
+            return ObjCTypeCategory.Simple
+        if (isinstance(_type, ObjectType)):
+            return ObjCTypeCategory.Object
+        if (isinstance(_type, ArrayType)):
+            return ObjCTypeCategory.Array
+        if (isinstance(_type, AliasedType)):
+            return ObjCTypeCategory.category_for_type(_type.aliased_type)
+        if (isinstance(_type, EnumType)):
+            return ObjCTypeCategory.category_for_type(_type.primitive_type)
+        return None
+
+
+
+# This class contains extra static methods used for generation, but does
+# not participate in any inheritance hierarchy. File generators should
+# extend the generic &quot;Generator&quot; class instead.
+class ObjCGenerator:
+    OBJC_PREFIX = 'RWIProtocol'
+    OBJC_JSON_OBJECT_BASE = '%sJSONObject' % OBJC_PREFIX
+
+    # Adjust identifier names that collide with ObjC keywords.
+
+    @staticmethod
+    def identifier_to_objc_identifier(name):
+        return _OBJC_IDENTIFIER_RENAME_MAP.get(name, name)
+
+    @staticmethod
+    def objc_identifier_to_identifier(name):
+        return _OBJC_IDENTIFIER_REVERSE_RENAME_MAP.get(name, name)
+
+    # Generate ObjC types, command handlers, and event dispatchers for a subset of domains.
+
+    DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', 'Page']
+
+    @staticmethod
+    def should_generate_domain_types_filter(model):
+        def should_generate_domain_types(domain):
+            if model.framework is Frameworks.Test:
+                return True
+            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+            whitelist.update(set(['Console', 'Debugger', 'Runtime']))
+            return domain.domain_name in whitelist
+        return should_generate_domain_types
+
+    @staticmethod
+    def should_generate_domain_command_handler_filter(model):
+        def should_generate_domain_command_handler(domain):
+            if model.framework is Frameworks.Test:
+                return True
+            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+            return domain.domain_name in whitelist
+        return should_generate_domain_command_handler
+
+    @staticmethod
+    def should_generate_domain_event_dispatcher_filter(model):
+        def should_generate_domain_event_dispatcher(domain):
+            if model.framework is Frameworks.Test:
+                return True
+            whitelist = set(ObjCGenerator.DOMAINS_TO_GENERATE)
+            whitelist.add('Console')
+            return domain.domain_name in whitelist
+        return should_generate_domain_event_dispatcher
+
+    # ObjC enum and type names.
+
+    @staticmethod
+    def objc_name_for_type(type):
+        name = type.qualified_name().replace('.', '')
+        name = remove_duplicate_from_str(name, type.type_domain().domain_name)
+        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
+
+    @staticmethod
+    def objc_enum_name_for_anonymous_enum_declaration(declaration):
+        domain_name = declaration.type.type_domain().domain_name
+        name = '%s%s' % (domain_name, declaration.type.raw_name())
+        name = remove_duplicate_from_str(name, domain_name)
+        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
+
+    @staticmethod
+    def objc_enum_name_for_anonymous_enum_member(declaration, member):
+        domain_name = member.type.type_domain().domain_name
+        name = '%s%s%s' % (domain_name, declaration.type.raw_name(), ucfirst(member.member_name))
+        name = remove_duplicate_from_str(name, domain_name)
+        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
+
+    @staticmethod
+    def objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter):
+        domain_name = domain.domain_name
+        name = '%s%s%s' % (domain_name, ucfirst(event_or_command_name), ucfirst(parameter.parameter_name))
+        name = remove_duplicate_from_str(name, domain_name)
+        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
+
+    @staticmethod
+    def objc_enum_name_for_non_anonymous_enum(_type):
+        domain_name = _type.type_domain().domain_name
+        name = _type.qualified_name().replace('.', '')
+        name = remove_duplicate_from_str(name, domain_name)
+        return '%s%s' % (ObjCGenerator.OBJC_PREFIX, name)
+
+    # Miscellaneous name handling.
+
+    @staticmethod
+    def variable_name_prefix_for_domain(domain):
+        domain_name = domain.domain_name
+        if domain_name.startswith('DOM'):
+            return 'dom' + domain_name[3:]
+        if domain_name.startswith('CSS'):
+            return 'css' + domain_name[3:]
+        return domain_name[:1].lower() + domain_name[1:]
+
+    # Type basics.
+
+    @staticmethod
+    def objc_accessor_type_for_raw_name(raw_name):
+        if raw_name in ['string', 'array']:
+            return 'copy'
+        if raw_name in ['integer', 'number', 'boolean']:
+            return 'assign'
+        if raw_name in ['any', 'object']:
+            return 'retain'
+        return None
+
+    @staticmethod
+    def objc_type_for_raw_name(raw_name):
+        if raw_name is 'string':
+            return 'NSString *'
+        if raw_name is 'array':
+            return 'NSArray *'
+        if raw_name is 'integer':
+            return 'int'
+        if raw_name is 'number':
+            return 'double'
+        if raw_name is 'boolean':
+            return 'BOOL'
+        if raw_name in ['any', 'object']:
+            return '%s *' % ObjCGenerator.OBJC_JSON_OBJECT_BASE
+        return None
+
+    @staticmethod
+    def objc_class_for_raw_name(raw_name):
+        if raw_name is 'string':
+            return 'NSString'
+        if raw_name is 'array':
+            return 'NSArray'
+        if raw_name in ['integer', 'number', 'boolean']:
+            return 'NSNumber'
+        if raw_name in ['any', 'object']:
+            return ObjCGenerator.OBJC_JSON_OBJECT_BASE
+        return None
+
+    # FIXME: Can these protocol_type functions be removed in favor of C++ generators functions?
+
+    @staticmethod
+    def protocol_type_for_raw_name(raw_name):
+        if raw_name is 'string':
+            return 'String'
+        if raw_name is 'integer':
+            return 'int'
+        if raw_name is 'number':
+            return 'double'
+        if raw_name is 'boolean':
+            return 'bool'
+        if raw_name in ['any', 'object']:
+            return 'InspectorObject'
+        return None
+
+    @staticmethod
+    def protocol_type_for_type(_type):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return ObjCGenerator.protocol_type_for_raw_name(_type.raw_name())
+        if (isinstance(_type, EnumType)):
+            return ObjCGenerator.protocol_type_for_type(_type.primitive_type)
+        if (isinstance(_type, ObjectType)):
+            return 'Inspector::Protocol::%s::%s' % (_type.type_domain().domain_name, _type.raw_name())
+        if (isinstance(_type, ArrayType)):
+            sub_type = ObjCGenerator.protocol_type_for_type(_type.element_type)
+            return 'Inspector::Protocol::Array&lt;%s&gt;' % sub_type
+        return None
+
+    @staticmethod
+    def is_type_objc_pointer_type(_type):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return _type.raw_name() in ['string', 'array', 'any', 'object']
+        if (isinstance(_type, EnumType)):
+            return False
+        if (isinstance(_type, ObjectType)):
+            return True
+        if (isinstance(_type, ArrayType)):
+            return True
+        return None
+
+    @staticmethod
+    def objc_class_for_type(_type):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return ObjCGenerator.objc_class_for_raw_name(_type.raw_name())
+        if (isinstance(_type, EnumType)):
+            return ObjCGenerator.objc_class_for_raw_name(_type.primitive_type.raw_name())
+        if (isinstance(_type, ObjectType)):
+            return ObjCGenerator.objc_name_for_type(_type)
+        if (isinstance(_type, ArrayType)):
+            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
+            return 'NSArray/*&lt;%s&gt;*/' % sub_type
+        return None
+
+    @staticmethod
+    def objc_accessor_type_for_member(member):
+        return ObjCGenerator.objc_accessor_type_for_member_internal(member.type)
+
+    @staticmethod
+    def objc_accessor_type_for_member_internal(_type):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return ObjCGenerator.objc_accessor_type_for_raw_name(_type.raw_name())
+        if (isinstance(_type, EnumType)):
+            return 'assign'
+        if (isinstance(_type, ObjectType)):
+            return 'retain'
+        if (isinstance(_type, ArrayType)):
+            return 'copy'
+        return None
+
+    @staticmethod
+    def objc_type_for_member(declaration, member):
+        return ObjCGenerator.objc_type_for_member_internal(member.type, declaration, member)
+
+    @staticmethod
+    def objc_type_for_member_internal(_type, declaration, member):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return ObjCGenerator.objc_type_for_raw_name(_type.raw_name())
+        if (isinstance(_type, EnumType)):
+            if (_type.is_anonymous):
+                return ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member)
+            return ObjCGenerator.objc_enum_name_for_non_anonymous_enum(_type)
+        if (isinstance(_type, ObjectType)):
+            return ObjCGenerator.objc_name_for_type(_type) + ' *'
+        if (isinstance(_type, ArrayType)):
+            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
+            return 'NSArray/*&lt;%s&gt;*/ *' % sub_type
+        return None
+
+    @staticmethod
+    def objc_type_for_param(domain, event_or_command_name, parameter, respect_optional=True):
+        objc_type = ObjCGenerator.objc_type_for_param_internal(parameter.type, domain, event_or_command_name, parameter)
+        if respect_optional and parameter.is_optional:
+            if objc_type.endswith('*'):
+                return objc_type + '*'
+            return objc_type + ' *'
+        return objc_type
+
+    @staticmethod
+    def objc_type_for_param_internal(_type, domain, event_or_command_name, parameter):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            return ObjCGenerator.objc_type_for_raw_name(_type.raw_name())
+        if (isinstance(_type, EnumType)):
+            if _type.is_anonymous:
+                return ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter)
+            return ObjCGenerator.objc_enum_name_for_non_anonymous_enum(_type)
+        if (isinstance(_type, ObjectType)):
+            return ObjCGenerator.objc_name_for_type(_type) + ' *'
+        if (isinstance(_type, ArrayType)):
+            sub_type = strip_block_comment_markers(ObjCGenerator.objc_class_for_type(_type.element_type))
+            return 'NSArray/*&lt;%s&gt;*/ *' % sub_type
+        return None
+
+    # ObjC &lt;-&gt; Protocol conversion for commands and events.
+    #   - convert a command call parameter received from Protocol to ObjC for handler
+    #   - convert a command return parameter in callback block from ObjC to Protocol to send
+    #   - convert an event parameter from ObjC API to Protocol to send
+
+    @staticmethod
+    def objc_protocol_export_expression_for_variable(var_type, var_name):
+        category = ObjCTypeCategory.category_for_type(var_type)
+        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
+            if isinstance(var_type, EnumType):
+                return 'toProtocolString(%s)' % var_name
+            return var_name
+        if category is ObjCTypeCategory.Object:
+            return '[%s toInspectorObject]' % var_name
+        if category is ObjCTypeCategory.Array:
+            protocol_type = ObjCGenerator.protocol_type_for_type(var_type.element_type)
+            objc_class = ObjCGenerator.objc_class_for_type(var_type.element_type)
+            if protocol_type == 'Inspector::Protocol::Array&lt;String&gt;':
+                return 'inspectorStringArrayArray(%s)' % var_name
+            if protocol_type is 'String' and objc_class is 'NSString':
+                return 'inspectorStringArray(%s)' % var_name
+            if protocol_type is 'int' and objc_class is 'NSNumber':
+                return 'inspectorIntegerArray(%s)' % var_name
+            if protocol_type is 'double' and objc_class is 'NSNumber':
+                return 'inspectorDoubleArray(%s)' % var_name
+            return 'inspectorObjectArray(%s)' % var_name
+
+    @staticmethod
+    def objc_protocol_import_expression_for_member(name, declaration, member):
+        if isinstance(member.type, EnumType):
+            if member.type.is_anonymous:
+                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member), name)
+            return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(member.type), name)
+        return ObjCGenerator.objc_protocol_import_expression_for_variable(member.type, name)
+
+    @staticmethod
+    def objc_protocol_import_expression_for_parameter(name, domain, event_or_command_name, parameter):
+        if isinstance(parameter.type, EnumType):
+            if parameter.type.is_anonymous:
+                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter(domain, event_or_command_name, parameter), name)
+            return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(parameter.type), name)
+        return ObjCGenerator.objc_protocol_import_expression_for_variable(parameter.type, name)
+
+    @staticmethod
+    def objc_protocol_import_expression_for_variable(var_type, var_name):
+        category = ObjCTypeCategory.category_for_type(var_type)
+        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
+            return var_name
+        if category is ObjCTypeCategory.Object:
+            objc_class = ObjCGenerator.objc_class_for_type(var_type)
+            return '[[[%s alloc] initWithInspectorObject:%s] autorelease]' % (objc_class, var_name)
+        if category is ObjCTypeCategory.Array:
+            objc_class = ObjCGenerator.objc_class_for_type(var_type.element_type)
+            if objc_class is 'NSString':
+                return 'objcStringArray(%s)' % var_name
+            if objc_class is 'NSNumber':  # FIXME: Integer or Double?
+                return 'objcIntegerArray(%s)' % var_name
+            return 'objcArray&lt;%s&gt;(%s)' % (objc_class, var_name)
+
+    # ObjC &lt;-&gt; JSON object conversion for types getters/setters.
+    #   - convert a member setter from ObjC API to JSON object setter
+    #   - convert a member getter from JSON object to ObjC API
+
+    @staticmethod
+    def objc_to_protocol_expression_for_member(declaration, member, sub_expression):
+        category = ObjCTypeCategory.category_for_type(member.type)
+        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
+            if isinstance(member.type, EnumType):
+                return 'toProtocolString(%s)' % sub_expression
+            return sub_expression
+        if category is ObjCTypeCategory.Object:
+            return sub_expression
+        if category is ObjCTypeCategory.Array:
+            objc_class = ObjCGenerator.objc_class_for_type(member.type.element_type)
+            if objc_class is 'NSString':
+                return 'inspectorStringArray(%s)' % sub_expression
+            if objc_class is 'NSNumber':
+                protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
+                if protocol_type is 'double':
+                    return 'inspectorDoubleArray(%s)' % sub_expression
+                return 'inspectorIntegerArray(%s)' % sub_expression
+            return 'inspectorObjectArray(%s)' % sub_expression
+
+    @staticmethod
+    def protocol_to_objc_expression_for_member(declaration, member, sub_expression):
+        category = ObjCTypeCategory.category_for_type(member.type)
+        if category in [ObjCTypeCategory.Simple, ObjCTypeCategory.String]:
+            if isinstance(member.type, EnumType):
+                if member.type.is_anonymous:
+                    return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_anonymous_enum_member(declaration, member), sub_expression)
+                return 'fromProtocolString&lt;%s&gt;(%s)' % (ObjCGenerator.objc_enum_name_for_non_anonymous_enum(member.type), sub_expression)
+            return sub_expression
+        if category is ObjCTypeCategory.Object:
+            objc_type = ObjCGenerator.objc_type_for_member(declaration, member)
+            return '(%s)%s' % (objc_type, sub_expression)
+        if category is ObjCTypeCategory.Array:
+            protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
+            objc_class = ObjCGenerator.objc_class_for_type(member.type.element_type)
+            if objc_class is 'NSString':
+                return 'objcStringArray(%s)' % sub_expression
+            if objc_class is 'NSNumber':
+                protocol_type = ObjCGenerator.protocol_type_for_type(member.type.element_type)
+                if protocol_type is 'double':
+                    return 'objcDoubleArray(%s)' % sub_expression
+                return 'objcIntegerArray(%s)' % sub_expression
+            return 'objcArray&lt;%s&gt;(%s)' % (objc_class, sub_expression)
+
+    # JSON object setter/getter selectors for types.
+
+    @staticmethod
+    def objc_setter_method_for_member(declaration, member):
+        return ObjCGenerator.objc_setter_method_for_member_internal(member.type, declaration, member)
+
+    @staticmethod
+    def objc_setter_method_for_member_internal(_type, declaration, member):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            raw_name = _type.raw_name()
+            if raw_name is 'boolean':
+                return 'setBool'
+            if raw_name is 'integer':
+                return 'setInteger'
+            if raw_name is 'number':
+                return 'setDouble'
+            if raw_name is 'string':
+                return 'setString'
+            if raw_name in ['any', 'object']:
+                return 'setObject'
+            if raw_name is 'array':
+                return 'setInspectorArray'
+            return None
+        if (isinstance(_type, EnumType)):
+            return 'setString'
+        if (isinstance(_type, ObjectType)):
+            return 'setObject'
+        if (isinstance(_type, ArrayType)):
+            return 'setInspectorArray'
+        return None
+
+    @staticmethod
+    def objc_getter_method_for_member(declaration, member):
+        return ObjCGenerator.objc_getter_method_for_member_internal(member.type, declaration, member)
+
+    @staticmethod
+    def objc_getter_method_for_member_internal(_type, declaration, member):
+        if (isinstance(_type, AliasedType)):
+            _type = _type.aliased_type
+        if (isinstance(_type, PrimitiveType)):
+            raw_name = _type.raw_name()
+            if raw_name is 'boolean':
+                return 'boolForKey'
+            if raw_name is 'integer':
+                return 'integerForKey'
+            if raw_name is 'number':
+                return 'doubleForKey'
+            if raw_name is 'string':
+                return 'stringForKey'
+            if raw_name in ['any', 'object']:
+                return 'objectForKey'
+            if raw_name is 'array':
+                return 'inspectorArrayForKey'
+            return None
+        if (isinstance(_type, EnumType)):
+            return 'stringForKey'
+        if (isinstance(_type, ObjectType)):
+            return 'objectForKey'
+        if (isinstance(_type, ArrayType)):
+            return 'inspectorArrayForKey'
+        return None
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegenobjc_generator_templatespy"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py (0 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py                                (rev 0)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -0,0 +1,155 @@
</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 ObjCGeneratorTemplates:
+
+    HeaderPrelude = (
+    &quot;&quot;&quot;#import &lt;Foundation/Foundation.h&gt;
+
+${includes}
+&quot;&quot;&quot;)
+
+    HeaderPostlude = (
+    &quot;&quot;&quot;&quot;&quot;&quot;)
+
+    ConversionHelpersPrelude = (
+    &quot;&quot;&quot;${includes}
+
+namespace Inspector {&quot;&quot;&quot;)
+
+    ConversionHelpersPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+&quot;&quot;&quot;)
+
+    GenericHeaderPrelude = (
+    &quot;&quot;&quot;${includes}&quot;&quot;&quot;)
+
+    GenericHeaderPostlude = (
+    &quot;&quot;&quot;&quot;&quot;&quot;)
+
+    ConversionHelpersStandard = (
+    &quot;&quot;&quot;template&lt;typename ObjCEnumType&gt;
+ObjCEnumType fromProtocolString(String value);&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderPrelude = (
+    &quot;&quot;&quot;${includes}
+
+${forwardDeclarations}
+
+namespace Inspector {
+&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationPrelude = (
+    &quot;&quot;&quot;#import &quot;config.h&quot;
+#import ${primaryInclude}
+
+${secondaryIncludes}
+
+namespace Inspector {&quot;&quot;&quot;)
+
+    BackendDispatcherImplementationPostlude = (
+    &quot;&quot;&quot;} // namespace Inspector
+&quot;&quot;&quot;)
+
+    ImplementationPrelude = (
+    &quot;&quot;&quot;#import &quot;config.h&quot;
+#import ${primaryInclude}
+
+${secondaryIncludes}
+
+using namespace Inspector;&quot;&quot;&quot;)
+
+    ImplementationPostlude = (
+    &quot;&quot;&quot;&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderDomainHandlerInterfaceDeclaration = (
+    &quot;&quot;&quot;class AlternateInspector${domainName}BackendDispatcher : public AlternateInspectorBackendDispatcher {
+public:
+    virtual ~AlternateInspector${domainName}BackendDispatcher() { }
+${commandDeclarations}
+};&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderDomainHandlerObjCDeclaration = (
+    &quot;&quot;&quot;class ObjCInspector${domainName}BackendDispatcher final : public AlternateInspector${domainName}BackendDispatcher {
+public:
+    ObjCInspector${domainName}BackendDispatcher(id&lt;${objcPrefix}${domainName}DomainHandler&gt; handler) { m_delegate = handler; }
+${commandDeclarations}
+private:
+    RetainPtr&lt;id&lt;${objcPrefix}${domainName}DomainHandler&gt;&gt; m_delegate;
+};&quot;&quot;&quot;)
+
+    BackendDispatcherHeaderDomainHandlerImplementation = (
+    &quot;&quot;&quot;void ObjCInspector${domainName}BackendDispatcher::${commandName}(${parameters})
+{
+    id errorCallback = ^(NSString *error) {
+        backendDispatcher()-&gt;sendResponse(callId, InspectorObject::create(), error);
+    };
+
+${successCallback}
+${conversions}
+${invocation}
+}
+&quot;&quot;&quot;)
+
+    ConfigurationCommandProperty = (
+    &quot;&quot;&quot;@property (nonatomic, retain, setter=set${domainName}Handler:) id&lt;${objcPrefix}${domainName}DomainHandler&gt; ${variableNamePrefix}Handler;&quot;&quot;&quot;)
+
+    ConfigurationEventProperty = (
+    &quot;&quot;&quot;@property (nonatomic, readonly) ${objcPrefix}${domainName}DomainEventDispatcher *${variableNamePrefix}EventDispatcher;&quot;&quot;&quot;)
+
+    ConfigurationCommandPropertyImplementation = (
+    &quot;&quot;&quot;- (void)set${domainName}Handler:(id&lt;${objcPrefix}${domainName}DomainHandler&gt;)handler
+{
+    if (handler == _${variableNamePrefix}Handler)
+        return;
+
+    [_${variableNamePrefix}Handler release];
+    _${variableNamePrefix}Handler = [handler retain];
+
+    auto alternateDispatcher = std::make_unique&lt;ObjCInspector${domainName}BackendDispatcher&gt;(handler);
+    auto alternateAgent = std::make_unique&lt;AlternateDispatchableAgent&lt;Inspector${domainName}BackendDispatcher, AlternateInspector${domainName}BackendDispatcher&gt;&gt;(ASCIILiteral(&quot;${domainName}&quot;), WTF::move(alternateDispatcher));
+    _controller-&gt;appendExtraAgent(WTF::move(alternateAgent));
+}
+
+- (id&lt;${objcPrefix}${domainName}DomainHandler&gt;)${variableNamePrefix}Handler
+{
+    return _${variableNamePrefix}Handler;
+}&quot;&quot;&quot;)
+
+    ConfigurationGetterImplementation = (
+    &quot;&quot;&quot;- (${objcPrefix}${domainName}DomainEventDispatcher *)${variableNamePrefix}EventDispatcher
+{
+    if (!_${variableNamePrefix}EventDispatcher)
+        _${variableNamePrefix}EventDispatcher = [[${objcPrefix}${domainName}DomainEventDispatcher alloc] initWithController:_controller];
+    return _${variableNamePrefix}EventDispatcher;
+}&quot;&quot;&quot;)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptsgenerateinspectorprotocolbindingspy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py (176328 => 176329)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py        2014-11-19 19:01:22 UTC (rev 176328)
+++ trunk/Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py        2014-11-19 19:16:23 UTC (rev 176329)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
</span><span class="cx"> # THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><del>-# This script generates JS and C++ bindings for the inspector protocol.
</del><ins>+# This script generates JS, Objective C, and C++ bindings for the inspector protocol.
</ins><span class="cx"> # Generators for individual files are located in the codegen/ directory.
</span><span class="cx"> 
</span><span class="cx"> import os.path
</span><span class="lines">@@ -40,39 +40,41 @@
</span><span class="cx"> except ImportError:
</span><span class="cx">     import simplejson as json
</span><span class="cx"> 
</span><ins>+logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
+log = logging.getLogger('global')
+
</ins><span class="cx"> try:
</span><span class="cx">     from codegen import *
</span><span class="cx"> 
</span><span class="cx"> # When copying generator files to JavaScriptCore's private headers on Mac,
</span><span class="cx"> # the codegen/ module directory is flattened. So, import directly.
</span><del>-except ImportError:
</del><ins>+except ImportError, e:
+    # log.error(e) # Uncomment this to debug early import errors.
</ins><span class="cx">     import models
</span><span class="cx">     from models import *
</span><span class="cx">     from generator import *
</span><ins>+    from cpp_generator import *
+    from objc_generator import *
</ins><span class="cx"> 
</span><del>-    from generate_alternate_backend_dispatcher_header 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_objective_c_backend_dispatcher_header import *
-    from generate_objective_c_backend_dispatcher_implementation import *
-    from generate_objective_c_configuration_header import *
-    from generate_objective_c_configuration_implementation import *
-    from generate_objective_c_conversion_helpers import *
-    from generate_objective_c_frontend_dispatcher_implementation import *
-    from generate_objective_c_header import *
-    from generate_objective_c_internal_header import *
-    from generate_objective_c_types_implementation import *
-    from generate_protocol_types_header import *
-    from generate_protocol_types_implementation import *
</del><ins>+    from generate_cpp_alternate_backend_dispatcher_header import *
+    from generate_cpp_backend_commands import *
+    from generate_cpp_backend_dispatcher_header import *
+    from generate_cpp_backend_dispatcher_implementation import *
+    from generate_cpp_frontend_dispatcher_header import *
+    from generate_cpp_frontend_dispatcher_implementation import *
+    from generate_cpp_protocol_types_header import *
+    from generate_cpp_protocol_types_implementation import *
+    from generate_objc_backend_dispatcher_header import *
+    from generate_objc_backend_dispatcher_implementation import *
+    from generate_objc_configuration_header import *
+    from generate_objc_configuration_implementation import *
+    from generate_objc_conversion_helpers import *
+    from generate_objc_frontend_dispatcher_implementation import *
+    from generate_objc_header import *
+    from generate_objc_internal_header import *
+    from generate_objc_protocol_types_implementation import *
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
-log = logging.getLogger('global')
-
-
</del><span class="cx"> # A writer that only updates file if it actually changed.
</span><span class="cx"> class IncrementalFileWriter:
</span><span class="cx">     def __init__(self, filepath, force_output):
</span><span class="lines">@@ -130,24 +132,24 @@
</span><span class="cx">     generators = []
</span><span class="cx">     is_test = protocol.framework is Frameworks.Test
</span><span class="cx">     if is_test or protocol.framework is not Frameworks.WebInspector:
</span><del>-        generators.append(AlternateBackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
-        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(ProtocolTypesHeaderGenerator(protocol, primary_specification_filepath))
-        generators.append(ProtocolTypesImplementationGenerator(protocol, primary_specification_filepath))
</del><ins>+        generators.append(CppAlternateBackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(JSBackendCommandsGenerator(protocol, primary_specification_filepath))
+        generators.append(CppBackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(CppBackendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(CppFrontendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(CppFrontendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(CppProtocolTypesHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(CppProtocolTypesImplementationGenerator(protocol, primary_specification_filepath))
</ins><span class="cx">     if is_test or protocol.framework is Frameworks.WebInspector:
</span><del>-        generators.append(ObjectiveCBackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCBackendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCConfigurationHeaderGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCConfigurationImplementationGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCConversionHelpersGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCFrontendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCHeaderGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCTypesImplementationGenerator(protocol, primary_specification_filepath))
-        generators.append(ObjectiveCTypesInternalHeaderGenerator(protocol, primary_specification_filepath))
</del><ins>+        generators.append(ObjCBackendDispatcherHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCBackendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCConfigurationHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCConfigurationImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCConversionHelpersGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCFrontendDispatcherImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCProtocolTypesImplementationGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCInternalHeaderGenerator(protocol, primary_specification_filepath))
</ins><span class="cx"> 
</span><span class="cx">     single_output_file_contents = []
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>