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

Side by Side Diff: chrome/browser/extensions/pack_extension_job.cc

Issue 436008: Fixes extension packing codepath that was hitting a race condition DCHECK des... (Closed) Base URL: svn://svn.chromium.org/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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/pack_extension_job.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/pack_extension_job.h" 5 #include "chrome/browser/extensions/pack_extension_job.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "chrome/browser/extensions/extension_creator.h" 10 #include "chrome/browser/extensions/extension_creator.h"
11 11
12 PackExtensionJob::PackExtensionJob(Client* client, 12 PackExtensionJob::PackExtensionJob(Client* client,
13 const FilePath& root_directory, 13 const FilePath& root_directory,
14 const FilePath& key_file) 14 const FilePath& key_file)
15 : client_(client), root_directory_(root_directory), key_file_(key_file) { 15 : client_(client), root_directory_(root_directory), key_file_(key_file) {
16 CHECK(ChromeThread::GetCurrentThreadIdentifier(&client_thread_id_)); 16 CHECK(ChromeThread::GetCurrentThreadIdentifier(&client_thread_id_));
17 }
18
19 void PackExtensionJob::Start() {
17 ChromeThread::PostTask( 20 ChromeThread::PostTask(
18 ChromeThread::FILE, FROM_HERE, 21 ChromeThread::FILE, FROM_HERE,
19 NewRunnableMethod(this, &PackExtensionJob::RunOnFileThread)); 22 NewRunnableMethod(this, &PackExtensionJob::RunOnFileThread));
20 } 23 }
21 24
22 void PackExtensionJob::ClearClient() { 25 void PackExtensionJob::ClearClient() {
23 client_ = NULL; 26 client_ = NULL;
24 } 27 }
25 28
26 void PackExtensionJob::RunOnFileThread() { 29 void PackExtensionJob::RunOnFileThread() {
(...skipping 20 matching lines...) Expand all
47 50
48 void PackExtensionJob::ReportSuccessOnUIThread() { 51 void PackExtensionJob::ReportSuccessOnUIThread() {
49 if (client_) 52 if (client_)
50 client_->OnPackSuccess(crx_file_out_, key_file_out_); 53 client_->OnPackSuccess(crx_file_out_, key_file_out_);
51 } 54 }
52 55
53 void PackExtensionJob::ReportFailureOnUIThread(const std::string& error) { 56 void PackExtensionJob::ReportFailureOnUIThread(const std::string& error) {
54 if (client_) 57 if (client_)
55 client_->OnPackFailure(UTF8ToWide(error)); 58 client_->OnPackFailure(UTF8ToWide(error));
56 } 59 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/pack_extension_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698