third_party/blink/renderer/bindings/scripts/bind_gen/codegen_context.py
def init(cls):
        """Initialize the class.  Must be called exactly once."""
        assert not hasattr(cls, "_was_initialized"), "Do not call twice."
        cls._was_initialized = True

        # List of
        #   attribute name: default value
        cls._context_attrs = {
            # Top-level definition
            "callback_function": None,
            "callback_interface": None,
            "dictionary": None,
            "enumeration": None,
            "interface": None,
            "namespace": None,
            "observable_array": None,
            "typedef": None,
            "union": None,

            # Class-member-ish definition
            "attribute": None,
            "attribute_get": False,
            "attribute_set": False,
            "constant": None,
            "constructor": None,
            "constructor_group": None,
            "dict_member": None,
            "exposed_construct": None,
            "is_named_constructor": False,
            "legacy_window_alias": None,
            "operation": None,
            "operation_group": None,

            # Special member-ish definition
            "indexed_property_getter": None,
            "indexed_property_setter": None,
            "named_property_getter": None,
            "named_property_setter": None,
            "named_property_deleter": None,
            "stringifier": None,

            # Cache of a tuple of dictionary._DictionaryMember for the own
            # members of the dictionary of which the Blink class is being
            # generated.  The cache is used in dictionary.py to save code
            # generation time.
            "dictionary_own_members": (),
            # Cache of a tuple of union._UnionMember for the flattened member
            # types of the union of which the Blink class is being generated.
            # The cache is used in union.py to save code generation time.
            "union_members": (),

            # The names of the class being generated and its base class.
            "base_class_name": None,
            "class_name": None,

            # Main world or all worlds
            # Used via [PerWorldBindings] to optimize the code path of the main
            # world.
            "for_world": cls.ALL_WORLDS,

            # True when generating a callback of [NoAllocDirectCall].
            "no_alloc_direct_call": False,
            # True when generating a (fake) callback of [NoAllocDirectCall] for
            # testing.
            "no_alloc_direct_call_for_testing": False,

            # Type of V8 callback function which implements IDL attribute,
            # IDL operation, etc.
            "v8_callback_type": cls.V8_FUNCTION_CALLBACK,
        }

        # List of computational attribute names
        cls._computational_attrs = (
            "class_like",
            "function_like",
            "idl_definition",
            "idl_location",
            "idl_location_and_name",
            "idl_name",
            "may_throw_exception",
            "member_like",
            "property_",
            "return_type",
        )

        # Define public readonly properties of this class.
        for attr in cls._context_attrs.keys():

            def make_get():
                _attr = cls._internal_attr(attr)

                def get(self):
                    return getattr(self, _attr)

                return get

            setattr(cls, attr, property(make_get()))
Initialize the class.  Must be called exactly once.
Initialize the class.  Must be called exactly once.
Initialize the class . Must be called exactly once .
def init(cls):
        assert not hasattr(cls, "_was_initialized"), "Do not call twice."
        cls._was_initialized = True
        cls._context_attrs = {
            "callback_function": None,
            "callback_interface": None,
            "dictionary": None,
            "enumeration": None,
            "interface": None,
            "namespace": None,
            "observable_array": None,
            "typedef": None,
            "union": None,
            "attribute": None,
            "attribute_get": False,
            "attribute_set": False,
            "constant": None,
            "constructor": None,
            "constructor_group": None,
            "dict_member": None,
            "exposed_construct": None,
            "is_named_constructor": False,
            "legacy_window_alias": None,
            "operation": None,
            "operation_group": None,
            "indexed_property_getter": None,
            "indexed_property_setter": None,
            "named_property_getter": None,
            "named_property_setter": None,
            "named_property_deleter": None,
            "stringifier": None,
            "dictionary_own_members": (),
            "union_members": (),
            "base_class_name": None,
            "class_name": None,
            "for_world": cls.ALL_WORLDS,
            "no_alloc_direct_call": False,
            "no_alloc_direct_call_for_testing": False,
            "v8_callback_type": cls.V8_FUNCTION_CALLBACK,
        }
         computational attribute names
        cls._computational_attrs = (
            "class_like",
            "function_like",
            "idl_definition",
            "idl_location",
            "idl_location_and_name",
            "idl_name",
            "may_throw_exception",
            "member_like",
            "property_",
            "return_type",
        )
        for attr in cls._context_attrs.keys():
            def make_get():
                _attr = cls._internal_attr(attr)
                def get(self):
                    return getattr(self, _attr)
                return get
            setattr(cls, attr, property(make_get()))
def init ( cls ) : assert not hasattr ( cls , "_was_initialized" ) , "Do not call twice." cls . _was_initialized = True cls . _context_attrs = { "callback_function" : None , "callback_interface" : None , "dictionary" : None , "enumeration" : None , "interface" : None , "namespace" : None , "observable_array" : None , "typedef" : None , "union" : None , "attribute" : None , "attribute_get" : False , "attribute_set" : False , "constant" : None , "constructor" : None , "constructor_group" : None , "dict_member" : None , "exposed_construct" : None , "is_named_constructor" : False , "legacy_window_alias" : None , "operation" : None , "operation_group" : None , "indexed_property_getter" : None , "indexed_property_setter" : None , "named_property_getter" : None , "named_property_setter" : None , "named_property_deleter" : None , "stringifier" : None , "dictionary_own_members" : ( ) , "union_members" : ( ) , "base_class_name" : None , "class_name" : None , "for_world" : cls . ALL_WORLDS , "no_alloc_direct_call" : False , "no_alloc_direct_call_for_testing" : False , "v8_callback_type" : cls . V8_FUNCTION_CALLBACK , } cls . _computational_attrs = ( "class_like" , "function_like" , "idl_definition" , "idl_location" , "idl_location_and_name" , "idl_name" , "may_throw_exception" , "member_like" , "property_" , "return_type" , ) for attr in cls . _context_attrs . keys ( ) : def make_get ( ) : _attr = cls . _internal_attr ( attr ) def get ( self ) : return getattr ( self , _attr ) return get setattr ( cls , attr , property ( make_get ( ) ) )
Initialize the class.
Initialize the class .
"""Initialize the class.  Must be called exactly once.""" # List of #   attribute name: default value # Top-level definition # Class-member-ish definition # Special member-ish definition # Cache of a tuple of dictionary._DictionaryMember for the own # members of the dictionary of which the Blink class is being # generated.  The cache is used in dictionary.py to save code # generation time. # Cache of a tuple of union._UnionMember for the flattened member # types of the union of which the Blink class is being generated. # The cache is used in union.py to save code generation time. # The names of the class being generated and its base class. # Main world or all worlds # Used via [PerWorldBindings] to optimize the code path of the main # world. # True when generating a callback of [NoAllocDirectCall]. # True when generating a (fake) callback of [NoAllocDirectCall] for # testing. # Type of V8 callback function which implements IDL attribute, # IDL operation, etc. # List of computational attribute names # Define public readonly properties of this class.
cls