Chromium Code Reviews| Index: chrome/browser/safe_browsing/binary_integrity_analyzer_win.cc |
| diff --git a/chrome/browser/safe_browsing/binary_integrity_analyzer_win.cc b/chrome/browser/safe_browsing/binary_integrity_analyzer_win.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c0d6ea920c9005b3857091dd2caef96a7154d74e |
| --- /dev/null |
| +++ b/chrome/browser/safe_browsing/binary_integrity_analyzer_win.cc |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2014 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 "chrome/browser/safe_browsing/binary_integrity_analyzer.h" |
| + |
| +#include "base/files/file_path.h" |
| +#include "base/logging.h" |
| +#include "base/path_service.h" |
| +#include "base/strings/stringprintf.h" |
|
grt (UTC plus 2)
2014/08/08 02:23:05
unused
pmonette_google.com
2014/08/08 15:05:42
Removed.
|
| +#include "version.h" // NOLINT |
| + |
| +namespace safe_browsing { |
| + |
| +std::vector<base::FilePath> GetCriticalBinariesPath() { |
| + static const base::FilePath::CharType* const kUnversionedFiles[] = { |
| + FILE_PATH_LITERAL("chrome.exe"), |
| + }; |
| + static const base::FilePath::CharType* const kVersionedFiles[] = { |
| + FILE_PATH_LITERAL("chrome.dll"), FILE_PATH_LITERAL("chrome_elf.dll"), |
| + }; |
| + |
| + // Find where chrome.exe is installed. |
| + base::FilePath chrome_exe_dir; |
| + if (!PathService::Get(base::DIR_EXE, &chrome_exe_dir)) |
| + NOTREACHED(); |
| + |
| + std::vector<base::FilePath> critical_binaries; |
| + critical_binaries.reserve(arraysize(kUnversionedFiles) + |
| + arraysize(kVersionedFiles)); |
| + |
| + for (size_t i = 0; i < arraysize(kUnversionedFiles); ++i) { |
| + critical_binaries.push_back(chrome_exe_dir.Append(kUnversionedFiles[i])); |
| + } |
| + |
| + base::FilePath version_dir( |
| + chrome_exe_dir.Append(TEXT(CHROME_VERSION_STRING))); |
| + for (size_t i = 0; i < arraysize(kVersionedFiles); ++i) { |
| + critical_binaries.push_back(version_dir.Append(kVersionedFiles[i])); |
| + } |
| + |
| + return critical_binaries; |
| +} |
| + |
| +} // namespace safe_browsing |