Index: chrome/browser/extensions/webstore_install_helper.cc |
diff --git a/chrome/browser/extensions/webstore_install_helper.cc b/chrome/browser/extensions/webstore_install_helper.cc |
index 948d9954134fe6b38718be0cd34471830942c63a..4ad14e9ce3526cd8c3cde1ebbae64dcde5eef8ea 100644 |
--- a/chrome/browser/extensions/webstore_install_helper.cc |
+++ b/chrome/browser/extensions/webstore_install_helper.cc |
@@ -51,6 +51,15 @@ WebstoreInstallHelper::~WebstoreInstallHelper() {} |
void WebstoreInstallHelper::Start() { |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind(&WebstoreInstallHelper::StartWorkOnIOThread, this)); |
+} |
+ |
+void WebstoreInstallHelper::StartWorkOnIOThread() { |
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ |
if (icon_url_.is_empty()) { |
icon_decode_complete_ = true; |
} else { |
@@ -64,14 +73,6 @@ void WebstoreInstallHelper::Start() { |
net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); |
} |
- BrowserThread::PostTask( |
- BrowserThread::IO, |
- FROM_HERE, |
- base::Bind(&WebstoreInstallHelper::StartWorkOnIOThread, this)); |
-} |
- |
-void WebstoreInstallHelper::StartWorkOnIOThread() { |
- CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
utility_host_ = UtilityProcessHost::Create( |
this, base::ThreadTaskRunnerHandle::Get().get())->AsWeakPtr(); |
utility_host_->SetName(l10n_util::GetStringUTF16( |
@@ -95,7 +96,7 @@ bool WebstoreInstallHelper::OnMessageReceived(const IPC::Message& message) { |
void WebstoreInstallHelper::OnFetchComplete(const GURL& url, |
const SkBitmap* image) { |
- CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
// OnFetchComplete should only be called as icon_fetcher_ delegate to avoid |
// unbalanced Release(). |
CHECK(icon_fetcher_.get()); |
@@ -108,11 +109,8 @@ void WebstoreInstallHelper::OnFetchComplete(const GURL& url, |
parse_error_ = Delegate::ICON_ERROR; |
} |
icon_fetcher_.reset(); |
- BrowserThread::PostTask( |
- BrowserThread::IO, |
- FROM_HERE, |
- base::Bind(&WebstoreInstallHelper::ReportResultsIfComplete, this)); |
- Release(); // Balanced in Start(). |
+ Release(); // Balanced in StartWorkOnIOThread(). |
+ ReportResultsIfComplete(); |
} |
void WebstoreInstallHelper::OnJSONParseSucceeded( |