Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6874)

Unified Diff: chrome/browser/extensions/sandboxed_unpacker.cc

Issue 18690003: Abort SandboxedUnpacker::RewriteImageFiles on browser shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comment Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/sandboxed_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index 91b4cbc4d29a4cdaa293d308065ff0e6e1f89b87..dbbd3852f8d1d30dd76e82bcd83b7c1613d90983 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -18,6 +18,7 @@
#include "base/path_service.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/utf_string_conversions.h" // TODO(viettrungluu): delete me.
+#include "base/threading/sequenced_worker_pool.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -674,6 +675,16 @@ bool SandboxedUnpacker::RewriteImageFiles() {
// Write our parsed images back to disk as well.
for (size_t i = 0; i < images.size(); ++i) {
+ if (BrowserThread::GetBlockingPool()->IsShutdownInProgress()) {
+ // Abort package installation if shutdown was initiated, crbug.com/235525
+ ReportFailure(
+ ABORTED_DUE_TO_SHUTDOWN,
+ l10n_util::GetStringFUTF16(
+ IDS_EXTENSION_PACKAGE_INSTALL_ERROR,
+ ASCIIToUTF16("ABORTED_DUE_TO_SHUTDOWN")));
+ return false;
+ }
+
const SkBitmap& image = images[i].a;
base::FilePath path_suffix = images[i].b;
if (path_suffix.IsAbsolute() || path_suffix.ReferencesParent()) {
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698