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

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

Issue 399016: Fix race conditions where an object's constructor uses PostTask on itself. T... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
===================================================================
--- chrome/browser/extensions/crx_installer.cc (revision 32148)
+++ chrome/browser/extensions/crx_installer.cc (working copy)
@@ -45,13 +45,16 @@
installer->expected_id_ = expected_id;
installer->allow_privilege_increase_ = allow_privilege_increase;
- installer->unpacker_ = new SandboxedExtensionUnpacker(
- installer->source_file_, g_browser_process->resource_dispatcher_host(),
- installer);
+ scoped_refptr<SandboxedExtensionUnpacker> unpacker(
+ new SandboxedExtensionUnpacker(
+ installer->source_file_,
+ g_browser_process->resource_dispatcher_host(),
+ installer));
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(installer->unpacker_, &SandboxedExtensionUnpacker::Start));
+ NewRunnableMethod(
+ unpacker.get(), &SandboxedExtensionUnpacker::Start));
}
void CrxInstaller::InstallUserScript(const FilePath& source_file,

Powered by Google App Engine
This is Rietveld 408576698