Web Inspector: the protocol generator should generate factory method stubs for protoc...
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2016 00:49:26 +0000 (00:49 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2016 00:49:26 +0000 (00:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155103
<rdar://problem/25002772>

Reviewed by Timothy Hatcher.

Generate stubs with unique names so that parsing methods can be used
reflectively at runtime, based on the protocol version that's loaded.

* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/codegen/__init__.py:
* inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py:
Added. For each type in a domain, add a method of the form
-[ProtocolTypeConversions _parseXXX:fromPayload]. This is in a category
method, and the selector is only ever looked up at runtime.

(ObjCProtocolTypeConversionsHeaderGenerator.generate_output):
* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):

Rebaseline test results with new generator output.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197717 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/inspector/scripts/codegen/__init__.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py
Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result

index 727ef14..ee3bf2d 100644 (file)
@@ -1,3 +1,41 @@
+2016-03-07  Brian Burg  <bburg@apple.com>
+
+        Web Inspector: the protocol generator should generate factory method stubs for protocol types
+        https://bugs.webkit.org/show_bug.cgi?id=155103
+        <rdar://problem/25002772>
+
+        Reviewed by Timothy Hatcher.
+
+        Generate stubs with unique names so that parsing methods can be used
+        reflectively at runtime, based on the protocol version that's loaded.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/scripts/codegen/__init__.py:
+        * inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py:
+        Added. For each type in a domain, add a method of the form
+        -[ProtocolTypeConversions _parseXXX:fromPayload]. This is in a category
+        method, and the selector is only ever looked up at runtime.
+
+        (ObjCProtocolTypeConversionsHeaderGenerator.generate_output):
+        * inspector/scripts/generate-inspector-protocol-bindings.py:
+        (generate_from_specification):
+
+        Rebaseline test results with new generator output.
+
+        * inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
+        * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
+        * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
+        * inspector/scripts/tests/expected/enum-values.json-result:
+        * inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
+        * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
+        * inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
+        * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
+        * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-array-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-object-type.json-result:
+        * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
+
 2016-03-07  Filip Pizlo  <fpizlo@apple.com>
 
         RegExp.prototype.exec() should call into Yarr at most once
index 192b424..7ff3fee 100644 (file)
                969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                978801401471AD920041B016 /* JSDateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9788FC221471AD0C0068CE2D /* JSDateMath.cpp */; };
                978801411471AD920041B016 /* JSDateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9788FC231471AD0C0068CE2D /* JSDateMath.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               990DA67F1C8E316A00295159 /* generate_objc_protocol_type_conversions_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 990DA67E1C8E311D00295159 /* generate_objc_protocol_type_conversions_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
                9928FF3B18AC4AEC00B8CF12 /* JSReplayInputs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9928FF3918AC4AEC00B8CF12 /* JSReplayInputs.cpp */; };
                9928FF3C18AC4AEC00B8CF12 /* JSReplayInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 9928FF3A18AC4AEC00B8CF12 /* JSReplayInputs.h */; settings = {ATTRIBUTES = (Private, ); }; };
                992ABCF91BEA9BD2006403A0 /* RemoteAutomationTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 992ABCF51BEA94CA006403A0 /* RemoteAutomationTarget.cpp */; };
                969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = "<group>"; };
                9788FC221471AD0C0068CE2D /* JSDateMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDateMath.cpp; sourceTree = "<group>"; };
                9788FC231471AD0C0068CE2D /* JSDateMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDateMath.h; sourceTree = "<group>"; };
+               990DA67E1C8E311D00295159 /* generate_objc_protocol_type_conversions_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = generate_objc_protocol_type_conversions_implementation.py; sourceTree = "<group>"; };
                9928FF3918AC4AEC00B8CF12 /* JSReplayInputs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReplayInputs.cpp; sourceTree = "<group>"; };
                9928FF3A18AC4AEC00B8CF12 /* JSReplayInputs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReplayInputs.h; sourceTree = "<group>"; };
                9928FF3D18AC4B1C00B8CF12 /* JSInputs.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = JSInputs.json; sourceTree = "<group>"; };
                                A5EA70F519F6DE5A0098F5EC /* generate_objc_header.py */,
                                A5EA70F619F6DE5A0098F5EC /* generate_objc_internal_header.py */,
                                A5EA70F319F6DE5A0098F5EC /* generate_objc_protocol_type_conversions_header.py */,
