tools/flags/generate_unexpire_flags.py
def gen_features_impl(prog_name, mstone):
  """Generates the definitions for the unexpiry features and the expiry-check
     function.

  This function generates the contents of a complete C++ source file,
  which defines base::Features for unexpiration of flags from recent milestones,
  as well as a function ExpiryEnabledForMilestone().
  """
  body = file_header(prog_name)
  body += """
#include "base/feature_list.h"
#include "chrome/browser/unexpire_flags_gen.h"

namespace flags {

"""

  features = [(m, 'UnexpireFlagsM' + str(m)) for m in recent_mstones(mstone)]
  for feature in features:
    body += 'const base::Feature k{f} {{\n'.format(f=feature[1])
    body += '  "{f}",\n'.format(f=feature[1])
    body += '  base::FEATURE_DISABLED_BY_DEFAULT\n'
    body += '};\n\n'

  body += """// Returns the unexpire feature for the given mstone, if any.
const base::Feature* GetUnexpireFeatureForMilestone(int milestone) {
  switch (milestone) {
"""

  for feature in features:
    body += '    case {m}: return &k{f};\n'.format(m=feature[0], f=feature[1])
  body += """    default: return nullptr;
  }
}

}  // namespace flags
"""

  return body
Generates the definitions for the unexpiry features and the expiry-check
     function.

  This function generates the contents of a complete C++ source file,
  which defines base::Features for unexpiration of flags from recent milestones,
  as well as a function ExpiryEnabledForMilestone().
  
Generates the definitions for the unexpiry features and the expiry-check
function.

This function generates the contents of a complete C++ source file,
which defines base::Features for unexpiration of flags from recent milestones,
as well as a function ExpiryEnabledForMilestone().
Generates the definitions for the unexpiry features and the expiry - check function . This function generates the contents of a complete C ++ source file which defines base :: Features for unexpiration of flags from recent milestones as well as a function ExpiryEnabledForMilestone () .
def gen_features_impl(prog_name, mstone):
  body = file_header(prog_name)
  body += """
#include "base/feature_list.h"
#include "chrome/browser/unexpire_flags_gen.h"
namespace flags {
"""
  features = [(m, 'UnexpireFlagsM' + str(m)) for m in recent_mstones(mstone)]
  for feature in features:
    body += 'const base::Feature k{f} {{\n'.format(f=feature[1])
    body += '  "{f}",\n'.format(f=feature[1])
    body += '  base::FEATURE_DISABLED_BY_DEFAULT\n'
    body += '};\n\n'
  body += """// Returns the unexpire feature for the given mstone, if any.
const base::Feature* GetUnexpireFeatureForMilestone(int milestone) {
  switch (milestone) {
"""
  for feature in features:
    body += '    case {m}: return &k{f};\n'.format(m=feature[0], f=feature[1])
  body += """    default: return nullptr;
  }
}
}  // namespace flags
"""
  return body
def gen_features_impl ( prog_name , mstone ) : body = file_header ( prog_name ) body += """
#include "base/feature_list.h"
#include "chrome/browser/unexpire_flags_gen.h"

namespace flags {

""" features = [ ( m , 'UnexpireFlagsM' + str ( m ) ) for m in recent_mstones ( mstone ) ] for feature in features : body += 'const base::Feature k{f} {{\n' . format ( f = feature [ 1 ] ) body += '  "{f}",\n' . format ( f = feature [ 1 ] ) body += '  base::FEATURE_DISABLED_BY_DEFAULT\n' body += '};\n\n' body += """// Returns the unexpire feature for the given mstone, if any.
const base::Feature* GetUnexpireFeatureForMilestone(int milestone) {
  switch (milestone) {
""" for feature in features : body += '    case {m}: return &k{f};\n' . format ( m = feature [ 0 ] , f = feature [ 1 ] ) body += """    default: return nullptr;
  }
}

}  // namespace flags
""" return body
Generates the definitions for the unexpiry features and the expiry-check
function.
Generates the definitions for the unexpiry features and the expiry - check function .
"""Generates the definitions for the unexpiry features and the expiry-check
     function.

  This function generates the contents of a complete C++ source file,
  which defines base::Features for unexpiration of flags from recent milestones,
  as well as a function ExpiryEnabledForMilestone().
  """
prog_name
mstone