Ejemplo n.º 1
0
 def _headers_header_includes(self, entries):
     includes = dict()
     for entry in entries:
         cpp_name = name_utilities.cpp_name(entry)
         # Avoid duplicate includes.
         if cpp_name in includes:
             continue
         include = '#include "%(path)s"\n#include "V8%(script_name)s.h"' % {
             'path': self._headers_header_include_path(entry),
             'script_name': name_utilities.script_name(entry),
         }
         includes[cpp_name] = self.wrap_with_condition(include, entry['Conditional'])
     return includes.values()
Ejemplo n.º 2
0
 def _validate_entries(self):
     # If there is more than one entry with the same script name, only the first one will ever
     # be hit in practice, and so we'll silently ignore any properties requested for the second
     # (like RuntimeEnabled - see crbug.com/332588).
     entries_by_script_name = dict()
     for entry in self.in_file.name_dictionaries:
         script_name = name_utilities.script_name(entry)
         if script_name in entries_by_script_name:
             self._fatal('Multiple entries with script_name=%(script_name)s: %(name1)s %(name2)s' % {
                 'script_name': script_name,
                 'name1': entry['name'],
                 'name2': entries_by_script_name[script_name]['name']})
         entries_by_script_name[script_name] = entry
Ejemplo n.º 3
0
 def _validate_entries(self):
     # If there is more than one entry with the same script name, only the first one will ever
     # be hit in practice, and so we'll silently ignore any properties requested for the second
     # (like RuntimeEnabled - see crbug.com/332588).
     entries_by_script_name = dict()
     for entry in self.in_file.name_dictionaries:
         script_name = name_utilities.script_name(entry)
         if script_name in entries_by_script_name:
             self._fatal('Multiple entries with script_name=%(script_name)s: %(name1)s %(name2)s' % {
                 'script_name': script_name,
                 'name1': entry['name'],
                 'name2': entries_by_script_name[script_name]['name']})
         entries_by_script_name[script_name] = entry
Ejemplo n.º 4
0
 def _headers_header_includes(self, entries):
     includes = dict()
     for entry in entries:
         cpp_name = name_utilities.cpp_name(entry)
         # Avoid duplicate includes.
         if cpp_name in includes:
             continue
         include = '#include "%(path)s"\n#include "V8%(script_name)s.h"' % {
             'path': self._headers_header_include_path(entry),
             'script_name': name_utilities.script_name(entry),
         }
         includes[cpp_name] = self.wrap_with_condition(include, entry['Conditional'])
     return includes.values()
Ejemplo n.º 5
0
 def _factory_implementation(self, event):
     if event['RuntimeEnabled']:
         runtime_condition = ' && RuntimeEnabledFeatures::%s()' % name_utilities.lower_first(event['RuntimeEnabled'])
     else:
         runtime_condition = ''
     script_name = name_utilities.script_name(event)
     cpp_name = name_utilities.cpp_name(event)
     implementation = """    if (type == "%(script_name)s"%(runtime_condition)s)
     return %(cpp_name)s::create();""" % {
         'script_name': script_name,
         'runtime_condition': runtime_condition,
         'cpp_name': cpp_name,
     }
     return self.wrap_with_condition(implementation, event['Conditional'])
 def _headers_header_includes(self, entries):
     includes = dict()
     for entry in entries:
         cpp_name = name_utilities.cpp_name(entry)
         # Avoid duplicate includes.
         if cpp_name in includes:
             continue
         if self.suffix == 'Modules':
             subdir_name = 'modules'
         else:
             subdir_name = 'core'
         includes[cpp_name] = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v8/V8%(script_name)s.h"' % {
             'path': self._headers_header_include_path(entry),
             'script_name': name_utilities.script_name(entry),
             'subdir_name': subdir_name,
         }
     return includes.values()
Ejemplo n.º 7
0
 def _headers_header_includes(self, entries):
     includes = dict()
     for entry in entries:
         cpp_name = name_utilities.cpp_name(entry)
         # Avoid duplicate includes.
         if cpp_name in includes:
             continue
         if self.suffix == 'Modules':
             subdir_name = 'modules'
         else:
             subdir_name = 'core'
         includes[
             cpp_name] = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v8/V8%(script_name)s.h"' % {
                 'path': self._headers_header_include_path(entry),
                 'script_name': name_utilities.script_name(entry),
                 'subdir_name': subdir_name,
             }
     return includes.values()