+                               990DA67E1C8E311D00295159 /* generate_objc_protocol_type_conversions_implementation.py */,
                                C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */,
                                C4703CCB192844CC0013FBEA /* generator.py */,
                                C4703CCA192844CC0013FBEA /* generator_templates.py */,
                                0F3730931C0D67EE00052BFA /* AirUseCounts.h in Headers */,
                                0F4570391BE44C910062A629 /* AirEliminateDeadCode.h in Headers */,
                                79B00CBD1C6AB07E0088C65D /* ProxyConstructor.h in Headers */,
+                               990DA67F1C8E316A00295159 /* generate_objc_protocol_type_conversions_implementation.py in Headers */,
                                799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */,
                                79B00CBF1C6AB07E0088C65D /* ProxyObject.h in Headers */,
                                792CB34A1C4EED5C00D13AF3 /* PCToCodeOriginMap.h in Headers */,
index 51a476c..37dbe94 100644 (file)
@@ -22,3 +22,4 @@ from generate_objc_header import *
 from generate_objc_internal_header import *
 from generate_objc_protocol_types_implementation import *
 from generate_objc_protocol_type_conversions_header import *
+from generate_objc_protocol_type_conversions_implementation import *
index 65df680..5f59813 100755 (executable)
@@ -55,8 +55,10 @@ class ObjCProtocolTypeConversionsHeaderGenerator(ObjCGenerator):
 
     def generate_output(self):
         headers = [
-            '"%sArrayConversions.h"' % ObjCGenerator.OBJC_STATIC_PREFIX
+            '"%s.h"' % self.protocol_name(),
+            '"%sArrayConversions.h"' % ObjCGenerator.OBJC_STATIC_PREFIX,
         ]
