Remove |manifest| as a parameter from CrxInstaller::Install
This is a mechanical change.
The change removes the |manifest| parameter from the CrxInstaller::Install.
In the current implementation, the CRX manifest is read once by common
code in the update_client, then it is handed over to implementors of
Install, and implementors of ComponentInstallerPolicy.
The current component installers mostly ignore the manifest data.
With few exceptions (which ignore the manifest data), the component
nstallers are implemented in terms of ComponentInstaller and
ComponentInstallerPolicy. This change refactors how the component
installer reads the manifest.
For future feature work, there are requirements for the manifest to be
read by sandboxed code. Therefore, reading of the manifest must be happen
outside the implementation of CrxInstaller::Install, so that such code can
have the flexibily in how the reading of the manifest occurs.
Bug: 773923
Change-Id: I3393d1c9258b53ebfeec3cebab56429a41f692d0
Reviewed-on: https://chromium-review.googlesource.com/714400
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Joshua Pawlicki <[email protected]>
Reviewed-by: Adam Langley <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Reviewed-by: Sylvain Defresne <[email protected]>
Reviewed-by: Julian Pastarmov <[email protected]>
Commit-Queue: Sorin Jianu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#508799}
diff --git a/components/component_updater/component_installer_unittest.cc b/components/component_updater/component_installer_unittest.cc
index fd642d4d..0994c588 100644
--- a/components/component_updater/component_installer_unittest.cc
+++ b/components/component_updater/component_installer_unittest.cc
@@ -286,15 +286,13 @@
const auto unpack_path = result().unpack_path;
EXPECT_TRUE(base::DirectoryExists(unpack_path));
- auto manifest = update_client::ReadManifest(unpack_path);
-
base::ScopedPathOverride scoped_path_override(DIR_COMPONENT_USER);
base::FilePath base_dir;
EXPECT_TRUE(PathService::Get(DIR_COMPONENT_USER, &base_dir));
base_dir = base_dir.Append(relative_install_dir);
EXPECT_TRUE(base::CreateDirectory(base_dir));
installer->Install(
- std::move(manifest), unpack_path,
+ unpack_path,
base::Bind([](const update_client::CrxInstaller::Result& result) {
EXPECT_EQ(0, result.error);
}));
@@ -315,8 +313,6 @@
const auto unpack_path = result().unpack_path;
EXPECT_TRUE(base::DirectoryExists(unpack_path));
- auto manifest = update_client::ReadManifest(unpack_path);
-
// Test the precondition that DIR_COMPONENT_USER is not registered with
// the path service.
base::FilePath base_dir;
@@ -324,7 +320,7 @@
// Calling |Install| fails since DIR_COMPONENT_USER does not exist.
installer->Install(
- std::move(manifest), unpack_path,
+ unpack_path,
base::Bind([](const update_client::CrxInstaller::Result& result) {
EXPECT_EQ(static_cast<int>(
update_client::InstallError::NO_DIR_COMPONENT_USER),