| Index: chrome/browser/extensions/startup_helper.cc
|
| diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc
|
| index 4432e7ff819d48616d09877b621b6c295961210b..f039cb6e892cccae7ee86759289e4da494f45d96 100644
|
| --- a/chrome/browser/extensions/startup_helper.cc
|
| +++ b/chrome/browser/extensions/startup_helper.cc
|
| @@ -121,10 +121,15 @@ namespace {
|
| class ValidateCrxHelper : public SandboxedUnpackerClient {
|
| public:
|
| ValidateCrxHelper(const base::FilePath& crx_file,
|
| + const std::string& package_hash,
|
| const base::FilePath& temp_dir,
|
| base::RunLoop* run_loop)
|
| - : crx_file_(crx_file), temp_dir_(temp_dir), run_loop_(run_loop),
|
| - finished_(false), success_(false) {}
|
| + : crx_file_(crx_file),
|
| + package_hash_(package_hash),
|
| + temp_dir_(temp_dir),
|
| + run_loop_(run_loop),
|
| + finished_(false),
|
| + success_(false) {}
|
|
|
| bool finished() { return finished_; }
|
| bool success() { return success_; }
|
| @@ -175,18 +180,18 @@ class ValidateCrxHelper : public SandboxedUnpackerClient {
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE);
|
|
|
| scoped_refptr<SandboxedUnpacker> unpacker(
|
| - new SandboxedUnpacker(crx_file_,
|
| - Manifest::INTERNAL,
|
| + new SandboxedUnpacker(crx_file_, package_hash_, Manifest::INTERNAL,
|
| 0, /* no special creation flags */
|
| - temp_dir_,
|
| - file_thread_proxy.get(),
|
| - this));
|
| + temp_dir_, file_thread_proxy.get(), this));
|
| unpacker->Start();
|
| }
|
|
|
| // The file being validated.
|
| const base::FilePath& crx_file_;
|
|
|
| + // SHA256 hash returned from WebStore.
|
| + const std::string& package_hash_;
|
| +
|
| // The temporary directory where the sandboxed unpacker will do work.
|
| const base::FilePath& temp_dir_;
|
|
|
| @@ -221,9 +226,11 @@ bool StartupHelper::ValidateCrx(const base::CommandLine& cmd_line,
|
| return false;
|
| }
|
|
|
| + std::string hash = cmd_line.GetSwitchValueASCII(switches::kValidateCrxHash);
|
| +
|
| base::RunLoop run_loop;
|
| scoped_refptr<ValidateCrxHelper> helper(
|
| - new ValidateCrxHelper(path, temp_dir.path(), &run_loop));
|
| + new ValidateCrxHelper(path, hash, temp_dir.path(), &run_loop));
|
| helper->Start();
|
| if (!helper->finished())
|
| run_loop.Run();
|
| @@ -298,7 +305,7 @@ void AppInstallHelper::OnAppInstallComplete(bool success,
|
| const std::string& error,
|
| webstore_install::Result result) {
|
| success_ = success;
|
| - error_= error;
|
| + error_ = error;
|
| done_callback_.Run();
|
| }
|
|
|
|
|