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_updater_service_unittest.cc b/components/component_updater/component_updater_service_unittest.cc
index 44a092b6..b688e9d9 100644
--- a/components/component_updater/component_updater_service_unittest.cc
+++ b/components/component_updater/component_updater_service_unittest.cc
@@ -47,18 +47,9 @@
public:
MockInstaller();
- // gMock does not support mocking functions with parameters which have
- // move semantics. This function is a shim to work around it.
- void Install(std::unique_ptr<base::DictionaryValue> manifest,
- const base::FilePath& unpack_path,
- const update_client::CrxInstaller::Callback& callback) {
- Install_(manifest, unpack_path, callback);
- }
-
MOCK_METHOD1(OnUpdateError, void(int error));
- MOCK_METHOD3(Install_,
- void(const std::unique_ptr<base::DictionaryValue>& manifest,
- const base::FilePath& unpack_path,
+ MOCK_METHOD2(Install,
+ void(const base::FilePath& unpack_path,
const update_client::CrxInstaller::Callback& callback));
MOCK_METHOD2(GetInstalledFile,
bool(const std::string& file, base::FilePath* installed_file));