<commit_before>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/gpu_blacklist.h"

#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/common/gpu_info.h"

namespace {

// Encode a date as Version, where [0] is year, [1] is month, and [2] is day.
Version* GetDateFromString(const std::string& date_string) {
  // TODO(zmo): verify if in Windows registry, driver dates are always in the
  // format of "mm-dd-yyyy".
  std::vector<std::string> pieces;
  base::SplitString(date_string, '-', &pieces);
  if (pieces.size() > 3 || pieces.size() == 0)
    return NULL;
  std::string date_as_version_string = pieces[0];
  for (size_t i = 1; i < pieces.size(); ++i) {
    date_as_version_string += ".";
    date_as_version_string += pieces[i];
  }
  return Version::GetVersionFromString(date_as_version_string);
}

}  // namespace anonymous

GpuBlacklist::VersionInfo::VersionInfo(const std::string& version_op,
                                       const std::string& version_string,
                                       const std::string& version_string2) {<commit_msg>Fix a bug in software rendering list driver date processing.<commit_after>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/gpu_blacklist.h"

#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/common/gpu_info.h"

namespace {

// Encode a date as Version, where [0] is year, [1] is month, and [2] is day.
Version* GetDateFromString(const std::string& date_string) {
  // TODO(zmo): verify if in Windows registry, driver dates are always in the
  // format of "mm-dd-yyyy".
  std::vector<std::string> pieces;
  base::SplitString(date_string, '-', &pieces);
  if (pieces.size() != 3)
    return NULL;
  std::string date_as_version_string = pieces[2];
  for (size_t i = 0; i < 2; ++i) {
    date_as_version_string += ".";
    date_as_version_string += pieces[i];
  }
  return Version::GetVersionFromString(date_as_version_string);
}

}  // namespace anonymous

GpuBlacklist::VersionInfo::VersionInfo(const std::string& version_op,
                                       const std::string& version_string,
                                       const std::string& version_string2) {
{'fraction_non_alphanumeric': 0.13172043010752688, 'fraction_numerical': 0.008064516129032258, 'mean_word_length': 3.6588419405320813, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3200243', 'n_tokens_mistral': 977, 'n_tokens_neox': 946, 'n_words': 259}