chrome/browser/ui/search/search.cc
// Given a field trial group name in the above format, parses out the group
// number and configuration flags.  Will return a group number of 0 on error.
Given a field trial group name in the above format, parses out the group
number and configuration flags.  Will return a group number of 0 on error.
Given a field trial group name in the above format parses out the group number and configuration flags . Will return a group number of 0 on error .
void GetFieldTrialInfo(const std::string& group_name,
                       FieldTrialFlags* flags,
                       uint64* group_number) {
  if (!EndsWith(group_name, kDisablingSuffix, true) &&
      StartsWithASCII(group_name, kGroupNumberPrefix, true)) {
    size_t first_space = group_name.find(" ");
    std::string group_prefix = group_name;
    if (first_space != std::string::npos) {
      group_prefix = group_name.substr(0, first_space);
      base::SplitStringIntoKeyValuePairs(
          group_name.substr(first_space), ':', ' ', flags);
    }
    if (!base::StringToUint64(group_prefix.substr(strlen(kGroupNumberPrefix)),
                              group_number)) {
      *group_number = 0;
    }
  }
}
void GetFieldTrialInfo ( const std :: string & group_name , FieldTrialFlags * flags , uint64 * group_number ) { if ( ! EndsWith ( group_name , kDisablingSuffix , true ) && StartsWithASCII ( group_name , kGroupNumberPrefix , true ) ) { size_t first_space = group_name . find ( " " ) ; std :: string group_prefix = group_name ; if ( first_space != std :: string :: npos ) { group_prefix = group_name . substr ( 0 , first_space ) ; base :: SplitStringIntoKeyValuePairs ( group_name . substr ( first_space ) , ' ' , ' ' , flags ) ; } if ( ! base :: StringToUint64 ( group_prefix . substr ( strlen ( kGroupNumberPrefix ) ) , group_number ) ) { * group_number = 0 ; } } }
Given a field trial group name in the above format, parses out the group
number and configuration flags.
Given a field trial group name in the above format parses out the group number and configuration flags .
// We have a valid trial that starts with "Group" and isn't disabled. // There is a flags section of the group name.  Split that out and parse // it. // Could not parse group number.