WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-155691-20160320140120.patch (text/plain), 139.59 KB, created by
Blaze Burg
on 2016-03-20 14:01:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Blaze Burg
Created:
2016-03-20 14:01:21 PDT
Size:
139.59 KB
patch
obsolete
>Subversion Revision: 198305 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index ac89e97d98c327d1dab77acb6e9a08376bb951f5..6d8d733a838b290fe1b6f01725aa849905e789ac 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,78 @@ >+2016-03-20 Brian Burg <bburg@apple.com> >+ >+ Web Inspector: protocol generator should generate C++ string-to-enum helper functions >+ https://bugs.webkit.org/show_bug.cgi?id=155691 >+ <rdar://problem/25258078> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ There's a lot of code throughout the Inspector agents and automation code >+ that needs to convert a raw string into a typed protocol enum. Generate >+ some helpers that do this conversion so clients can move over to using it. >+ >+ These helpers are necessary for when we eventually switch to calling backend >+ dispatcher handlers with typed arguments instead of untyped JSON objects. >+ >+ To correctly generate a conversion function for an anonymous enum, the >+ generator needs to be able to get the containing object type's declaration. >+ Since the model's Type object each have only one instance, there is a >+ one-to-one association between type and its declaration. >+ >+ * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: >+ (CppProtocolTypesHeaderGenerator.generate_output): >+ (CppProtocolTypesHeaderGenerator._generate_forward_declarations): >+ Clean up this method to use methodcaller to sort types by raw name. >+ >+ (_generate_declarations_for_enum_conversion_methods): >+ (_generate_declarations_for_enum_conversion_methods.return_type_with_export_macro): >+ (_generate_declarations_for_enum_conversion_methods.type_member_is_anonymous_enum_type): >+ Added. Generates a new section with an unfilled template and specializations of >+ the template for every named and anonymous enum in every domain. Guards for >+ domains wrap the forward declarations. This is added to the end of the header >+ file so that specializations for both types of enums are in the same place. >+ >+ * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: >+ (CppProtocolTypesImplementationGenerator.generate_output): >+ (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain): >+ (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.type_member_is_anonymous_enum_type): >+ (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.generate_conversion_method_body): >+ Added. Generate a static array of offsets into the enum constant value array. >+ Then, loop over this array of offsets and do string comparisons against the >+ provided string and enum constant values at the relevant offsets for this enum. >+ >+ * inspector/scripts/codegen/generator_templates.py: >+ (GeneratorTemplates): Update copyright year in generated files. >+ >+ * inspector/scripts/codegen/models.py: >+ (AliasedType.__init__): >+ (EnumType.__init__): >+ (EnumType.enum_values): >+ (EnumType.declaration): >+ (ArrayType.__init__): >+ (ArrayType.declaration): >+ (ObjectType.__init__): >+ (ObjectType.declaration): >+ (Protocol.resolve_types): >+ (Protocol.lookup_type_reference): >+ Pass the type declaration to Type constructors if available. If not, >+ fill in a placeholder name for the type in the constructor instead of caller. >+ >+ Rebaseline all the things, mostly for copyright block changes. >+ >+ * 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-17 Brian Burg <bburg@apple.com> > > Web Inspector: protocol generator shouldn't generate enums for parameters with non-anonymous enum types >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >index 6753e2dcf88ea929ff1bc2bf90b1149e760590d6..75a3854deb0eea4663ec88a4a56162aa2d15cd92 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py >@@ -1,6 +1,6 @@ > #!/usr/bin/env python > # >-# Copyright (c) 2014 Apple Inc. All rights reserved. >+# Copyright (c) 2014, 2016 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 >@@ -28,6 +28,7 @@ > import logging > import re > import string >+from operator import methodcaller > from string import Template > > from cpp_generator import CppGenerator >@@ -83,6 +84,7 @@ class CppProtocolTypesHeaderGenerator(Generator): > builder_sections = map(self._generate_builders_for_domain, domains) > sections.extend(filter(lambda section: len(section) > 0, builder_sections)) > sections.append(self._generate_forward_declarations_for_binding_traits()) >+ sections.append(self._generate_declarations_for_enum_conversion_methods()) > sections.append('} // namespace Protocol') > sections.append(Template(CppTemplates.HeaderPostlude).substitute(None, **header_args)) > return "\n\n".join(sections) >@@ -98,18 +100,18 @@ class CppProtocolTypesHeaderGenerator(Generator): > 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) >+ sorted(object_types, key=methodcaller('raw_name')) >+ sorted(enum_types, key=methodcaller('raw_name')) >+ > 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.extend('class %s;' % object_type.raw_name() for object_type in object_types) >+ domain_lines.extend('enum class %s;' % enum_type.raw_name() for enum_type in enum_types) > domain_lines.append('} // %s' % domain.domain_name) > sections.append(self.wrap_with_guard_for_domain(domain, '\n'.join(domain_lines))) > >@@ -350,3 +352,51 @@ class CppProtocolTypesHeaderGenerator(Generator): > lines.append('#endif // !ASSERT_DISABLED') > lines.append('};') > return '\n'.join(lines) >+ >+ def _generate_declarations_for_enum_conversion_methods(self): >+ sections = [] >+ sections.append('\n'.join([ >+ 'template<typename ProtocolEnumType>', >+ 'Optional<ProtocolEnumType> parseEnumValueFromString(const String&);', >+ ])) >+ >+ def return_type_with_export_macro(cpp_protocol_type): >+ enum_return_type = 'Optional<%s>' % cpp_protocol_type >+ result_terms = [enum_return_type] >+ if export_macro is not None: >+ result_terms[:0] = [export_macro] >+ return ' '.join(result_terms) >+ >+ def type_member_is_anonymous_enum_type(type_member): >+ return isinstance(type_member.type, EnumType) and type_member.type.is_anonymous >+ >+ for domain in self.domains_to_generate(): >+ 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 >+ >+ sorted(object_types, key=methodcaller('raw_name')) >+ sorted(enum_types, key=methodcaller('raw_name')) >+ >+ domain_lines = [] >+ domain_lines.append("// Enums in the '%s' Domain" % domain.domain_name) >+ export_macro = self.model().framework.setting('export_macro', None) >+ for enum_type in enum_types: >+ cpp_protocol_type = CppGenerator.cpp_protocol_type_for_type(enum_type) >+ domain_lines.append('template<>') >+ domain_lines.append('%s parseEnumValueFromString<%s>(const String&);' % (return_type_with_export_macro(cpp_protocol_type), cpp_protocol_type)) >+ >+ for object_type in object_types: >+ for enum_member in filter(type_member_is_anonymous_enum_type, object_type.members): >+ cpp_protocol_type = CppGenerator.cpp_protocol_type_for_type_member(enum_member, object_type.declaration()) >+ domain_lines.append('template<>') >+ domain_lines.append('%s parseEnumValueFromString<%s>(const String&);' % (return_type_with_export_macro(cpp_protocol_type), cpp_protocol_type)) >+ >+ if len(domain_lines) == 1: >+ continue # No real declarations to emit, just the domain comment. Skip. >+ >+ sections.append(self.wrap_with_guard_for_domain(domain, '\n'.join(domain_lines))) >+ >+ return '\n\n'.join(sections) >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >index 2c263b504ba96c20580938565f37181050e39358..99b7999cbb0283688b61736dc9b0eab4357f9e79 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py >@@ -1,6 +1,6 @@ > #!/usr/bin/env python > # >-# Copyright (c) 2014 Apple Inc. All rights reserved. >+# Copyright (c) 2014, 2016 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 >@@ -28,6 +28,7 @@ > import logging > import string > from string import Template >+from operator import methodcaller > > from cpp_generator import CppGenerator > from cpp_generator_templates import CppGeneratorTemplates as CppTemplates >@@ -48,7 +49,10 @@ class CppProtocolTypesImplementationGenerator(Generator): > domains = self.domains_to_generate() > self.calculate_types_requiring_shape_assertions(domains) > >- secondary_headers = ['<wtf/text/CString.h>'] >+ secondary_headers = [ >+ '<wtf/Optional.h>', >+ '<wtf/text/CString.h>', >+ ] > > header_args = { > 'primaryInclude': '"InspectorProtocolObjects.h"', >@@ -60,6 +64,8 @@ class CppProtocolTypesImplementationGenerator(Generator): > sections.append(Template(CppTemplates.ImplementationPrelude).substitute(None, **header_args)) > sections.append('namespace Protocol {') > sections.append(self._generate_enum_mapping()) >+ enum_parser_sections = map(self._generate_enum_conversion_methods_for_domain, domains) >+ sections.extend(filter(lambda section: len(section) > 0, enum_parser_sections)) > sections.append(self._generate_open_field_names()) > builder_sections = map(self._generate_builders_for_domain, domains) > sections.extend(filter(lambda section: len(section) > 0, builder_sections)) >@@ -81,6 +87,61 @@ class CppProtocolTypesImplementationGenerator(Generator): > lines.append('}') > return '\n'.join(lines) > >+ def _generate_enum_conversion_methods_for_domain(self, domain): >+ >+ def type_member_is_anonymous_enum_type(type_member): >+ return isinstance(type_member.type, EnumType) and type_member.type.is_anonymous >+ >+ def generate_conversion_method_body(enum_type, cpp_protocol_type): >+ body_lines = [] >+ body_lines.extend([ >+ 'template<>', >+ 'Optional<%s> parseEnumValueFromString<%s>(const String& protocolString)' % (cpp_protocol_type, cpp_protocol_type), >+ '{', >+ ' static const size_t constantValues[] = {', >+ ]) >+ >+ enum_values = enum_type.enum_values() >+ for enum_value in enum_values: >+ body_lines.append(' (size_t)%s::%s,' % (cpp_protocol_type, Generator.stylized_name_for_enum_value(enum_value))) >+ >+ body_lines.extend([ >+ ' };', >+ ' for (size_t i = 0; i < %d; ++i)' % len(enum_values), >+ ' if (protocolString == enum_constant_values[constantValues[i]])', >+ ' return (%s)constantValues[i];' % cpp_protocol_type, >+ '', >+ ' return Nullopt;', >+ '}', >+ '', >+ ]) >+ return body_lines >+ >+ 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: >+ return '' >+ >+ sorted(object_types, key=methodcaller('raw_name')) >+ sorted(enum_types, key=methodcaller('raw_name')) >+ >+ lines = [] >+ lines.append("// Enums in the '%s' Domain" % domain.domain_name) >+ for enum_type in enum_types: >+ cpp_protocol_type = CppGenerator.cpp_protocol_type_for_type(enum_type) >+ lines.extend(generate_conversion_method_body(enum_type, cpp_protocol_type)) >+ >+ for object_type in object_types: >+ for enum_member in filter(type_member_is_anonymous_enum_type, object_type.members): >+ cpp_protocol_type = CppGenerator.cpp_protocol_type_for_type_member(enum_member, object_type.declaration()) >+ lines.extend(generate_conversion_method_body(enum_member.type, cpp_protocol_type)) >+ >+ if len(lines) == 1: >+ return '' # No real declarations to emit, just the domain comment. >+ >+ return self.wrap_with_guard_for_domain(domain, '\n'.join(lines)) >+ > def _generate_open_field_names(self): > lines = [] > for domain in self.domains_to_generate(): >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py b/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py >index f2e330a728926896b6a2f8e16248dffa381f88b8..891681ffd71f549576cff1aa50202e129b92ee88 100644 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py >@@ -1,6 +1,6 @@ > #!/usr/bin/env python > # >-# Copyright (c) 2014 Apple Inc. All rights reserved. >+# Copyright (c) 2014, 2016 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 >@@ -32,7 +32,7 @@ class GeneratorTemplates: > CopyrightBlock = ( > """/* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/models.py b/Source/JavaScriptCore/inspector/scripts/codegen/models.py >index 3f40be8cbc81d7b62b8e9639e41efb2fcb9727b0..54b6cbb4cde391823886c59e8abeed89e0448310 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/models.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/models.py >@@ -174,8 +174,9 @@ class PrimitiveType(Type): > > > class AliasedType(Type): >- def __init__(self, name, domain, aliased_type_ref): >- self._name = name >+ def __init__(self, declaration, domain, aliased_type_ref): >+ self._name = declaration.type_name >+ self._declaration = declaration > self._domain = domain > self._aliased_type_ref = aliased_type_ref > self.aliased_type = None >@@ -204,8 +205,9 @@ class AliasedType(Type): > > > class EnumType(Type): >- def __init__(self, name, domain, values, primitive_type_ref, is_anonymous=False): >- self._name = name >+ def __init__(self, declaration, domain, values, primitive_type_ref, is_anonymous=False): >+ self._name = "(anonymous)" if declaration is None else declaration.type_name >+ self._declaration = declaration > self._domain = domain > self._values = values > self._primitive_type_ref = primitive_type_ref >@@ -218,11 +220,14 @@ class EnumType(Type): > def is_enum(self): > return True > >+ def enum_values(self): >+ return self._values >+ > def type_domain(self): > return self._domain > >- def enum_values(self): >- return self._values >+ def declaration(self): >+ return self._declaration > > def qualified_name(self): > return ".".join([self.type_domain().domain_name, self.raw_name()]) >@@ -237,8 +242,9 @@ class EnumType(Type): > > > class ArrayType(Type): >- def __init__(self, name, element_type_ref, domain): >- self._name = name >+ def __init__(self, declaration, element_type_ref, domain): >+ self._name = None if declaration is None else declaration.type_name >+ self._declaration = declaration > self._domain = domain > self._element_type_ref = element_type_ref > self.element_type = None >@@ -249,6 +255,9 @@ class ArrayType(Type): > else: > return 'ArrayType[element_type=(unresolved)]' > >+ def declaration(self): >+ return self._declaration >+ > def type_domain(self): > return self._domain > >@@ -264,14 +273,18 @@ class ArrayType(Type): > > > class ObjectType(Type): >- def __init__(self, name, domain, members): >- self._name = name >+ def __init__(self, declaration, domain): >+ self._name = declaration.type_name >+ self._declaration = declaration > self._domain = domain >- self.members = members >+ self.members = declaration.type_members > > def __repr__(self): > return 'ObjectType[%s]' % self.qualified_name() > >+ def declaration(self): >+ return self._declaration >+ > def type_domain(self): > return self._domain > >@@ -438,13 +451,13 @@ class Protocol: > kind = declaration.type_ref.type_kind > if declaration.type_ref.enum_values is not None: > primitive_type_ref = TypeReference(declaration.type_ref.type_kind, None, None, None) >- type_instance = EnumType(declaration.type_name, domain, declaration.type_ref.enum_values, primitive_type_ref) >+ type_instance = EnumType(declaration, domain, declaration.type_ref.enum_values, primitive_type_ref) > elif kind == "array": >- type_instance = ArrayType(declaration.type_name, declaration.type_ref.array_type_ref, domain) >+ type_instance = ArrayType(declaration, declaration.type_ref.array_type_ref, domain) > elif kind == "object": >- type_instance = ObjectType(declaration.type_name, domain, declaration.type_members) >+ type_instance = ObjectType(declaration, domain) > else: >- type_instance = AliasedType(declaration.type_name, domain, declaration.type_ref) >+ type_instance = AliasedType(declaration, domain, declaration.type_ref) > > log.debug("< Created fresh type %r for declaration %s" % (type_instance, qualified_type_name)) > self.types_by_name[qualified_type_name] = type_instance >@@ -475,7 +488,7 @@ class Protocol: > if type_ref.enum_values is not None: > # We need to create a type reference without enum values as the enum's nested type. > primitive_type_ref = TypeReference(type_ref.type_kind, None, None, None) >- type_instance = EnumType("(anonymous)", domain, type_ref.enum_values, primitive_type_ref, True) >+ type_instance = EnumType(None, domain, type_ref.enum_values, primitive_type_ref, True) > type_instance.resolve_type_references(self) > log.debug("< Created fresh type instance for anonymous enum type: %s" % type_instance.qualified_name()) > return type_instance >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result >index 5b3be04dd4c6ebc3cbca54967efce3d322bfa6dc..c2a40ba91ade641c8636cc0ee51e207f58b1ba49 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -42,7 +42,7 @@ InspectorBackend.activateDomain("Database"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -109,7 +109,7 @@ public: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -207,7 +207,7 @@ private: > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -497,7 +497,7 @@ void DatabaseBackendDispatcher::executeSQLAsync(long requestId, RefPtr<Inspector > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -544,7 +544,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -587,7 +587,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -726,6 +726,13 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Database' Domain >+template<> >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -736,7 +743,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -767,6 +774,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -787,6 +795,23 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Database' Domain >+template<> >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Red, >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Green, >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Blue, >+ }; >+ for (size_t i = 0; i < 3; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -798,7 +823,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -852,7 +877,7 @@ private: > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -940,7 +965,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -981,7 +1006,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1182,7 +1207,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeSQLAsync(long requestId, int > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1226,7 +1251,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1322,7 +1347,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1363,7 +1388,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1548,7 +1573,7 @@ inline TestProtocolDatabaseExecuteSQLAsyncPrintColor fromProtocolString(const St > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1628,7 +1653,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result >index 968ccedf735b0a83f12d44eff60e1d015101775b..f250ae8bc9420191bf89e9bb437f35965c796ec0 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -39,7 +39,7 @@ InspectorBackend.activateDomain("Database"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -104,7 +104,7 @@ public: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -188,7 +188,7 @@ private: > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -398,7 +398,7 @@ void DatabaseBackendDispatcher::executeNoOptionalParameters(long requestId, RefP > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -445,7 +445,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -488,7 +488,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -627,6 +627,13 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Database' Domain >+template<> >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -637,7 +644,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -668,6 +675,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -688,6 +696,23 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Database' Domain >+template<> >+Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Red, >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Green, >+ (size_t)Inspector::Protocol::Database::PrimaryColors::Blue, >+ }; >+ for (size_t i = 0; i < 3; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Database::PrimaryColors)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -699,7 +724,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -751,7 +776,7 @@ private: > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -839,7 +864,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -880,7 +905,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1039,7 +1064,7 @@ void ObjCInspectorDatabaseBackendDispatcher::executeNoOptionalParameters(long re > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1083,7 +1108,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1177,7 +1202,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1218,7 +1243,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1403,7 +1428,7 @@ inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColor fromProtocolStr > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1483,7 +1508,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result >index 2434bdae791c9ca4342fe7bca6ccb83cfc86bb50..766ced3b459eddcc9f8120927be544da4d1af77c 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -47,7 +47,7 @@ InspectorBackend.activateDomain("Network3"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -122,7 +122,7 @@ public: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -234,7 +234,7 @@ private: > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -512,7 +512,7 @@ void Network3BackendDispatcher::loadResource7(long requestId, RefPtr<InspectorOb > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -559,7 +559,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -602,7 +602,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -660,6 +660,9 @@ template<typename T> String getEnumConstantValue(T enumValue) > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -670,7 +673,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -701,6 +704,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -725,7 +729,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -793,7 +797,7 @@ private: > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -901,7 +905,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -943,7 +947,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1103,7 +1107,7 @@ void ObjCInspectorNetwork3BackendDispatcher::loadResource7(long requestId) > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1151,7 +1155,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1214,7 +1218,7 @@ using namespace Inspector; > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1255,7 +1259,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1304,7 +1308,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1363,7 +1367,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result >index 12cd7835f0d5ab074298b74de2f8f44d61b9adf0..eeb1b02067cb3c981fad5691cc2f936d53bb11ae 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -46,7 +46,7 @@ InspectorBackend.activateDomain("EventDomain"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -110,7 +110,7 @@ public: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -192,7 +192,7 @@ private: > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -291,7 +291,7 @@ void CommandDomainBackendDispatcher::commandWithEnumReturnValue(long requestId, > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -352,7 +352,7 @@ private: > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -406,7 +406,7 @@ void EventDomainFrontendDispatcher::eventWithEnumParameter(Parameter parameter) > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -474,6 +474,13 @@ enum class TypeDomainEnum { > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'TypeDomain' Domain >+template<> >+Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -484,7 +491,7 @@ enum class TypeDomainEnum { > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -515,6 +522,7 @@ enum class TypeDomainEnum { > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -537,6 +545,24 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'TypeDomain' Domain >+template<> >+Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Shared, >+ (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Red, >+ (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Green, >+ (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Blue, >+ }; >+ for (size_t i = 0; i < 4; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::TypeDomain::TypeDomainEnum)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -548,7 +574,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -603,7 +629,7 @@ private: > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -700,7 +726,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -742,7 +768,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -807,7 +833,7 @@ void ObjCInspectorCommandDomainBackendDispatcher::commandWithEnumReturnValue(lon > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -882,7 +908,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -956,7 +982,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -999,7 +1025,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1128,7 +1154,7 @@ inline TestProtocolEventDomainEventWithEnumParameterParameter fromProtocolString > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1187,7 +1213,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result >index 0996ce0467709da231beed882254ee3ecb71b65e..4b2d40a12207371c02cef137ef7aa428381b94a9 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -39,7 +39,7 @@ InspectorBackend.activateDomain("Database"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -99,7 +99,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -148,7 +148,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -199,7 +199,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -255,7 +255,7 @@ private: > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -345,7 +345,7 @@ void DatabaseFrontendDispatcher::didExecuteNoOptionalParameters(RefPtr<Inspector > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -478,6 +478,9 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -488,7 +491,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -519,6 +522,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -543,7 +547,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -588,7 +592,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -665,7 +669,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -706,7 +710,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -752,7 +756,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -878,7 +882,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -939,7 +943,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -982,7 +986,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1027,7 +1031,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1107,7 +1111,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result >index e1aa6e785de0898815269b8da9a8faa30d5ef2d0..93087cca0aa2c23028a845784088017378557e61 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -42,7 +42,7 @@ InspectorBackend.activateDomain("Network3"); > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -108,7 +108,7 @@ public: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -189,7 +189,7 @@ private: > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -288,7 +288,7 @@ void Network1BackendDispatcher::loadResource(long requestId, RefPtr<InspectorObj > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -345,7 +345,7 @@ private: > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -398,7 +398,7 @@ void Network3FrontendDispatcher::resourceLoaded() > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -527,6 +527,9 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -537,7 +540,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -568,6 +571,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -592,7 +596,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -649,7 +653,7 @@ private: > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -746,7 +750,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -788,7 +792,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -853,7 +857,7 @@ void ObjCInspectorNetwork1BackendDispatcher::loadResource(long requestId) > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -925,7 +929,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -988,7 +992,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1031,7 +1035,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1080,7 +1084,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1139,7 +1143,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result >index 1609bac37c78600b660b5b5ee422cefd06a0cae8..adbf68403be0cb8f29b31cc031edb3c016d92a4c 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -33,7 +33,7 @@ > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -93,7 +93,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -142,7 +142,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -193,7 +193,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -240,7 +240,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -283,7 +283,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -346,6 +346,9 @@ template<typename T> String getEnumConstantValue(T enumValue) > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -356,7 +359,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -387,6 +390,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -411,7 +415,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -458,7 +462,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -526,7 +530,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -566,7 +570,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -614,7 +618,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -660,7 +664,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -709,7 +713,7 @@ using namespace Inspector; > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -750,7 +754,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -797,7 +801,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -864,7 +868,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result >index d739cc3ce6412aab0dbeb8441ef7eda69bb79132..1451c48c20296b10028692702d96b943103f4e5e 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -33,7 +33,7 @@ > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -93,7 +93,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -142,7 +142,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -193,7 +193,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -240,7 +240,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -283,7 +283,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -416,6 +416,13 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Runtime' Domain >+template<> >+Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -426,7 +433,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -457,6 +464,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -473,6 +481,23 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Runtime' Domain >+template<> >+Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Null, >+ (size_t)Inspector::Protocol::Runtime::KeyPath::Type::String, >+ (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Array, >+ }; >+ for (size_t i = 0; i < 3; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Runtime::KeyPath::Type)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -484,7 +509,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -529,7 +554,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -597,7 +622,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -637,7 +662,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -683,7 +708,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -727,7 +752,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -790,7 +815,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -831,7 +856,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -900,7 +925,7 @@ inline TestProtocolRuntimeKeyPathType fromProtocolString(const String& value) > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -959,7 +984,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result >index 5a2667c68f311df1978bee3cb253f25e34cd01b0..9ea6161b8d2abc600b0c7da7f5b279f1bf034811 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -33,7 +33,7 @@ > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -93,7 +93,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -142,7 +142,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -193,7 +193,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -240,7 +240,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -283,7 +283,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -341,6 +341,9 @@ template<typename T> String getEnumConstantValue(T enumValue) > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -351,7 +354,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -382,6 +385,7 @@ template<typename T> String getEnumConstantValue(T enumValue) > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -406,7 +410,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -451,7 +455,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -519,7 +523,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -559,7 +563,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -605,7 +609,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -649,7 +653,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -698,7 +702,7 @@ using namespace Inspector; > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -739,7 +743,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -784,7 +788,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -843,7 +847,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result >index df2bb06da042f4be4a41c0b2a97f7bbb079cfa71..e048855f6d5130c3bd62719d7e48b40df084d71d 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -36,7 +36,7 @@ InspectorBackend.registerEnum("Debugger.Reason", {Died: "Died", Fainted: "Fainte > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -96,7 +96,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -145,7 +145,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -196,7 +196,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -243,7 +243,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -286,7 +286,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -366,6 +366,13 @@ enum class Reason { > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Debugger' Domain >+template<> >+Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -376,7 +383,7 @@ enum class Reason { > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -407,6 +414,7 @@ enum class Reason { > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -423,6 +431,23 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Debugger' Domain >+template<> >+Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Debugger::Reason::Died, >+ (size_t)Inspector::Protocol::Debugger::Reason::Fainted, >+ (size_t)Inspector::Protocol::Debugger::Reason::Hungry, >+ }; >+ for (size_t i = 0; i < 3; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Debugger::Reason)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -434,7 +459,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -481,7 +506,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -549,7 +574,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -589,7 +614,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -637,7 +662,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -683,7 +708,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -737,7 +762,7 @@ typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) { > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -778,7 +803,7 @@ typedef NS_ENUM(NSInteger, TestProtocolDebuggerReason) { > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -849,7 +874,7 @@ inline TestProtocolDebuggerReason fromProtocolString(const String& value) > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -958,7 +983,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result >index 717b4d060f60c3a83effe3d36d0523b1a0255b5c..c1a8558726b6dff36f0fe318434a34db4871e206 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -37,7 +37,7 @@ InspectorBackend.registerEnum("Runtime.TwoLeggedAnimals", {Ducks: "Ducks", Hens: > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -97,7 +97,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -146,7 +146,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -197,7 +197,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -244,7 +244,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -287,7 +287,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -363,6 +363,15 @@ enum class TwoLeggedAnimals { > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Runtime' Domain >+template<> >+Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&); >+template<> >+Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -373,7 +382,7 @@ enum class TwoLeggedAnimals { > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -404,6 +413,7 @@ enum class TwoLeggedAnimals { > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -424,6 +434,40 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Runtime' Domain >+template<> >+Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Runtime::FarmAnimals::Pigs, >+ (size_t)Inspector::Protocol::Runtime::FarmAnimals::Cows, >+ (size_t)Inspector::Protocol::Runtime::FarmAnimals::Cats, >+ (size_t)Inspector::Protocol::Runtime::FarmAnimals::Hens, >+ }; >+ for (size_t i = 0; i < 4; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Runtime::FarmAnimals)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+template<> >+Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Ducks, >+ (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Hens, >+ (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Crows, >+ (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Flamingos, >+ }; >+ for (size_t i = 0; i < 4; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Runtime::TwoLeggedAnimals)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > } // namespace Protocol >@@ -435,7 +479,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -480,7 +524,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -548,7 +592,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -588,7 +632,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -634,7 +678,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -678,7 +722,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -740,7 +784,7 @@ typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) { > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -781,7 +825,7 @@ typedef NS_ENUM(NSInteger, TestProtocolRuntimeTwoLeggedAnimals) { > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -883,7 +927,7 @@ inline TestProtocolRuntimeTwoLeggedAnimals fromProtocolString(const String& valu > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -949,7 +993,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result >index cfcc3d125108f0d116f63ab2719f880a005039d8..2c5a110efe46ad5895830ecca5063d4388e7b21f 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -33,7 +33,7 @@ > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -93,7 +93,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -142,7 +142,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -193,7 +193,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -240,7 +240,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -283,7 +283,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -325,11 +325,11 @@ namespace Protocol { > > // Forward declarations. > namespace Database { >-class DummyObject; > class Error; >-class ObjectWithPropertyNameConflicts; > class OptionalParameterBundle; > class ParameterBundle; >+class ObjectWithPropertyNameConflicts; >+class DummyObject; > } // Database > > namespace Test { >@@ -806,6 +806,9 @@ public: > > > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -816,7 +819,7 @@ public: > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -847,6 +850,7 @@ public: > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -871,7 +875,7 @@ String getEnumConstantValue(int code) { > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -918,7 +922,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -986,7 +990,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1026,7 +1030,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1074,7 +1078,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1120,7 +1124,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1240,7 +1244,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1281,7 +1285,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1328,7 +1332,7 @@ ObjCEnumType fromProtocolString(const String& value); > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1430,7 +1434,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result >index 48a20714aee58b119cd5ecc4770791b88c910593..effa9326d40851608e8e0168b9f2acb5f6d28309 100644 >--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result >+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result >@@ -1,7 +1,7 @@ > ### Begin File: InspectorBackendCommands.js > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -37,7 +37,7 @@ InspectorBackend.registerEnum("Test.CastedAnimals", {Ducks: "Ducks", Hens: "Hens > ### Begin File: InspectorAlternateBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -97,7 +97,7 @@ private: > ### Begin File: InspectorBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -146,7 +146,7 @@ typedef String ErrorString; > ### Begin File: InspectorBackendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -197,7 +197,7 @@ namespace Inspector { > ### Begin File: InspectorFrontendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -244,7 +244,7 @@ class FrontendRouter; > ### Begin File: InspectorFrontendDispatchers.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -287,7 +287,7 @@ namespace Inspector { > ### Begin File: InspectorProtocolObjects.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -329,11 +329,11 @@ namespace Protocol { > > // Forward declarations. > namespace Test { >+class TypeNeedingCast; > class RecursiveObject1; > class RecursiveObject2; >-class TypeNeedingCast; >-enum class CastedAnimals; > enum class UncastedAnimals; >+enum class CastedAnimals; > } // Test > // End of forward declarations. > >@@ -585,6 +585,15 @@ static void assertValueHasExpectedType(Inspector::InspectorValue*); > #endif // !ASSERT_DISABLED > }; > >+template<typename ProtocolEnumType> >+Optional<ProtocolEnumType> parseEnumValueFromString(const String&); >+ >+// Enums in the 'Test' Domain >+template<> >+Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&); >+template<> >+Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&); >+ > } // namespace Protocol > > } // namespace Inspector >@@ -595,7 +604,7 @@ static void assertValueHasExpectedType(Inspector::InspectorValue*); > ### Begin File: InspectorProtocolObjects.cpp > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -626,6 +635,7 @@ static void assertValueHasExpectedType(Inspector::InspectorValue*); > #include "config.h" > #include "InspectorProtocolObjects.h" > >+#include <wtf/Optional.h> > #include <wtf/text/CString.h> > > namespace Inspector { >@@ -646,6 +656,40 @@ String getEnumConstantValue(int code) { > return enum_constant_values[code]; > } > >+// Enums in the 'Test' Domain >+template<> >+Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Test::UncastedAnimals::Pigs, >+ (size_t)Inspector::Protocol::Test::UncastedAnimals::Cows, >+ (size_t)Inspector::Protocol::Test::UncastedAnimals::Cats, >+ (size_t)Inspector::Protocol::Test::UncastedAnimals::Hens, >+ }; >+ for (size_t i = 0; i < 4; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Test::UncastedAnimals)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+template<> >+Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString) >+{ >+ static const size_t constantValues[] = { >+ (size_t)Inspector::Protocol::Test::CastedAnimals::Ducks, >+ (size_t)Inspector::Protocol::Test::CastedAnimals::Hens, >+ (size_t)Inspector::Protocol::Test::CastedAnimals::Crows, >+ (size_t)Inspector::Protocol::Test::CastedAnimals::Flamingos, >+ }; >+ for (size_t i = 0; i < 4; ++i) >+ if (protocolString == enum_constant_values[constantValues[i]]) >+ return (Inspector::Protocol::Test::CastedAnimals)constantValues[i]; >+ >+ return Nullopt; >+} >+ >+ > > > #if !ASSERT_DISABLED >@@ -762,7 +806,7 @@ void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasE > ### Begin File: TestProtocolBackendDispatchers.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -807,7 +851,7 @@ namespace Inspector { > ### Begin File: TestProtocolConfiguration.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -875,7 +919,7 @@ using namespace Inspector; > ### Begin File: TestProtocolConfiguration.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -915,7 +959,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolBackendDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -961,7 +1005,7 @@ namespace Inspector { > ### Begin File: TestProtocolEventDispatchers.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1005,7 +1049,7 @@ using namespace Inspector; > ### Begin File: TestProtocol.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1094,7 +1138,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolInternal.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1135,7 +1179,7 @@ __attribute__((visibility ("default"))) > ### Begin File: TestProtocolTypeConversions.h > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1237,7 +1281,7 @@ inline TestProtocolTestCastedAnimals fromProtocolString(const String& value) > ### Begin File: TestProtocolTypeConversions.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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 >@@ -1338,7 +1382,7 @@ using namespace Inspector; > ### Begin File: TestProtocolTypes.mm > /* > * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2016 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
timothy
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 155691
: 274547