SandboxedUnpacker: Prevent unnecessary PostTask while reporting failure.

SandboxedUnpacker::ReportUnpackingError posts a task on the
|unpacker_io_task_runner_| to report unpacking failures. However, all its
callers are on |unpacker_io_task_runner_| itself. Prevent unnecessarily posting
a task by merging ReportUnpackingError and UnpackExtensionFailed methods.

BUG=None

Change-Id: Id229392333d0236fd60a5cce0cf642f3aa436ab8
Reviewed-on: https://chromium-review.googlesource.com/1108574
Commit-Queue: Karan Bhatia <[email protected]>
Reviewed-by: Jay Civelli <[email protected]>
Reviewed-by: Devlin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#569167}
diff --git a/extensions/browser/sandboxed_unpacker.h b/extensions/browser/sandboxed_unpacker.h
index 132ff75..1744f76 100644
--- a/extensions/browser/sandboxed_unpacker.h
+++ b/extensions/browser/sandboxed_unpacker.h
@@ -62,6 +62,9 @@
   // dnr_ruleset_checksum - Checksum for the indexed ruleset corresponding to
   // the Declarative Net Request API. Optional since it's only valid for
   // extensions which provide a declarative ruleset.
+  //
+  // Note: OnUnpackSuccess/Failure may be called either synchronously or
+  // asynchronously from SandboxedUnpacker::StartWithCrx/Directory.
   virtual void OnUnpackSuccess(
       const base::FilePath& temp_dir,
       const base::FilePath& extension_root,
@@ -163,9 +166,9 @@
                         const base::Optional<std::string>& error);
   void UnpackExtensionSucceeded(
       std::unique_ptr<base::DictionaryValue> manifest);
-  void UnpackExtensionFailed(const base::string16& error);
 
-  void ReportUnpackingError(base::StringPiece error);
+  // Helper which calls ReportFailure.
+  void ReportUnpackExtensionFailed(base::StringPiece error);
 
   void ImageSanitizationDone(std::unique_ptr<base::DictionaryValue> manifest,
                              ImageSanitizer::Status status,