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

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

Issue 113867: Fix a browser crash that occurs if the extension unpacker process crashes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
===================================================================
--- chrome/browser/extensions/extensions_service.cc (revision 16880)
+++ chrome/browser/extensions/extensions_service.cc (working copy)
@@ -98,7 +98,8 @@
const std::string& expected_id,
bool from_external)
: backend_(backend), extension_path_(extension_path),
- expected_id_(expected_id), from_external_(from_external) {
+ expected_id_(expected_id), from_external_(from_external),
+ got_response_(false) {
}
// Starts the unpack task. We call back to the backend when the task is done,
@@ -143,7 +144,11 @@
private:
// UtilityProcessHost::Client
virtual void OnProcessCrashed() {
- OnUnpackExtensionFailed("Chrome crashed while trying to install");
+ // Don't report crashes if they happen after we got a response.
+ if (got_response_)
+ return;
+
+ OnUnpackExtensionFailed("Chrome crashed while trying to install.");
}
virtual void OnUnpackExtensionSucceeded(
@@ -165,6 +170,10 @@
// Cleans up our temp directory.
void Cleanup() {
+ if (got_response_)
+ return;
+
+ got_response_ = true;
file_util::Delete(temp_extension_path_.DirName(), true);
Release(); // balanced in Run()
}
@@ -190,6 +199,10 @@
// True if this is being installed from an external source.
bool from_external_;
+
+ // True if we got a response from the utility process and have cleaned up
+ // already.
+ bool got_response_;
};
ExtensionsService::ExtensionsService(Profile* profile,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698