Commit b671b76a authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

SandboxedUnpacker: Remove redundant PostTask usages.

This CL removes two redundant PostTask usages from SandboxedUnpacker. In both
the cases, we are already on the correct sequence, hence we can call the
function synchronously.

BUG=None

Change-Id: I42deaad16bce1db2e2e1905aa13253251791c8b6
Reviewed-on: https://chromium-review.googlesource.com/1110839Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569784}
parent b65ed4f6
...@@ -351,6 +351,10 @@ void SandboxedUnpacker::StartWithCrx(const CRXFileInfo& crx_info) { ...@@ -351,6 +351,10 @@ void SandboxedUnpacker::StartWithCrx(const CRXFileInfo& crx_info) {
void SandboxedUnpacker::StartWithDirectory(const std::string& extension_id, void SandboxedUnpacker::StartWithDirectory(const std::string& extension_id,
const std::string& public_key, const std::string& public_key,
const base::FilePath& directory) { const base::FilePath& directory) {
// We assume that we are started on the thread that the client wants us
// to do file IO on.
DCHECK(unpacker_io_task_runner_->RunsTasksInCurrentSequence());
extension_id_ = extension_id; extension_id_ = extension_id;
public_key_ = public_key; public_key_ = public_key;
if (!CreateTempDirectory()) if (!CreateTempDirectory())
...@@ -368,9 +372,7 @@ void SandboxedUnpacker::StartWithDirectory(const std::string& extension_id, ...@@ -368,9 +372,7 @@ void SandboxedUnpacker::StartWithDirectory(const std::string& extension_id,
return; return;
} }
unpacker_io_task_runner_->PostTask( Unpack(extension_root_);
FROM_HERE,
base::BindOnce(&SandboxedUnpacker::Unpack, this, extension_root_));
} }
SandboxedUnpacker::~SandboxedUnpacker() { SandboxedUnpacker::~SandboxedUnpacker() {
...@@ -410,11 +412,8 @@ void SandboxedUnpacker::UnzipDone(const base::FilePath& zip_file, ...@@ -410,11 +412,8 @@ void SandboxedUnpacker::UnzipDone(const base::FilePath& zip_file,
DCHECK(unpacker_io_task_runner_->RunsTasksInCurrentSequence()); DCHECK(unpacker_io_task_runner_->RunsTasksInCurrentSequence());
if (!error.empty()) { if (!error.empty()) {
unpacker_io_task_runner_->PostTask( ReportFailure(SandboxedUnpackerFailureReason::UNZIP_FAILED,
FROM_HERE, base::BindOnce(&SandboxedUnpacker::ReportFailure, this, l10n_util::GetStringUTF16(IDS_EXTENSION_PACKAGE_UNZIP_ERROR));
SandboxedUnpackerFailureReason::UNZIP_FAILED,
l10n_util::GetStringUTF16(
IDS_EXTENSION_PACKAGE_UNZIP_ERROR)));
return; return;
} }
......
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