+        headers.sort()
 
         header_args = {
             'includes': '\n'.join(['#import ' + header for header in headers]),
diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py
new file mode 100644 (file)
index 0000000..83a3cf6
--- /dev/null
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2016 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
+import string
+from string import Template
+
+from generator import Generator
+from models import EnumType, ObjectType, ArrayType, AliasedType, PrimitiveType, Frameworks
+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 ObjCProtocolTypeConversionsImplementationGenerator(ObjCGenerator):
+    def __init__(self, model, input_filepath):
+        ObjCGenerator.__init__(self, model, input_filepath)
+
+    def output_filename(self):
+        return '%sTypeConversions.mm' % self.protocol_name()
+
+    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 = [
+            '"%s.h"' % self.protocol_name(),
+            '"%sTypeConversions.h"' % ObjCGenerator.OBJC_SHARED_PREFIX,
+            Generator.string_for_file_include('%sJSONObjectPrivate.h' % ObjCGenerator.OBJC_STATIC_PREFIX, Frameworks.WebInspector, self.model().framework),
+        ]
+        secondary_headers.sort()
+
+        header_args = {
+            'primaryInclude': '"%sTypeConversions.h"' % self.protocol_name(),
+            'secondaryIncludes': '\n'.join(['#import ' + 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.append(self._generate_type_factory_category_interface(domains))
+        sections.append(self._generate_type_factory_category_implementation(domains))
+        sections.append(Template(ObjCTemplates.ImplementationPostlude).substitute(None, **header_args))
+        return '\n\n'.join(sections)
+
+    def _generate_type_factory_category_interface(self, domains):
+        lines = []
+        lines.append('@interface ProtocolTypeConversions (%s)' % self.protocol_name())
+        lines.append('')
+        for domain in domains:
+            for declaration in domain.type_declarations:
+                lines.append(self._generate_type_factory_method_declaration(domain, declaration))
+            add_newline(lines)
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_type_factory_method_declaration(self, domain, declaration):
+        resolved_type = declaration.type
+        if isinstance(resolved_type, AliasedType):
+            resolved_type = resolved_type.aliased_type
+        if isinstance(resolved_type, (ObjectType, ArrayType, PrimitiveType)):
+            objc_type = self.objc_class_for_type(resolved_type)
+            return '+ (void)_parse%s:(%s **)outValue fromPayload:(id)payload;' % (declaration.type.raw_name(), objc_type)
+        if isinstance(resolved_type, EnumType):
+            return '+ (void)_parse%s:(NSNumber **)outValue fromPayload:(id)payload;' % declaration.type.raw_name()
+
+    def _generate_type_factory_category_implementation(self, domains):
+        lines = []
+        lines.append('@implementation ProtocolTypeConversions (%s)' % self.protocol_name())
+        lines.append('')
+        for domain in domains:
+            for declaration in domain.type_declarations:
+                lines.append(self._generate_type_factory_method_implementation(domain, declaration))
+                add_newline(lines)
+        lines.append('@end')
+        return '\n'.join(lines)
+
+    def _generate_type_factory_method_implementation(self, domain, declaration):
+        lines = []
+        resolved_type = declaration.type
+        if isinstance(resolved_type, AliasedType):
+            resolved_type = resolved_type.aliased_type
+
+        objc_class = self.objc_class_for_type(resolved_type)
+        if isinstance(resolved_type, (ObjectType, ArrayType, PrimitiveType)):
+            lines.append('+ (void)_parse%s:(%s **)outValue fromPayload:(id)payload' % (declaration.type.raw_name(), objc_class))
+        if isinstance(resolved_type, EnumType):
+            lines.append('+ (void)_parse%s:(NSNumber **)outValue fromPayload:(id)payload' % declaration.type.raw_name())
+
+        lines.append('{')
+        if isinstance(resolved_type, EnumType):
+            lines.append('    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);')
+            lines.append('    *outValue = @(Inspector::fromProtocolString<%s>(payload));' % self.objc_name_for_type(resolved_type))
+        elif isinstance(resolved_type, (ArrayType, PrimitiveType)):
+            lines.append('    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [%s class]);' % objc_class)
+            lines.append('    *outValue = (%s *)payload;' % objc_class)
+        elif isinstance(resolved_type, ObjectType):
+            lines.append('    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);')
+            lines.append('    *outValue = [[%s alloc] initWithPayload:payload];' % (objc_class))
+        lines.append('}')
+        return '\n'.join(lines)
index 35a3b6a..4fe849f 100755 (executable)
@@ -72,6 +72,7 @@ except ImportError, e:
     from generate_objc_header import *
     from generate_objc_internal_header import *
     from generate_objc_protocol_type_conversions_header import *
+    from generate_objc_protocol_type_conversions_implementation import *
     from generate_objc_protocol_types_implementation import *
 
 
@@ -149,6 +150,7 @@ def generate_from_specification(primary_specification_filepath=None,
         generators.append(ObjCHeaderGenerator(protocol, primary_specification_filepath))
         generators.append(ObjCInternalHeaderGenerator(protocol, primary_specification_filepath))
         generators.append(ObjCProtocolTypeConversionsHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCProtocolTypeConversionsImplementationGenerator(protocol, primary_specification_filepath))
         generators.append(ObjCProtocolTypesImplementationGenerator(protocol, primary_specification_filepath))
 
     elif protocol.framework is Frameworks.JavaScriptCore:
@@ -170,6 +172,7 @@ def generate_from_specification(primary_specification_filepath=None,
     elif protocol.framework is Frameworks.WebKit and generate_frontend:
         generators.append(ObjCHeaderGenerator(protocol, primary_specification_filepath))
         generators.append(ObjCProtocolTypeConversionsHeaderGenerator(protocol, primary_specification_filepath))
+        generators.append(ObjCProtocolTypeConversionsImplementationGenerator(protocol, primary_specification_filepath))
         generators.append(ObjCProtocolTypesImplementationGenerator(protocol, primary_specification_filepath))
 
     elif protocol.framework is Frameworks.WebInspector:
index b3c79eb..9d4b2e3 100644 (file)
@@ -1397,6 +1397,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1549,6 +1550,86 @@ inline TestProtocolDatabaseExecuteSQLAsyncPrintColor fromProtocolString(const St
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload));
+}
+
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
+    *outValue = (NSArray/*<NSString>*/ *)payload;
+}
+
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 808c87f..b4bc173 100644 (file)
@@ -1252,6 +1252,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1404,6 +1405,86 @@ inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolStr
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parsePrimaryColors:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload));
+}
+
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
+    *outValue = (NSArray/*<NSString>*/ *)payload;
+}
+
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index d410bf8..2434bda 100644 (file)
@@ -1284,6 +1284,7 @@ using namespace Inspector;
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1300,6 +1301,65 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseLoaderId:(NSString **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseLoaderId:(NSString **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = (NSString *)payload;
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index a66f7e3..12cd783 100644 (file)
@@ -1028,6 +1028,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1124,6 +1125,65 @@ inline TestProtocolEventDomainEventWithEnumParameterParameter fromProtocolString
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from enum-values.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseTypeDomainEnum:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload));
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 9541839..1aabad2 100644 (file)
@@ -1010,6 +1010,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1022,6 +1023,86 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from events-with-optional-parameters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSString **)outValue fromPayload:(id)payload;
++ (void)_parsePrimaryColors:(NSString **)outValue fromPayload:(id)payload;
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseDatabaseId:(NSString **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = (NSString *)payload;
+}
+
++ (void)_parsePrimaryColors:(NSString **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = (NSString *)payload;
+}
+
++ (void)_parseColorList:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
+    *outValue = (NSArray/*<NSString>*/ *)payload;
+}
+
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 98c47fb..5a7d4f6 100644 (file)
@@ -1059,6 +1059,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1075,6 +1076,65 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from generate-domains-with-feature-guards.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseNetworkError:(TestProtocolNetwork2NetworkError **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseNetworkError:(TestProtocolNetwork2NetworkError **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolNetwork2NetworkError alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 43c7bc9..1609bac 100644 (file)
@@ -779,6 +779,7 @@ using namespace Inspector;
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -793,6 +794,73 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from same-type-id-different-domain.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload;
+
++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = (NSString *)payload;
+}
+
++ (void)_parseRemoteObjectId:(NSString **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = (NSString *)payload;
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index ff3a164..41655b9 100644 (file)
@@ -859,6 +859,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -895,6 +896,65 @@ inline TestProtocolRuntimeKeyPathType fromProtocolString(const String& value)
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from shadowed-optional-type-setters.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseKeyPath:(TestProtocolRuntimeKeyPath **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseKeyPath:(TestProtocolRuntimeKeyPath **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolRuntimeKeyPath alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 1907fe0..5a2667c 100644 (file)
@@ -768,6 +768,7 @@ using namespace Inspector;
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -780,6 +781,65 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-aliased-primitive-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseRemoteObjectId:(NSNumber **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseRemoteObjectId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index b01696d..df2bb06 100644 (file)
@@ -807,6 +807,7 @@ typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) {
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -845,6 +846,115 @@ inline TestProtocolDebuggerReason fromProtocolString(const String& value)
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-array-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseBreakpointId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseReason:(NSNumber **)outValue fromPayload:(id)payload;
+
++ (void)_parseObjectId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseLuckyNumbers:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseBabyNames:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseNewObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseOldObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseStopReasons:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseBreakpointId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parseReason:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload));
+}
+
++ (void)_parseObjectId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parseLuckyNumbers:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]);
+    *outValue = (NSArray/*<NSNumber>*/ *)payload;
+}
+
++ (void)_parseBabyNames:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
+    *outValue = (NSArray/*<NSString>*/ *)payload;
+}
+
++ (void)_parseNewObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]);
+    *outValue = (NSArray/*<NSNumber>*/ *)payload;
+}
+
++ (void)_parseOldObjects:(NSArray/*<NSNumber>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSNumber>*/ class]);
+    *outValue = (NSArray/*<NSNumber>*/ *)payload;
+}
+
++ (void)_parseStopReasons:(NSArray/*<NSString>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<NSString>*/ class]);
+    *outValue = (NSArray/*<NSString>*/ *)payload;
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index 38c1ebb..717b4d0 100644 (file)
@@ -810,6 +810,7 @@ typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) {
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -879,6 +880,72 @@ inline TestProtocolRuntimeTwoLeggedAnimals fromProtocolString(const String& valu
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-enum-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseFarmAnimals:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseTwoLeggedAnimals:(NSNumber **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseFarmAnimals:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload));
+}
+
++ (void)_parseTwoLeggedAnimals:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload));
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index da6afcb..e9e45db 100644 (file)
@@ -1304,6 +1304,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1318,6 +1319,108 @@ ObjCEnumType fromProtocolString(const String& value);
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-declaration-object-type.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload;
++ (void)_parseErrorList:(NSArray/*<TestProtocolDatabaseError>*/ **)outValue fromPayload:(id)payload;
++ (void)_parseOptionalParameterBundle:(TestProtocolDatabaseOptionalParameterBundle **)outValue fromPayload:(id)payload;
++ (void)_parseParameterBundle:(TestProtocolDatabaseParameterBundle **)outValue fromPayload:(id)payload;
++ (void)_parseObjectWithPropertyNameConflicts:(TestProtocolDatabaseObjectWithPropertyNameConflicts **)outValue fromPayload:(id)payload;
++ (void)_parseDummyObject:(TestProtocolDatabaseDummyObject **)outValue fromPayload:(id)payload;
+
++ (void)_parseParameterBundle:(TestProtocolTestParameterBundle **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseError:(TestProtocolDatabaseError **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseError alloc] initWithPayload:payload];
+}
+
++ (void)_parseErrorList:(NSArray/*<TestProtocolDatabaseError>*/ **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSArray/*<TestProtocolDatabaseError>*/ class]);
+    *outValue = (NSArray/*<TestProtocolDatabaseError>*/ *)payload;
+}
+
++ (void)_parseOptionalParameterBundle:(TestProtocolDatabaseOptionalParameterBundle **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseOptionalParameterBundle alloc] initWithPayload:payload];
+}
+
++ (void)_parseParameterBundle:(TestProtocolDatabaseParameterBundle **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseParameterBundle alloc] initWithPayload:payload];
+}
+
++ (void)_parseObjectWithPropertyNameConflicts:(TestProtocolDatabaseObjectWithPropertyNameConflicts **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseObjectWithPropertyNameConflicts alloc] initWithPayload:payload];
+}
+
++ (void)_parseDummyObject:(TestProtocolDatabaseDummyObject **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolDatabaseDummyObject alloc] initWithPayload:payload];
+}
+
++ (void)_parseParameterBundle:(TestProtocolTestParameterBundle **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolTestParameterBundle alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
index e3c69eb..5fd4b85 100644 (file)
@@ -1161,6 +1161,7 @@ __attribute__((visibility ("default")))
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "RWIProtocolArrayConversions.h"
+#import "TestProtocol.h"
 
 namespace Inspector {
 
@@ -1230,6 +1231,107 @@ inline TestProtocolTestCastedAnimals fromProtocolString(const String& value)
 
 ### End File: TestProtocolTypeConversions.h
 
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from type-requiring-runtime-casts.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolTypeConversions.h"
+
+#import "ProtocolTypeConversions.h"
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+@interface ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseTypeNeedingCast:(TestProtocolTestTypeNeedingCast **)outValue fromPayload:(id)payload;
++ (void)_parseCastedObjectId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseUncastedObjectId:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseUncastedAnimals:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload;
++ (void)_parseRecursiveObject1:(TestProtocolTestRecursiveObject1 **)outValue fromPayload:(id)payload;
++ (void)_parseRecursiveObject2:(TestProtocolTestRecursiveObject2 **)outValue fromPayload:(id)payload;
+
+@end
+
+@implementation ProtocolTypeConversions (TestProtocol)
+
++ (void)_parseTypeNeedingCast:(TestProtocolTestTypeNeedingCast **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolTestTypeNeedingCast alloc] initWithPayload:payload];
+}
+
++ (void)_parseCastedObjectId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parseUncastedObjectId:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSNumber class]);
+    *outValue = (NSNumber *)payload;
+}
+
++ (void)_parseUncastedAnimals:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload));
+}
+
++ (void)_parseCastedAnimals:(NSNumber **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);
+    *outValue = @(Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload));
+}
+
++ (void)_parseRecursiveObject1:(TestProtocolTestRecursiveObject1 **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolTestRecursiveObject1 alloc] initWithPayload:payload];
+}
+
++ (void)_parseRecursiveObject2:(TestProtocolTestRecursiveObject2 **)outValue fromPayload:(id)payload
+{
+    THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSDictionary class]);
+    *outValue = [[TestProtocolTestRecursiveObject2 alloc] initWithPayload:payload];
+}
+
+@end
+
+
+### End File: TestProtocolTypeConversions.mm
+
 ### Begin File: TestProtocolTypes.mm
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.