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/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc
index 65b6f71..2f45222 100644
--- a/components/update_client/update_client_unittest.cc
+++ b/components/update_client/update_client_unittest.cc
@@ -1354,25 +1354,15 @@
 TEST_F(UpdateClientTest, OneCrxInstallError) {
   class MockInstaller : public CrxInstaller {
    public:
-    // 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 Callback& callback) {
-      return 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 Callback& callback));
     MOCK_METHOD2(GetInstalledFile,
                  bool(const std::string& file, base::FilePath* installed_file));
     MOCK_METHOD0(Uninstall, bool());
 
-    void OnInstall(const std::unique_ptr<base::DictionaryValue>& manifest,
-                   const base::FilePath& unpack_path,
+    void OnInstall(const base::FilePath& unpack_path,
                    const Callback& callback) {
       unpack_path_ = unpack_path;
       EXPECT_TRUE(base::DirectoryExists(unpack_path_));
@@ -1404,7 +1394,7 @@
           base::MakeRefCounted<MockInstaller>();
 
       EXPECT_CALL(*installer, OnUpdateError(_)).Times(0);
-      EXPECT_CALL(*installer, Install_(_, _, _))
+      EXPECT_CALL(*installer, Install(_, _))
           .WillOnce(Invoke(installer.get(), &MockInstaller::OnInstall));
       EXPECT_CALL(*installer, GetInstalledFile(_, _)).Times(0);
       EXPECT_CALL(*installer, Uninstall()).Times(0);