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

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

Issue 1080453002: Always destroy CrxInstaller on the UI Thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOZ Created 5 years, 8 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
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index c76a45d332cba783425668b9cc409fd47409a885..65fc12666b3c39295978d075716e03697813180d 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -108,7 +108,9 @@ scoped_refptr<CrxInstaller> CrxInstaller::Create(
CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
scoped_ptr<ExtensionInstallPrompt> client,
const WebstoreInstaller::Approval* approval)
- : install_directory_(service_weak->install_directory()),
+ : SandboxedUnpackerClient(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)),
+ install_directory_(service_weak->install_directory()),
install_source_(Manifest::INTERNAL),
approved_(false),
hash_check_failed_(false),
@@ -163,11 +165,8 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> service_weak,
}
CrxInstaller::~CrxInstaller() {
- // Make sure the UI is deleted on the ui thread.
- if (client_) {
- BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_);
- client_ = NULL;
- }
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ // The scoped_ptr |client_| data member must be destroyed on the UI thread.
benwells 2015/04/14 22:14:19 Nit: the client_ member was destroyed on the ui th
tapted 2015/04/15 03:07:44 Done.
}
void CrxInstaller::InstallCrx(const base::FilePath& source_file) {

Powered by Google App Engine
This is Rietveld 408576698