diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 01:28:41 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 01:28:41 +0000 |
commit | 3400467bb7612df3a77de94e6acca532f85abd5c (patch) | |
tree | 28fe9363e363ac032c39dea72020306264cc556f /chrome/browser | |
parent | 6ac0844d6ba66338848f3a461d3f540da7b6f5dc (diff) | |
download | chromium_src-3400467bb7612df3a77de94e6acca532f85abd5c.zip chromium_src-3400467bb7612df3a77de94e6acca532f85abd5c.tar.gz chromium_src-3400467bb7612df3a77de94e6acca532f85abd5c.tar.bz2 |
Fixes extension packing codepath that was hitting a race condition DCHECK described in http://crbug.com/27944.
BUG=28530
TEST=Open chrome://extensions, select 'Pack Extension', select an extension folder, press OK. Should pack the extension instead of crash.
Review URL: http://codereview.chromium.org/436008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 1 | ||||
-rw-r--r-- | chrome/browser/extensions/pack_extension_job.cc | 3 | ||||
-rw-r--r-- | chrome/browser/extensions/pack_extension_job.h | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index bce29b5..1025ec0 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -485,6 +485,7 @@ void ExtensionsDOMHandler::HandlePackMessage(const Value* value) { } pack_job_ = new PackExtensionJob(this, root_directory, key_file); + pack_job_->Start(); } void ExtensionsDOMHandler::OnPackSuccess(const FilePath& crx_file, diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc index 9d370a1..871a920 100644 --- a/chrome/browser/extensions/pack_extension_job.cc +++ b/chrome/browser/extensions/pack_extension_job.cc @@ -14,6 +14,9 @@ PackExtensionJob::PackExtensionJob(Client* client, const FilePath& key_file) : client_(client), root_directory_(root_directory), key_file_(key_file) { CHECK(ChromeThread::GetCurrentThreadIdentifier(&client_thread_id_)); +} + +void PackExtensionJob::Start() { ChromeThread::PostTask( ChromeThread::FILE, FROM_HERE, NewRunnableMethod(this, &PackExtensionJob::RunOnFileThread)); diff --git a/chrome/browser/extensions/pack_extension_job.h b/chrome/browser/extensions/pack_extension_job.h index 8c008d9..2ad95a6 100644 --- a/chrome/browser/extensions/pack_extension_job.h +++ b/chrome/browser/extensions/pack_extension_job.h @@ -29,6 +29,10 @@ class PackExtensionJob : public base::RefCountedThreadSafe<PackExtensionJob> { const FilePath& root_directory, const FilePath& key_file); + // Starts the packing thread job. See http://crbug.com/27944 for more details + // on why this function is needed. + void Start(); + // The client should call this when it is destroyed to prevent // PackExtensionJob from attempting to access it. void ClearClient(); |