Commit afc5ea01 authored by Joe Mason's avatar Joe Mason Committed by Commit Bot

Add matched_extensions field to PUPData and related mojo interface

Also includes a .clang_format file in the pup_data dir that was missed,
which caused dummy_signatures.cc to be reformatted.

R=csharp@chromium.org

Bug: 830892
Change-Id: I720c083ee6f8ee2b6f1805392419f43c91d43026
Reviewed-on: https://chromium-review.googlesource.com/c/1338205Reviewed-by: default avatarChris Sharp <csharp@chromium.org>
Commit-Queue: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/master@{#608806}
parent 08a51624
# Defines the Chromium style for automatic reformatting.
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Chromium
# Don't pack arguments on a single line, this ensures that all raw_pup data
# structures are declared in the same way.
BinPackArguments: false
\ No newline at end of file
...@@ -15,6 +15,7 @@ source_set("pup_data_base") { ...@@ -15,6 +15,7 @@ source_set("pup_data_base") {
deps = [ deps = [
"//base:base", "//base:base",
"//chrome/chrome_cleaner/chrome_utils:force_installed_extension",
"//chrome/chrome_cleaner/os:common_os", "//chrome/chrome_cleaner/os:common_os",
"//chrome/chrome_cleaner/proto:shared_pup_enums_proto", "//chrome/chrome_cleaner/proto:shared_pup_enums_proto",
] ]
......
...@@ -9,8 +9,12 @@ namespace chrome_cleaner { ...@@ -9,8 +9,12 @@ namespace chrome_cleaner {
// An array of signatures that only contains the sentinel value and represents // An array of signatures that only contains the sentinel value and represents
// an empty array. // an empty array.
const PUPData::UwSSignature dummy_signatures[] = { const PUPData::UwSSignature dummy_signatures[] = {
{PUPData::kInvalidUwSId, PUPData::FLAGS_NONE, nullptr, {PUPData::kInvalidUwSId,
PUPData::kMaxFilesToRemoveSmallUwS, kNoDisk, kNoRegistry, PUPData::FLAGS_NONE,
nullptr,
PUPData::kMaxFilesToRemoveSmallUwS,
kNoDisk,
kNoRegistry,
kNoCustomMatcher}}; kNoCustomMatcher}};
// While testing we will set up special signatures but we still can't have // While testing we will set up special signatures but we still can't have
......
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "chrome/chrome_cleaner/chrome_utils/force_installed_extension.h"
#include "chrome/chrome_cleaner/constants/uws_id.h" #include "chrome/chrome_cleaner/constants/uws_id.h"
#include "chrome/chrome_cleaner/logging/proto/shared_data.pb.h" #include "chrome/chrome_cleaner/logging/proto/shared_data.pb.h"
#include "chrome/chrome_cleaner/os/disk_util_types.h" #include "chrome/chrome_cleaner/os/disk_util_types.h"
...@@ -309,6 +311,9 @@ class PUPData { ...@@ -309,6 +311,9 @@ class PUPData {
// Mapping from detected files to where they were found. // Mapping from detected files to where they were found.
FileInfoMap disk_footprints_info; FileInfoMap disk_footprints_info;
// List of UwE found by the scanner.
std::vector<ForceInstalledExtension> matched_extensions;
protected: protected:
// Allow PUPData to update |signature_| when UpdateCachedUwS is called. // Allow PUPData to update |signature_| when UpdateCachedUwS is called.
// The signature pointers can be invalidated when TestPUPData creates new // The signature pointers can be invalidated when TestPUPData creates new
......
...@@ -9,6 +9,13 @@ namespace chrome_cleaner { ...@@ -9,6 +9,13 @@ namespace chrome_cleaner {
const UwSId kGoogleTestAUwSID = 20001; const UwSId kGoogleTestAUwSID = 20001;
const UwSId kGoogleTestBUwSID = 20002; const UwSId kGoogleTestBUwSID = 20002;
const char kGoogleTestAUwEID[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const char kGoogleTestBUwEID[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
// invalid because the characters must be between 'a' and 'p' (inclusive).
const char kGoogleTestExtensionInvalid1[] =
"abcdefghijklmnopqrstuvwxyzabcdefghijk";
const char kGoogleTestExtensionInvalid2[] = "";
// The contents of the Google A and Google B test UwS files. // The contents of the Google A and Google B test UwS files.
// These files must be named with an extension recognized as // These files must be named with an extension recognized as
// an executable, such as .exe or .bat. // an executable, such as .exe or .bat.
......
...@@ -12,6 +12,11 @@ namespace chrome_cleaner { ...@@ -12,6 +12,11 @@ namespace chrome_cleaner {
extern const UwSId kGoogleTestAUwSID; extern const UwSId kGoogleTestAUwSID;
extern const UwSId kGoogleTestBUwSID; extern const UwSId kGoogleTestBUwSID;
extern const char kGoogleTestAUwEID[];
extern const char kGoogleTestBUwEID[];
extern const char kGoogleTestExtensionInvalid1[];
extern const char kGoogleTestExtensionInvalid2[];
extern const char kTestUwsAFileContents[]; extern const char kTestUwsAFileContents[];
extern const int kTestUwsAFileContentsSize; extern const int kTestUwsAFileContentsSize;
extern const wchar_t kTestUwsAFilename[]; extern const wchar_t kTestUwsAFilename[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment