Commit 79d31106 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Always run the callback in CloudPrintProxyService::GetPrinters().

BUG=845250

Change-Id: Ifad55ab66e7c3bf99896a9be3dfc3c62a4e58832
Reviewed-on: https://chromium-review.googlesource.com/1178984Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584243}
parent 79eeb786
......@@ -109,8 +109,6 @@ ExtensionFunction::ResponseAction CloudPrintPrivateGetPrintersFunction::Run() {
if (!service)
return RespondNow(Error(kErrorIncognito));
// TODO(https://crbug.com/845250): CloudPrintProxyService::GetPrinters() may
// not invoke the callback, which means this function may never respond.
service->GetPrinters(
base::Bind(&CloudPrintPrivateGetPrintersFunction::SendResults, this));
return RespondLater();
......
......@@ -136,8 +136,11 @@ bool CloudPrintProxyService::ApplyCloudPrintConnectorPolicy() {
void CloudPrintProxyService::GetPrinters(const PrintersCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled))
if (!profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(callback, std::vector<std::string>()));
return;
}
base::FilePath list_path(
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
......
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