Commit 0187a21a authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

Add a DCHECK to prevent a future issue with 3p blocking

The ModuleBlacklistCacheUpdater currently doesn't support a module first
loading into a process where injection is allowed then loading into one
where it should be blocked.

This DCHECK ensures this limitation will be addressed before adding
another supported process type.

Bug: 662084
Change-Id: Id49f323ee2e9a53bdafcd8f7391495e26d5d8cce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879948
Auto-Submit: Patrick Monette <pmonette@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: default avatarChris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710987}
parent b3c71165
...@@ -219,6 +219,11 @@ void ModuleDatabase::OnModuleLoad(content::ProcessType process_type, ...@@ -219,6 +219,11 @@ void ModuleDatabase::OnModuleLoad(content::ProcessType process_type,
uint32_t module_time_date_stamp) { uint32_t module_time_date_stamp) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(process_type == content::PROCESS_TYPE_BROWSER ||
process_type == content::PROCESS_TYPE_RENDERER)
<< "The current logic in ModuleBlacklistCacheUpdater does not support "
"other process types yet. See https://crbug.com/662084 for details.";
ModuleInfo* module_info = nullptr; ModuleInfo* module_info = nullptr;
bool new_module = FindOrCreateModuleInfo( bool new_module = FindOrCreateModuleInfo(
module_path, module_size, module_time_date_stamp, &module_info); module_path, module_size, module_time_date_stamp, &module_info);
......
...@@ -10,9 +10,11 @@ struct ModuleInfoData; ...@@ -10,9 +10,11 @@ struct ModuleInfoData;
class ModuleDatabaseObserver { class ModuleDatabaseObserver {
public: public:
// Invoked when a new module is found either by loading into the process, or // Invoked when a new module is found either by loading into a Chrome process,
// by being registered as a shell extension or IME. Only invoked after the // or by being registered as a shell extension or IME. Only invoked after the
// module was inspected on disk. // module was inspected on disk.
// Note that this is not invoked multiple times if the module subsequently
// loads into a different process type.
virtual void OnNewModuleFound(const ModuleInfoKey& module_key, virtual void OnNewModuleFound(const ModuleInfoKey& module_key,
const ModuleInfoData& module_data) {} const ModuleInfoData& module_data) {}
......
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