Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.py

Issue 2207423002: Implement '[SecureContext]' IDL attribute for interfaces, methods and attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 for method in methods), 550 for method in methods),
551 'has_private_script': (any(attribute['is_implemented_in_private_script'] for attribute in attributes) or 551 'has_private_script': (any(attribute['is_implemented_in_private_script'] for attribute in attributes) or
552 any(method['is_implemented_in_private_script'] fo r method in methods)), 552 any(method['is_implemented_in_private_script'] fo r method in methods)),
553 'iterator_method': iterator_method, 553 'iterator_method': iterator_method,
554 'has_array_iterator': has_array_iterator, 554 'has_array_iterator': has_array_iterator,
555 'methods': methods, 555 'methods': methods,
556 }) 556 })
557 557
558 # Conditionally enabled members 558 # Conditionally enabled members
559 has_conditional_attributes_on_instance = any( 559 has_conditional_attributes_on_instance = any(
560 attribute['exposed_test'] and attribute['on_instance'] 560 (attribute['exposed_test'] or attribute['secure_context_test']) and attr ibute['on_instance']
561 for attribute in attributes) 561 for attribute in attributes)
562 has_conditional_attributes_on_prototype = any( 562 has_conditional_attributes_on_prototype = any(
563 attribute['exposed_test'] and attribute['on_prototype'] 563 (attribute['exposed_test'] or attribute['secure_context_test']) and attr ibute['on_prototype']
564 for attribute in attributes) 564 for attribute in attributes)
565 context.update({ 565 context.update({
566 'has_conditional_attributes_on_instance': 566 'has_conditional_attributes_on_instance':
567 has_conditional_attributes_on_instance, 567 has_conditional_attributes_on_instance,
568 'has_conditional_attributes_on_prototype': 568 'has_conditional_attributes_on_prototype':
569 has_conditional_attributes_on_prototype, 569 has_conditional_attributes_on_prototype,
570 }) 570 })
571 571
572 context.update({ 572 context.update({
573 'indexed_property_getter': property_getter(interface.indexed_property_ge tter, ['index']), 573 'indexed_property_getter': property_getter(interface.indexed_property_ge tter, ['index']),
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 'length': function_length, 781 'length': function_length,
782 'length_tests_methods': length_tests_methods(effective_overloads_by_leng th), 782 'length_tests_methods': length_tests_methods(effective_overloads_by_leng th),
783 # 1. Let maxarg be the length of the longest type list of the 783 # 1. Let maxarg be the length of the longest type list of the
784 # entries in S. 784 # entries in S.
785 'maxarg': maxarg, 785 'maxarg': maxarg,
786 'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs] 786 'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs]
787 'returns_promise_all': promise_overload_count > 0, 787 'returns_promise_all': promise_overload_count > 0,
788 'runtime_determined_lengths': runtime_determined_lengths, 788 'runtime_determined_lengths': runtime_determined_lengths,
789 'runtime_determined_maxargs': runtime_determined_maxargs, 789 'runtime_determined_maxargs': runtime_determined_maxargs,
790 'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled _function'), # [RuntimeEnabled] 790 'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled _function'), # [RuntimeEnabled]
791 'secure_context_test_all': common_value(overloads, 'secure_context_test' ), # [SecureContext]
791 'valid_arities': (lengths 792 'valid_arities': (lengths
792 # Only need to report valid arities if there is a gap in the 793 # Only need to report valid arities if there is a gap in the
793 # sequence of possible lengths, otherwise invalid leng th means 794 # sequence of possible lengths, otherwise invalid leng th means
794 # "not enough arguments". 795 # "not enough arguments".
795 if lengths[-1] - lengths[0] != len(lengths) - 1 else N one), 796 if lengths[-1] - lengths[0] != len(lengths) - 1 else N one),
796 'visible': has_overload_visible, 797 'visible': has_overload_visible,
797 'has_partial_overloads': has_partial_overloads, 798 'has_partial_overloads': has_partial_overloads,
798 } 799 }
799 800
800 801
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 extended_attributes = deleter.extended_attributes 1399 extended_attributes = deleter.extended_attributes
1399 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1400 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1400 is_ce_reactions = 'CEReactions' in extended_attributes 1401 is_ce_reactions = 'CEReactions' in extended_attributes
1401 return { 1402 return {
1402 'is_call_with_script_state': is_call_with_script_state, 1403 'is_call_with_script_state': is_call_with_script_state,
1403 'is_ce_reactions': is_ce_reactions, 1404 'is_ce_reactions': is_ce_reactions,
1404 'is_custom': 'Custom' in extended_attributes, 1405 'is_custom': 'Custom' in extended_attributes,
1405 'is_raises_exception': 'RaisesException' in extended_attributes, 1406 'is_raises_exception': 'RaisesException' in extended_attributes,
1406 'name': cpp_name(deleter), 1407 'name': cpp_name(deleter),
1407 } 1408 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_attributes.py ('k') | third_party/WebKit/Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698