Commit c06d979e authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove BrowserThread::CurrentlyOn() call in ImageDecoder.

BindToBrowserConnector() should just be called on the right thread in
the first place.

Change-Id: Ib5ea945b34faa054e179a7d5be4c43d749bd219b
Reviewed-on: https://chromium-review.googlesource.com/888143Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532179}
parent 72eafe03
......@@ -37,12 +37,7 @@ void OnDecodeImageDone(
}
void BindToBrowserConnector(service_manager::mojom::ConnectorRequest request) {
if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::BindOnce(&BindToBrowserConnector, base::Passed(&request)));
return;
}
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::ServiceManagerConnection::GetForProcess()->GetConnector()
->BindConnectorRequest(std::move(request));
......@@ -67,7 +62,9 @@ void DecodeImage(
service_manager::mojom::ConnectorRequest connector_request;
std::unique_ptr<service_manager::Connector> connector =
service_manager::Connector::Create(&connector_request);
BindToBrowserConnector(std::move(connector_request));
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::BindOnce(&BindToBrowserConnector, std::move(connector_request)));
data_decoder::DecodeImage(
connector.get(), image_data, codec, shrink_to_fit, kMaxImageSizeInBytes,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment