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

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

Issue 345023: Get rid of MessageLoop* caching in extensions code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/sandboxed_extension_unpacker.cc
===================================================================
--- chrome/browser/extensions/sandboxed_extension_unpacker.cc (revision 30521)
+++ chrome/browser/extensions/sandboxed_extension_unpacker.cc (working copy)
@@ -29,14 +29,14 @@
SandboxedExtensionUnpacker::SandboxedExtensionUnpacker(
const FilePath& crx_path, ResourceDispatcherHost* rdh,
SandboxedExtensionUnpackerClient* client)
- : crx_path_(crx_path), file_loop_(NULL), rdh_(rdh), client_(client),
- got_response_(false) {
+ : crx_path_(crx_path), thread_identifier_(ChromeThread::ID_COUNT),
+ rdh_(rdh), client_(client), got_response_(false) {
}
void SandboxedExtensionUnpacker::Start() {
// We assume that we are started on the thread that the client wants us to do
// file IO on.
- file_loop_ = MessageLoop::current();
+ CHECK(ChromeThread::GetCurrentThreadIdentifier(&thread_identifier_));
// Create a temporary directory to work in.
if (!temp_dir_.CreateUniqueTempDir()) {
@@ -91,13 +91,14 @@
void SandboxedExtensionUnpacker::StartProcessOnIOThread(
const FilePath& temp_crx_path) {
- UtilityProcessHost* host = new UtilityProcessHost(rdh_, this, file_loop_);
+ UtilityProcessHost* host = new UtilityProcessHost(
+ rdh_, this, thread_identifier_);
host->StartExtensionUnpacker(temp_crx_path);
}
void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
const DictionaryValue& manifest) {
- DCHECK(file_loop_ == MessageLoop::current());
+ DCHECK(ChromeThread::CurrentlyOn(thread_identifier_));
got_response_ = true;
ExtensionUnpacker::DecodedImages images;
@@ -198,7 +199,7 @@
void SandboxedExtensionUnpacker::OnUnpackExtensionFailed(
const std::string& error) {
- DCHECK(file_loop_ == MessageLoop::current());
+ DCHECK(ChromeThread::CurrentlyOn(thread_identifier_));
got_response_ = true;
ReportFailure(error);
}
« no previous file with comments | « chrome/browser/extensions/sandboxed_extension_unpacker.h ('k') | chrome/browser/extensions/user_script_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698