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

Side by Side Diff: chrome/browser/ui/webui/print_preview/printer_backend_proxy_chromeos.cc

Issue 2675773004: Use TaskScheduler instead of blocking pool in printer_backend_proxy_chromeos.cc. (Closed)
Patch Set: fix-build-error Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ui/webui/print_preview/printer_backend_proxy.h" 5 #include "chrome/browser/ui/webui/print_preview/printer_backend_proxy.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/threading/sequenced_worker_pool.h" 14 #include "base/task_scheduler/post_task.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h" 16 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h"
17 #include "chrome/browser/chromeos/printing/cups_print_job_manager_factory.h" 17 #include "chrome/browser/chromeos/printing/cups_print_job_manager_factory.h"
18 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" 18 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h"
19 #include "chrome/browser/chromeos/printing/printer_configurer.h" 19 #include "chrome/browser/chromeos/printing/printer_configurer.h"
20 #include "chrome/browser/chromeos/printing/printers_manager.h" 20 #include "chrome/browser/chromeos/printing/printers_manager.h"
21 #include "chrome/browser/chromeos/printing/printers_manager_factory.h" 21 #include "chrome/browser/chromeos/printing/printers_manager_factory.h"
22 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/webui/print_preview/printer_capabilities.h" 23 #include "chrome/browser/ui/webui/print_preview/printer_capabilities.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 list->push_back(ToBasicInfo(*printer)); 58 list->push_back(ToBasicInfo(*printer));
59 } 59 }
60 } 60 }
61 61
62 void FetchCapabilities(std::unique_ptr<chromeos::Printer> printer, 62 void FetchCapabilities(std::unique_ptr<chromeos::Printer> printer,
63 const PrinterSetupCallback& cb) { 63 const PrinterSetupCallback& cb) {
64 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 64 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
65 65
66 PrinterBasicInfo basic_info = ToBasicInfo(*printer); 66 PrinterBasicInfo basic_info = ToBasicInfo(*printer);
67 67
68 base::PostTaskAndReplyWithResult( 68 base::PostTaskWithTraitsAndReplyWithResult(
69 content::BrowserThread::GetBlockingPool(), FROM_HERE, 69 FROM_HERE,
70 base::TaskTraits().MayBlock().WithPriority(
71 base::TaskPriority::BACKGROUND),
70 base::Bind(&GetSettingsOnBlockingPool, printer->id(), basic_info), cb); 72 base::Bind(&GetSettingsOnBlockingPool, printer->id(), basic_info), cb);
71 } 73 }
72 74
73 void HandlePrinterSetup(std::unique_ptr<chromeos::Printer> printer, 75 void HandlePrinterSetup(std::unique_ptr<chromeos::Printer> printer,
74 const PrinterSetupCallback& cb, 76 const PrinterSetupCallback& cb,
75 chromeos::PrinterSetupResult result) { 77 chromeos::PrinterSetupResult result) {
76 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 78 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
77 79
78 switch (result) { 80 switch (result) {
79 case chromeos::PrinterSetupResult::SUCCESS: 81 case chromeos::PrinterSetupResult::SUCCESS:
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 }; 175 };
174 176
175 } // namespace 177 } // namespace
176 178
177 std::unique_ptr<PrinterBackendProxy> PrinterBackendProxy::Create( 179 std::unique_ptr<PrinterBackendProxy> PrinterBackendProxy::Create(
178 Profile* profile) { 180 Profile* profile) {
179 return base::MakeUnique<PrinterBackendProxyChromeos>(profile); 181 return base::MakeUnique<PrinterBackendProxyChromeos>(profile);
180 } 182 }
181 183
182 } // namespace printing 184 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698