tools/json_schema_compiler/h_generator.py
def _GenerateFunctionParams(self, function):
    """Generates the struct for passing parameters from JSON to a function.
    """
    if not function.params:
      return Code()

    c = Code()
    (c.Sblock('struct Params {')
      .Append('static std::unique_ptr<Params> Create(%s);' %
                  self._GenerateParams(
                      ('const base::Value::ConstListView& args',)))
      .Append('Params(const Params&) = delete;')
      .Append('Params& operator=(const Params&) = delete;')
      .Append('~Params();')
      .Append()
      .Cblock(self._GenerateTypes(p.type_ for p in function.params))
      .Cblock(self._GenerateFields(function.params))
      .Eblock()
      .Append()
      .Sblock(' private:')
        .Append('Params();')
      .Eblock('};')
    )
    return c
Generates the struct for passing parameters from JSON to a function.
    
Generates the struct for passing parameters from JSON to a function.
Generates the struct for passing parameters from JSON to a function .
def _GenerateFunctionParams(self, function):
    if not function.params:
      return Code()
    c = Code()
    (c.Sblock('struct Params {')
      .Append('static std::unique_ptr<Params> Create(%s);' %
                  self._GenerateParams(
                      ('const base::Value::ConstListView& args',)))
      .Append('Params(const Params&) = delete;')
      .Append('Params& operator=(const Params&) = delete;')
      .Append('~Params();')
      .Append()
      .Cblock(self._GenerateTypes(p.type_ for p in function.params))
      .Cblock(self._GenerateFields(function.params))
      .Eblock()
      .Append()
      .Sblock(' private:')
        .Append('Params();')
      .Eblock('};')
    )
    return c
def _GenerateFunctionParams ( self , function ) : if not function . params : return Code ( ) c = Code ( ) ( c . Sblock ( 'struct Params {' ) . Append ( 'static std::unique_ptr<Params> Create(%s);' % self . _GenerateParams ( ( 'const base::Value::ConstListView& args' , ) ) ) . Append ( 'Params(const Params&) = delete;' ) . Append ( 'Params& operator=(const Params&) = delete;' ) . Append ( '~Params();' ) . Append ( ) . Cblock ( self . _GenerateTypes ( p . type_ for p in function . params ) ) . Cblock ( self . _GenerateFields ( function . params ) ) . Eblock ( ) . Append ( ) . Sblock ( ' private:' ) . Append ( 'Params();' ) . Eblock ( '};' ) ) return c
Generates the struct for passing parameters from JSON to a function.
Generates the struct for passing parameters from JSON to a function .
"""Generates the struct for passing parameters from JSON to a function.
    """
self
function