| Index: chrome/browser/extensions/pack_extension_job.cc
|
| diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc
|
| index 5f640253f80fa49ac92ba3e2d130ce5b6ab713b3..327d7c4da5310f69b4b46404f42c7bcb607b0fa1 100644
|
| --- a/chrome/browser/extensions/pack_extension_job.cc
|
| +++ b/chrome/browser/extensions/pack_extension_job.cc
|
| @@ -15,15 +15,19 @@
|
| PackExtensionJob::PackExtensionJob(Client* client,
|
| const FilePath& root_directory,
|
| const FilePath& key_file)
|
| - : client_(client), key_file_(key_file) {
|
| + : client_(client), key_file_(key_file), asynchronous_(true) {
|
| root_directory_ = root_directory.StripTrailingSeparators();
|
| CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
|
| }
|
|
|
| void PackExtensionJob::Start() {
|
| - BrowserThread::PostTask(
|
| - BrowserThread::FILE, FROM_HERE,
|
| - NewRunnableMethod(this, &PackExtensionJob::RunOnFileThread));
|
| + if (asynchronous_) {
|
| + BrowserThread::PostTask(
|
| + BrowserThread::FILE, FROM_HERE,
|
| + NewRunnableMethod(this, &PackExtensionJob::Run));
|
| + } else {
|
| + Run();
|
| + }
|
| }
|
|
|
| void PackExtensionJob::ClearClient() {
|
| @@ -32,7 +36,7 @@ void PackExtensionJob::ClearClient() {
|
|
|
| PackExtensionJob::~PackExtensionJob() {}
|
|
|
| -void PackExtensionJob::RunOnFileThread() {
|
| +void PackExtensionJob::Run() {
|
| crx_file_out_ = FilePath(root_directory_.value() +
|
| chrome::kExtensionFileExtension);
|
|
|
| @@ -44,16 +48,24 @@ void PackExtensionJob::RunOnFileThread() {
|
| // returns. See bug 20734.
|
| ExtensionCreator creator;
|
| if (creator.Run(root_directory_, crx_file_out_, key_file_, key_file_out_)) {
|
| - BrowserThread::PostTask(
|
| - client_thread_id_, FROM_HERE,
|
| - NewRunnableMethod(this,
|
| - &PackExtensionJob::ReportSuccessOnClientThread));
|
| + if (asynchronous_) {
|
| + BrowserThread::PostTask(
|
| + client_thread_id_, FROM_HERE,
|
| + NewRunnableMethod(this,
|
| + &PackExtensionJob::ReportSuccessOnClientThread));
|
| + } else {
|
| + ReportSuccessOnClientThread();
|
| + }
|
| } else {
|
| - BrowserThread::PostTask(
|
| - client_thread_id_, FROM_HERE,
|
| - NewRunnableMethod(
|
| - this, &PackExtensionJob::ReportFailureOnClientThread,
|
| - creator.error_message()));
|
| + if (asynchronous_) {
|
| + BrowserThread::PostTask(
|
| + client_thread_id_, FROM_HERE,
|
| + NewRunnableMethod(
|
| + this, &PackExtensionJob::ReportFailureOnClientThread,
|
| + creator.error_message()));
|
| + } else {
|
| + ReportFailureOnClientThread(creator.error_message());
|
| + }
|
| }
|
| }
|
|
|
|
|