Changeset 199005 in webkit
- Timestamp:
- Apr 4, 2016 7:30:35 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r198999 r199005 1 2016-04-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantValue since r198792 4 https://bugs.webkit.org/show_bug.cgi?id=155745 5 <rdar://problem/25289456> 6 7 Reviewed by Brian Burg. 8 9 The problem is that we are generating the Inspector::Protocol::getEnumConstantValue() method and the 10 enum_constant_values array for every framework that has enum values. So, in case of GTK port we have two 11 implementations, one for the inspector in JavaScriptCore and another one for Web Automation in WebKit2, but when 12 using the inspector in WebKit2 we always end up using the one in WebKit2. Since the enum_constant_values array 13 is smaller in WebKit2 than the one in JavaScriptCore, we crash every time we receive an enum value higher than 14 the array size. We need to disambiguate the getEnumConstantValue() generated and used for every framework, so we 15 can use a specific namespace for the enum conversion methods. 16 17 * inspector/agents/InspectorDebuggerAgent.cpp: 18 (Inspector::breakpointActionTypeForString): Use Inspector::Protocol::InspectorHelpers. 19 * inspector/scripts/codegen/cpp_generator.py: 20 (CppGenerator.helpers_namespace): Return the namespace name that should be used for the helper methods. 21 * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: 22 (CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain): Use 23 CppGenerator.helpers_namespace() to use the right namespace when using getEnumConstantValue(). 24 (CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): Ditto. 25 * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: 26 (CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event): Ditto. 27 * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: 28 (CppProtocolTypesHeaderGenerator.generate_output): Move declaration of getEnumConstantValue to a helper function. 29 (_generate_enum_constant_value_conversion_methods): Do not emit any code if there aren't enums and ensure all 30 conversion methods are declared inside the helpers namespace. 31 (_generate_builder_setter_for_member): Use CppGenerator.helpers_namespace() to use the right namespace when 32 using getEnumConstantValue(). 33 (_generate_unchecked_setter_for_member): Ditto. 34 (_generate_declarations_for_enum_conversion_methods): Return a list instead of a string so that we can return an 35 empty list in case of not emitting any code. The caller will use extend() that has no effect when an empty list 36 is passed. 37 * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: 38 (CppProtocolTypesImplementationGenerator.generate_output): Use the new helper function to generate both the enum 39 mapping and conversion methods inside the helpers namespace. 40 (CppProtocolTypesImplementationGenerator._generate_enum_mapping): Return a list instead of a string so that we 41 can return an empty list in case of not emitting any code. 42 (CppProtocolTypesImplementationGenerator._generate_enum_mapping_and_conversion_methods): Ensure we only emit 43 code when there are enum values, and it's generated inside the helpers namespace. 44 * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: 45 * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: 46 * inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: 47 * inspector/scripts/tests/expected/enum-values.json-result: 48 * inspector/scripts/tests/expected/events-with-optional-parameters.json-result: 49 * inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result: 50 * inspector/scripts/tests/expected/same-type-id-different-domain.json-result: 51 * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result: 52 * inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: 53 * inspector/scripts/tests/expected/type-declaration-array-type.json-result: 54 * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: 55 * inspector/scripts/tests/expected/type-declaration-object-type.json-result: 56 * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: 57 1 58 2016-04-04 Csaba Osztrogonác <ossy@webkit.org> 2 59 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r198648 r199005 217 217 static bool breakpointActionTypeForString(const String& typeString, ScriptBreakpointActionType* output) 218 218 { 219 if (typeString == Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Log)) {219 if (typeString == Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Log)) { 220 220 *output = ScriptBreakpointActionTypeLog; 221 221 return true; 222 222 } 223 if (typeString == Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Evaluate)) {223 if (typeString == Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Evaluate)) { 224 224 *output = ScriptBreakpointActionTypeEvaluate; 225 225 return true; 226 226 } 227 if (typeString == Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Sound)) {227 if (typeString == Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Sound)) { 228 228 *output = ScriptBreakpointActionTypeSound; 229 229 return true; 230 230 } 231 if (typeString == Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Probe)) {231 if (typeString == Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Probe)) { 232 232 *output = ScriptBreakpointActionTypeProbe; 233 233 return true; -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py
r198678 r199005 51 51 return self.model().framework.setting('protocol_group', '') 52 52 53 def helpers_namespace(self): 54 return '%sHelpers' % self.protocol_name() 55 53 56 # Miscellaneous text manipulation routines. 54 57 @staticmethod -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py
r198678 r199005 146 146 'parameterName': parameter.parameter_name, 147 147 'parameterType': CppGenerator.cpp_type_for_stack_in_parameter(parameter), 148 'helpersNamespace': self.helpers_namespace(), 148 149 } 149 150 … … 158 159 out_parameter_assignments.append(' jsonMessage->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), %(parameterName)s);' % param_args) 159 160 elif parameter.type.is_enum(): 160 out_parameter_assignments.append(' jsonMessage->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), Inspector::Protocol:: getEnumConstantValue(%(parameterName)s));' % param_args)161 out_parameter_assignments.append(' jsonMessage->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(%(parameterName)s));' % param_args) 161 162 else: 162 163 out_parameter_assignments.append(' jsonMessage->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), %(parameterName)s);' % param_args) … … 239 240 'parameterName': parameter.parameter_name, 240 241 'keyedSetMethod': CppGenerator.cpp_setter_method_for_type(parameter.type), 241 242 'helpersNamespace': self.helpers_namespace(), 242 243 } 243 244 … … 251 252 out_parameter_assignments.append(' result->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), out_%(parameterName)s);' % param_args) 252 253 elif parameter.type.is_enum(): 253 out_parameter_assignments.append(' result->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), Inspector::Protocol:: getEnumConstantValue(out_%(parameterName)s));' % param_args)254 out_parameter_assignments.append(' result->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(out_%(parameterName)s));' % param_args) 254 255 else: 255 256 out_parameter_assignments.append(' result->%(keyedSetMethod)s(ASCIILiteral("%(parameterKey)s"), out_%(parameterName)s);' % param_args) -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py
r198678 r199005 86 86 parameter_value = '*' + parameter_value 87 87 if parameter.type.is_enum(): 88 parameter_value = 'Inspector::Protocol:: getEnumConstantValue(%s)' % parameter_value88 parameter_value = 'Inspector::Protocol::%s::getEnumConstantValue(%s)' % (self.helpers_namespace(), parameter_value) 89 89 90 90 parameter_args = { -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
r198752 r199005 56 56 ]) 57 57 58 export_macro = self.model().framework.setting('export_macro', None)59 60 58 header_args = { 61 59 'includes': '\n'.join(['#include ' + header for header in sorted(headers)]), 62 60 'typedefs': '', 63 61 } 64 65 return_type = 'String'66 return_type_with_export_macro = [return_type]67 if export_macro is not None:68 return_type_with_export_macro[:0] = [export_macro]69 62 70 63 sections = [] … … 74 67 sections.append(self._generate_forward_declarations(domains)) 75 68 sections.append(self._generate_typedefs(domains)) 76 sections.append('%s getEnumConstantValue(int code);' % ' '.join(return_type_with_export_macro)) 77 sections.append('\n'.join([ 78 'template<typename T> %s getEnumConstantValue(T enumValue)' % return_type, 79 '{', 80 ' return getEnumConstantValue(static_cast<int>(enumValue));', 81 '}'])) 82 69 sections.extend(self._generate_enum_constant_value_conversion_methods()) 83 70 builder_sections = map(self._generate_builders_for_domain, domains) 84 71 sections.extend(filter(lambda section: len(section) > 0, builder_sections)) 85 72 sections.append(self._generate_forward_declarations_for_binding_traits()) 86 sections. append(self._generate_declarations_for_enum_conversion_methods())73 sections.extend(self._generate_declarations_for_enum_conversion_methods()) 87 74 sections.append('} // namespace Protocol') 88 75 sections.append(Template(CppTemplates.HeaderPostlude).substitute(None, **header_args)) … … 162 149 lines.append('} // %s' % domain.domain_name) 163 150 return self.wrap_with_guard_for_domain(domain, '\n'.join(lines)) 151 152 def _generate_enum_constant_value_conversion_methods(self): 153 if not self.assigned_enum_values(): 154 return [] 155 156 return_type = 'String' 157 return_type_with_export_macro = [return_type] 158 export_macro = self.model().framework.setting('export_macro', None) 159 if export_macro is not None: 160 return_type_with_export_macro[:0] = [export_macro] 161 162 lines = [] 163 lines.append('namespace %s {' % self.helpers_namespace()) 164 lines.append('\n'.join([ 165 '%s getEnumConstantValue(int code);' % ' '.join(return_type_with_export_macro), 166 '', 167 'template<typename T> %s getEnumConstantValue(T enumValue)' % return_type, 168 '{', 169 ' return getEnumConstantValue(static_cast<int>(enumValue));', 170 '}', 171 ])) 172 lines.append('} // namespace %s' % self.helpers_namespace()) 173 return lines 164 174 165 175 def _generate_builders_for_domain(self, domain): … … 282 292 'keyedSet': CppGenerator.cpp_setter_method_for_type(type_member.type), 283 293 'name': type_member.member_name, 284 'parameterType': CppGenerator.cpp_type_for_type_member(type_member) 294 'parameterType': CppGenerator.cpp_type_for_type_member(type_member), 295 'helpersNamespace': self.helpers_namespace(), 285 296 } 286 297 … … 292 303 293 304 if isinstance(type_member.type, EnumType): 294 lines.append(' m_result->%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol:: getEnumConstantValue(static_cast<int>(value)));' % setter_args)305 lines.append(' m_result->%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args) 295 306 else: 296 307 lines.append(' m_result->%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args) … … 304 315 'keyedSet': CppGenerator.cpp_setter_method_for_type(type_member.type), 305 316 'name': type_member.member_name, 306 'parameterType': CppGenerator.cpp_type_for_type_member(type_member) 317 'parameterType': CppGenerator.cpp_type_for_type_member(type_member), 318 'helpersNamespace': self.helpers_namespace(), 307 319 } 308 320 … … 312 324 lines.append(' {') 313 325 if isinstance(type_member.type, EnumType): 314 lines.append(' InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol:: getEnumConstantValue(static_cast<int>(value)));' % setter_args)326 lines.append(' InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args) 315 327 elif CppGenerator.should_use_references_for_type(type_member.type): 316 328 lines.append(' InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTFMove(value));' % setter_args) … … 356 368 sections = [] 357 369 sections.append('\n'.join([ 370 'namespace %s {' % self.helpers_namespace(), 371 '', 358 372 'template<typename ProtocolEnumType>', 359 373 'Optional<ProtocolEnumType> parseEnumValueFromString(const String&);', … … 363 377 enum_return_type = 'Optional<%s>' % cpp_protocol_type 364 378 result_terms = [enum_return_type] 379 export_macro = self.model().framework.setting('export_macro', None) 365 380 if export_macro is not None: 366 381 result_terms[:0] = [export_macro] … … 382 397 domain_lines = [] 383 398 domain_lines.append("// Enums in the '%s' Domain" % domain.domain_name) 384 export_macro = self.model().framework.setting('export_macro', None)385 399 for enum_type in enum_types: 386 400 cpp_protocol_type = CppGenerator.cpp_protocol_type_for_type(enum_type) … … 399 413 sections.append(self.wrap_with_guard_for_domain(domain, '\n'.join(domain_lines))) 400 414 401 return '\n\n'.join(sections) 415 if len(sections) == 1: 416 return [] # No real sections to emit, just the namespace and template declaration. Skip. 417 418 sections.append('} // namespace %s' % self.helpers_namespace()) 419 420 return ['\n\n'.join(sections)] -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
r198752 r199005 64 64 sections.append(Template(CppTemplates.ImplementationPrelude).substitute(None, **header_args)) 65 65 sections.append('namespace Protocol {') 66 sections.append(self._generate_enum_mapping()) 67 enum_parser_sections = map(self._generate_enum_conversion_methods_for_domain, domains) 68 sections.extend(filter(lambda section: len(section) > 0, enum_parser_sections)) 66 sections.extend(self._generate_enum_mapping_and_conversion_methods(domains)) 69 67 sections.append(self._generate_open_field_names()) 70 68 builder_sections = map(self._generate_builders_for_domain, domains) … … 78 76 79 77 def _generate_enum_mapping(self): 78 if not self.assigned_enum_values(): 79 return [] 80 80 81 lines = [] 81 82 lines.append('static const char* const enum_constant_values[] = {') … … 86 87 lines.append(' return enum_constant_values[code];') 87 88 lines.append('}') 88 return '\n'.join(lines)89 return ['\n'.join(lines)] 89 90 90 91 def _generate_enum_conversion_methods_for_domain(self, domain): … … 142 143 143 144 return self.wrap_with_guard_for_domain(domain, '\n'.join(lines)) 145 146 def _generate_enum_mapping_and_conversion_methods(self, domains): 147 sections = [] 148 sections.append('namespace %s {' % self.helpers_namespace()) 149 sections.extend(self._generate_enum_mapping()) 150 enum_parser_sections = map(self._generate_enum_conversion_methods_for_domain, domains) 151 sections.extend(filter(lambda section: len(section) > 0, enum_parser_sections)) 152 if len(sections) == 1: 153 return [] # No declarations to emit, just the namespace. 154 155 sections.append('} // namespace %s' % self.helpers_namespace()) 156 return sections 144 157 145 158 def _generate_open_field_names(self): -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
r198752 r199005 430 430 result->setObject(ASCIILiteral("sqlError"), out_sqlError); 431 431 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); 432 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol:: getEnumConstantValue(out_screenColor));433 result->setString(ASCIILiteral("printColor"), Inspector::Protocol:: getEnumConstantValue(out_printColor));432 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_screenColor)); 433 result->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_printColor)); 434 434 } 435 435 if (!error.length()) … … 451 451 jsonMessage->setInteger(ASCIILiteral("databaseId"), databaseId); 452 452 jsonMessage->setObject(ASCIILiteral("sqlError"), sqlError); 453 jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol:: getEnumConstantValue(screenColor));453 jsonMessage->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(screenColor)); 454 454 jsonMessage->setArray(ASCIILiteral("alternateColors"), alternateColors); 455 jsonMessage->setString(ASCIILiteral("printColor"), Inspector::Protocol:: getEnumConstantValue(printColor));455 jsonMessage->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(printColor)); 456 456 CallbackBase::sendSuccess(WTFMove(jsonMessage)); 457 457 } … … 634 634 // End of typedefs. 635 635 636 namespace TestHelpers { 637 636 638 String getEnumConstantValue(int code); 637 639 … … 640 642 return getEnumConstantValue(static_cast<int>(enumValue)); 641 643 } 644 645 } // namespace TestHelpers 642 646 643 647 namespace Database { … … 717 721 718 722 723 namespace TestHelpers { 724 719 725 template<typename ProtocolEnumType> 720 726 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 723 729 template<> 724 730 Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); 731 732 } // namespace TestHelpers 725 733 726 734 } // namespace Protocol … … 770 778 namespace Protocol { 771 779 780 namespace TestHelpers { 781 772 782 static const char* const enum_constant_values[] = { 773 783 "red", … … 800 810 } 801 811 812 813 } // namespace TestHelpers 802 814 803 815 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
r198752 r199005 376 376 result->setInteger(ASCIILiteral("databaseId"), out_databaseId); 377 377 result->setObject(ASCIILiteral("sqlError"), out_sqlError); 378 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol:: getEnumConstantValue(out_screenColor));378 result->setString(ASCIILiteral("screenColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_screenColor)); 379 379 result->setArray(ASCIILiteral("alternateColors"), out_alternateColors); 380 result->setString(ASCIILiteral("printColor"), Inspector::Protocol:: getEnumConstantValue(out_printColor));380 result->setString(ASCIILiteral("printColor"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_printColor)); 381 381 } 382 382 if (!error.length()) … … 535 535 // End of typedefs. 536 536 537 namespace TestHelpers { 538 537 539 String getEnumConstantValue(int code); 538 540 … … 541 543 return getEnumConstantValue(static_cast<int>(enumValue)); 542 544 } 545 546 } // namespace TestHelpers 543 547 544 548 namespace Database { … … 618 622 619 623 624 namespace TestHelpers { 625 620 626 template<typename ProtocolEnumType> 621 627 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 625 631 Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&); 626 632 633 } // namespace TestHelpers 634 627 635 } // namespace Protocol 628 636 … … 670 678 671 679 namespace Protocol { 680 681 namespace TestHelpers { 672 682 673 683 static const char* const enum_constant_values[] = { … … 701 711 } 702 712 713 714 } // namespace TestHelpers 703 715 704 716 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result
r198752 r199005 642 642 // End of typedefs. 643 643 644 String getEnumConstantValue(int code); 645 646 template<typename T> String getEnumConstantValue(T enumValue) 647 { 648 return getEnumConstantValue(static_cast<int>(enumValue)); 649 } 650 651 652 653 template<typename ProtocolEnumType> 654 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); 644 655 645 656 646 } // namespace Protocol … … 699 689 700 690 namespace Protocol { 701 702 static const char* const enum_constant_values[] = {703 };704 705 String getEnumConstantValue(int code) {706 return enum_constant_values[code];707 }708 691 709 692 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
r198752 r199005 271 271 272 272 if (!error.length()) 273 result->setString(ASCIILiteral("returnValue"), Inspector::Protocol:: getEnumConstantValue(out_returnValue));273 result->setString(ASCIILiteral("returnValue"), Inspector::Protocol::TestHelpers::getEnumConstantValue(out_returnValue)); 274 274 275 275 if (!error.length()) … … 385 385 jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("EventDomain.eventWithEnumParameter")); 386 386 Ref<InspectorObject> paramsObject = InspectorObject::create(); 387 paramsObject->setString(ASCIILiteral("parameter"), Inspector::Protocol:: getEnumConstantValue(parameter));387 paramsObject->setString(ASCIILiteral("parameter"), Inspector::Protocol::TestHelpers::getEnumConstantValue(parameter)); 388 388 jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject)); 389 389 … … 446 446 447 447 448 namespace TestHelpers { 449 448 450 String getEnumConstantValue(int code); 449 451 … … 452 454 return getEnumConstantValue(static_cast<int>(enumValue)); 453 455 } 456 457 } // namespace TestHelpers 454 458 455 459 namespace TypeDomain { … … 465 469 466 470 471 namespace TestHelpers { 472 467 473 template<typename ProtocolEnumType> 468 474 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 472 478 Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&); 473 479 480 } // namespace TestHelpers 481 474 482 } // namespace Protocol 475 483 … … 517 525 518 526 namespace Protocol { 527 528 namespace TestHelpers { 519 529 520 530 static const char* const enum_constant_values[] = { … … 552 562 553 563 564 } // namespace TestHelpers 565 554 566 555 567 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/events-with-optional-parameters.json-result
r198752 r199005 392 392 // End of typedefs. 393 393 394 String getEnumConstantValue(int code);395 396 template<typename T> String getEnumConstantValue(T enumValue)397 {398 return getEnumConstantValue(static_cast<int>(enumValue));399 }400 401 394 namespace Database { 402 395 /* Database error. */ … … 469 462 470 463 471 template<typename ProtocolEnumType>472 Optional<ProtocolEnumType> parseEnumValueFromString(const String&);473 474 464 } // namespace Protocol 475 465 … … 517 507 518 508 namespace Protocol { 519 520 static const char* const enum_constant_values[] = {521 };522 523 String getEnumConstantValue(int code) {524 return enum_constant_values[code];525 }526 509 527 510 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result
r198752 r199005 440 440 441 441 442 String getEnumConstantValue(int code);443 444 template<typename T> String getEnumConstantValue(T enumValue)445 {446 return getEnumConstantValue(static_cast<int>(enumValue));447 }448 449 442 #if PLATFORM(WEB_TYPES) 450 443 namespace Network2 { … … 518 511 519 512 520 template<typename ProtocolEnumType>521 Optional<ProtocolEnumType> parseEnumValueFromString(const String&);522 523 513 } // namespace Protocol 524 514 … … 566 556 567 557 namespace Protocol { 568 569 static const char* const enum_constant_values[] = {570 };571 572 String getEnumConstantValue(int code) {573 return enum_constant_values[code];574 }575 558 576 559 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/same-type-id-different-domain.json-result
r198752 r199005 328 328 // End of typedefs. 329 329 330 String getEnumConstantValue(int code); 331 332 template<typename T> String getEnumConstantValue(T enumValue) 333 { 334 return getEnumConstantValue(static_cast<int>(enumValue)); 335 } 336 337 338 339 template<typename ProtocolEnumType> 340 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); 330 341 331 342 332 } // namespace Protocol … … 385 375 386 376 namespace Protocol { 387 388 static const char* const enum_constant_values[] = {389 };390 391 String getEnumConstantValue(int code) {392 return enum_constant_values[code];393 }394 377 395 378 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
r198752 r199005 323 323 324 324 325 namespace TestHelpers { 326 325 327 String getEnumConstantValue(int code); 326 328 … … 329 331 return getEnumConstantValue(static_cast<int>(enumValue)); 330 332 } 333 334 } // namespace TestHelpers 331 335 332 336 namespace Runtime { … … 367 371 { 368 372 COMPILE_ASSERT(!(STATE & TypeSet), property_type_already_set); 369 m_result->setString(ASCIILiteral("type"), Inspector::Protocol:: getEnumConstantValue(static_cast<int>(value)));373 m_result->setString(ASCIILiteral("type"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value)); 370 374 return castState<TypeSet>(); 371 375 } … … 407 411 408 412 413 namespace TestHelpers { 414 409 415 template<typename ProtocolEnumType> 410 416 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 414 420 Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&); 415 421 422 } // namespace TestHelpers 423 416 424 } // namespace Protocol 417 425 … … 459 467 460 468 namespace Protocol { 469 470 namespace TestHelpers { 461 471 462 472 static const char* const enum_constant_values[] = { … … 486 496 } 487 497 498 499 } // namespace TestHelpers 488 500 489 501 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result
r198752 r199005 323 323 // End of typedefs. 324 324 325 String getEnumConstantValue(int code); 326 327 template<typename T> String getEnumConstantValue(T enumValue) 328 { 329 return getEnumConstantValue(static_cast<int>(enumValue)); 330 } 331 332 333 334 template<typename ProtocolEnumType> 335 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); 325 336 326 337 327 } // namespace Protocol … … 380 370 381 371 namespace Protocol { 382 383 static const char* const enum_constant_values[] = {384 };385 386 String getEnumConstantValue(int code) {387 return enum_constant_values[code];388 }389 372 390 373 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
r198752 r199005 339 339 // End of typedefs. 340 340 341 namespace TestHelpers { 342 341 343 String getEnumConstantValue(int code); 342 344 … … 345 347 return getEnumConstantValue(static_cast<int>(enumValue)); 346 348 } 349 350 } // namespace TestHelpers 347 351 348 352 namespace Debugger { … … 357 361 358 362 363 namespace TestHelpers { 364 359 365 template<typename ProtocolEnumType> 360 366 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 364 370 Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&); 365 371 372 } // namespace TestHelpers 373 366 374 } // namespace Protocol 367 375 … … 409 417 410 418 namespace Protocol { 419 420 namespace TestHelpers { 411 421 412 422 static const char* const enum_constant_values[] = { … … 437 447 438 448 449 } // namespace TestHelpers 450 439 451 440 452 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
r198752 r199005 328 328 329 329 330 namespace TestHelpers { 331 330 332 String getEnumConstantValue(int code); 331 333 … … 334 336 return getEnumConstantValue(static_cast<int>(enumValue)); 335 337 } 338 339 } // namespace TestHelpers 336 340 337 341 namespace Runtime { … … 354 358 355 359 360 namespace TestHelpers { 361 356 362 template<typename ProtocolEnumType> 357 363 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 363 369 Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&); 364 370 371 } // namespace TestHelpers 372 365 373 } // namespace Protocol 366 374 … … 408 416 409 417 namespace Protocol { 418 419 namespace TestHelpers { 410 420 411 421 static const char* const enum_constant_values[] = { … … 456 466 } 457 467 468 469 } // namespace TestHelpers 458 470 459 471 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
r198752 r199005 334 334 } // Database 335 335 // End of typedefs. 336 337 String getEnumConstantValue(int code);338 339 template<typename T> String getEnumConstantValue(T enumValue)340 {341 return getEnumConstantValue(static_cast<int>(enumValue));342 }343 336 344 337 namespace Database { … … 797 790 798 791 799 template<typename ProtocolEnumType>800 Optional<ProtocolEnumType> parseEnumValueFromString(const String&);801 802 792 } // namespace Protocol 803 793 … … 845 835 846 836 namespace Protocol { 847 848 static const char* const enum_constant_values[] = {849 };850 851 String getEnumConstantValue(int code) {852 return enum_constant_values[code];853 }854 837 855 838 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
r198752 r199005 336 336 // End of typedefs. 337 337 338 namespace TestHelpers { 339 338 340 String getEnumConstantValue(int code); 339 341 … … 342 344 return getEnumConstantValue(static_cast<int>(enumValue)); 343 345 } 346 347 } // namespace TestHelpers 344 348 345 349 namespace Test { … … 392 396 { 393 397 COMPILE_ASSERT(!(STATE & AnimalsSet), property_animals_already_set); 394 m_result->setString(ASCIILiteral("animals"), Inspector::Protocol:: getEnumConstantValue(static_cast<int>(value)));398 m_result->setString(ASCIILiteral("animals"), Inspector::Protocol::TestHelpers::getEnumConstantValue(value)); 395 399 return castState<AnimalsSet>(); 396 400 } … … 576 580 }; 577 581 582 namespace TestHelpers { 583 578 584 template<typename ProtocolEnumType> 579 585 Optional<ProtocolEnumType> parseEnumValueFromString(const String&); … … 585 591 Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&); 586 592 593 } // namespace TestHelpers 594 587 595 } // namespace Protocol 588 596 … … 630 638 631 639 namespace Protocol { 640 641 namespace TestHelpers { 632 642 633 643 static const char* const enum_constant_values[] = { … … 678 688 } 679 689 690 691 } // namespace TestHelpers 680 692 681 693 -
trunk/Source/WebCore/ChangeLog
r199004 r199005 1 2016-04-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantValue since r198792 4 https://bugs.webkit.org/show_bug.cgi?id=155745 5 <rdar://problem/25289456> 6 7 Reviewed by Brian Burg. 8 9 Use Inspector::Protocol::AutomationEnums namespace for getEnumConstantValue(). 10 11 * inspector/InspectorDOMAgent.cpp: 12 (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): 13 * inspector/InspectorTimelineAgent.cpp: 14 (WebCore::InspectorTimelineAgent::addRecordToTimeline): 15 1 16 2016-04-04 Antti Koivisto <antti@apple.com> 2 17 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r198254 r199005 1670 1670 if (!ariaRelevantAttrValue.isEmpty()) { 1671 1671 // FIXME: Pass enum values rather than strings once unblocked. http://webkit.org/b/133711 1672 String ariaRelevantAdditions = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Additions);1673 String ariaRelevantRemovals = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Removals);1674 String ariaRelevantText = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Text);1672 String ariaRelevantAdditions = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Additions); 1673 String ariaRelevantRemovals = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Removals); 1674 String ariaRelevantText = Inspector::Protocol::InspectorHelpers::getEnumConstantValue(Inspector::Protocol::DOM::LiveRegionRelevant::Text); 1675 1675 liveRegionRelevant = Inspector::Protocol::Array<String>::create(); 1676 1676 const SpaceSplitString& values = SpaceSplitString(ariaRelevantAttrValue, true); -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r198850 r199005 478 478 { 479 479 ASSERT_ARG(record, record); 480 record->setString("type", Inspector::Protocol:: getEnumConstantValue(toProtocol(type)));480 record->setString("type", Inspector::Protocol::InspectorHelpers::getEnumConstantValue(toProtocol(type))); 481 481 482 482 if (m_recordStack.isEmpty()) { -
trunk/Source/WebKit2/ChangeLog
r199002 r199005 1 2016-04-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantValue since r198792 4 https://bugs.webkit.org/show_bug.cgi?id=155745 5 <rdar://problem/25289456> 6 7 Reviewed by Brian Burg. 8 9 Use Inspector::Protocol::AutomationEnums namespace for getEnumConstantValue(). 10 11 * UIProcess/Automation/WebAutomationSession.cpp: 12 * WebProcess/Automation/WebAutomationSessionProxy.cpp: 13 (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): 14 (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): 15 (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal): 16 (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): 17 (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName): 18 (WebKit::WebAutomationSessionProxy::resolveParentFrame): 19 (WebKit::WebAutomationSessionProxy::computeElementLayout): 20 1 21 2016-04-04 Emanuele Aina <emanuele.aina@collabora.com> 2 22 -
trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
r198918 r199005 44 44 do { \ 45 45 auto enumValue = Inspector::Protocol::Automation::ErrorMessage::messageName; \ 46 errorString = Inspector::Protocol:: getEnumConstantValue(enumValue); \46 errorString = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(enumValue); \ 47 47 return; \ 48 48 } while (false) … … 365 365 366 366 if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID())) 367 callback->sendFailure(Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout));367 callback->sendFailure(Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout)); 368 368 m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback)); 369 369 … … 378 378 379 379 if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID())) 380 callback->sendFailure(Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout));380 callback->sendFailure(Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout)); 381 381 m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback)); 382 382 … … 391 391 392 392 if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID())) 393 callback->sendFailure(Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout));393 callback->sendFailure(Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout)); 394 394 m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback)); 395 395 … … 404 404 405 405 if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID())) 406 callback->sendFailure(Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout));406 callback->sendFailure(Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::Timeout)); 407 407 m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback)); 408 408 … … 704 704 WebCore::IntPoint viewPosition = WebCore::IntPoint(static_cast<int>(x), static_cast<int>(y)); 705 705 706 auto parsedInteraction = Inspector::Protocol:: parseEnumValueFromString<Inspector::Protocol::Automation::MouseInteraction>(mouseInteractionString);706 auto parsedInteraction = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::MouseInteraction>(mouseInteractionString); 707 707 if (!parsedInteraction) 708 708 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); 709 709 710 auto parsedButton = Inspector::Protocol:: parseEnumValueFromString<Inspector::Protocol::Automation::MouseButton>(mouseButtonString);710 auto parsedButton = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::MouseButton>(mouseButtonString); 711 711 if (!parsedButton) 712 712 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); … … 718 718 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); 719 719 720 auto parsedModifier = Inspector::Protocol:: parseEnumValueFromString<Inspector::Protocol::Automation::KeyModifier>(modifierString);720 auto parsedModifier = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::KeyModifier>(modifierString); 721 721 if (!parsedModifier) 722 722 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); … … 758 758 if (!interactionObject->getString(ASCIILiteral("type"), interactionTypeString)) 759 759 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); 760 auto interactionType = Inspector::Protocol:: parseEnumValueFromString<Inspector::Protocol::Automation::KeyboardInteractionType>(interactionTypeString);760 auto interactionType = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::KeyboardInteractionType>(interactionTypeString); 761 761 if (!interactionType) 762 762 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); … … 765 765 bool foundVirtualKey = interactionObject->getString(ASCIILiteral("key"), virtualKeyString); 766 766 if (foundVirtualKey) { 767 auto virtualKey = Inspector::Protocol:: parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(virtualKeyString);767 auto virtualKey = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::VirtualKey>(virtualKeyString); 768 768 if (!virtualKey) 769 769 FAIL_WITH_PREDEFINED_ERROR_MESSAGE(InvalidParameter); … … 827 827 String base64EncodedData = platformGetBase64EncodedPNGData(imageDataHandle); 828 828 if (base64EncodedData.isEmpty()) { 829 callback->sendFailure(Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InternalError));829 callback->sendFailure(Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InternalError)); 830 830 return; 831 831 } -
trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp
r198913 r199005 145 145 if (resultIsErrorName) { 146 146 if (result->string() == "JavaScriptTimeout") { 147 String errorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptTimeout);147 String errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptTimeout); 148 148 automationSessionProxy->didEvaluateJavaScriptFunction(frameID, callbackID, String(), errorType); 149 149 } else { 150 150 ASSERT_NOT_REACHED(); 151 String errorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InternalError);151 String errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InternalError); 152 152 automationSessionProxy->didEvaluateJavaScriptFunction(frameID, callbackID, String(), errorType); 153 153 } … … 219 219 220 220 String errorMessage = ASCIILiteral("Callback was not called before the unload event."); 221 String errorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptError);221 String errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptError); 222 222 223 223 auto pendingFrameCallbacks = m_webFramePendingEvaluateJavaScriptCallbacksMap.take(frameID); … … 259 259 return; 260 260 261 String errorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptError);261 String errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::JavaScriptError); 262 262 263 263 JSRetainPtr<JSStringRef> exceptionMessage; … … 266 266 JSRetainPtr<JSStringRef> exceptionName(Adopt, JSValueToStringCopy(context, nameValue, nullptr)); 267 267 if (exceptionName->string() == "NodeNotFound") 268 errorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);268 errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound); 269 269 270 270 JSValueRef messageValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), toJSString(ASCIILiteral("message")).get(), nullptr); … … 291 291 void WebAutomationSessionProxy::resolveChildFrameWithOrdinal(uint64_t frameID, uint32_t ordinal, uint64_t callbackID) 292 292 { 293 String frameNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);293 String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound); 294 294 295 295 WebFrame* frame = WebProcess::singleton().webFrame(frameID); … … 322 322 void WebAutomationSessionProxy::resolveChildFrameWithNodeHandle(uint64_t frameID, const String& nodeHandle, uint64_t callbackID) 323 323 { 324 String frameNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);324 String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound); 325 325 326 326 WebFrame* frame = WebProcess::singleton().webFrame(frameID); … … 353 353 void WebAutomationSessionProxy::resolveChildFrameWithName(uint64_t frameID, const String& name, uint64_t callbackID) 354 354 { 355 String frameNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);355 String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound); 356 356 357 357 WebFrame* frame = WebProcess::singleton().webFrame(frameID); … … 384 384 void WebAutomationSessionProxy::resolveParentFrame(uint64_t frameID, uint64_t callbackID) 385 385 { 386 String frameNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);386 String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound); 387 387 388 388 WebFrame* frame = WebProcess::singleton().webFrame(frameID); … … 424 424 void WebAutomationSessionProxy::computeElementLayout(uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID) 425 425 { 426 String frameNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound);427 String nodeNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);426 String frameNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::FrameNotFound); 427 String nodeNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound); 428 428 429 429 WebFrame* frame = WebProcess::singleton().webFrame(frameID); … … 466 466 { 467 467 ShareableBitmap::Handle handle; 468 String windowNotFoundErrorType = Inspector::Protocol:: getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound);468 String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound); 469 469 470 470 WebPage* page = WebProcess::singleton().webPage(pageID);
Note: See TracChangeset
for help on using the changeset viewer.