diff options
author | skyostil <skyostil@chromium.org> | 2015-06-10 09:44:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-10 16:45:48 +0000 |
commit | 140473b16767c66fc00fd7b0e6f6cc034a6712a8 (patch) | |
tree | 5ddeba7b60262d6f86b88adfc596dba8b5eae7a4 /chrome/service/cloud_print/print_system_win.cc | |
parent | c1162b1fc5090f8561c7650aecbdc6c61032115b (diff) | |
download | chromium_src-140473b16767c66fc00fd7b0e6f6cc034a6712a8.zip chromium_src-140473b16767c66fc00fd7b0e6f6cc034a6712a8.tar.gz chromium_src-140473b16767c66fc00fd7b0e6f6cc034a6712a8.tar.bz2 |
chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with https://codereview.chromium.org/1010073002/.
BUG=465354
Review URL: https://codereview.chromium.org/1167163002
Cr-Commit-Position: refs/heads/master@{#333745}
Diffstat (limited to 'chrome/service/cloud_print/print_system_win.cc')
-rw-r--r-- | chrome/service/cloud_print/print_system_win.cc | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 550a5633..58b5231 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc @@ -9,6 +9,7 @@ #include "base/json/json_writer.h" #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" +#include "base/thread_task_runner_handle.h" #include "base/win/object_watcher.h" #include "base/win/scoped_bstr.h" #include "base/win/scoped_comptr.h" @@ -410,26 +411,24 @@ class JobSpoolerWin : public PrintSystem::JobSpooler { int dc_width = GetDeviceCaps(printer_dc_.Get(), PHYSICALWIDTH); int dc_height = GetDeviceCaps(printer_dc_.Get(), PHYSICALHEIGHT); gfx::Rect render_area(0, 0, dc_width, dc_height); - g_service_process->io_thread()->message_loop_proxy()->PostTask( + g_service_process->io_thread()->task_runner()->PostTask( FROM_HERE, - base::Bind(&JobSpoolerWin::Core::RenderPDFPagesInSandbox, - this, - print_data_file_path_, - render_area, - printer_dpi, - base::MessageLoopProxy::current())); + base::Bind(&JobSpoolerWin::Core::RenderPDFPagesInSandbox, this, + print_data_file_path_, render_area, printer_dpi, + base::ThreadTaskRunnerHandle::Get())); } // Called on the service process IO thread. - void RenderPDFPagesInSandbox(const base::FilePath& pdf_path, - const gfx::Rect& render_area, - int render_dpi, - const scoped_refptr<base::MessageLoopProxy>& - client_message_loop_proxy) { - DCHECK(g_service_process->io_thread()->message_loop_proxy()-> - BelongsToCurrentThread()); + void RenderPDFPagesInSandbox( + const base::FilePath& pdf_path, + const gfx::Rect& render_area, + int render_dpi, + const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { + DCHECK(g_service_process->io_thread() + ->task_runner() + ->BelongsToCurrentThread()); scoped_ptr<ServiceUtilityProcessHost> utility_host( - new ServiceUtilityProcessHost(this, client_message_loop_proxy.get())); + new ServiceUtilityProcessHost(this, client_task_runner.get())); // TODO(gene): For now we disabling autorotation for CloudPrinting. // Landscape/Portrait setting is passed in the print ticket and // server is generating portrait PDF always. @@ -441,7 +440,7 @@ class JobSpoolerWin : public PrintSystem::JobSpooler { // The object will self-destruct when the child process dies. utility_host.release(); } else { - client_message_loop_proxy->PostTask( + client_task_runner->PostTask( FROM_HERE, base::Bind(&Core::PrintJobDone, this, false)); } } @@ -555,53 +554,51 @@ class PrinterCapsHandler : public ServiceUtilityProcessHost::Client { } void StartGetPrinterCapsAndDefaults() { - g_service_process->io_thread()->message_loop_proxy()->PostTask( + g_service_process->io_thread()->task_runner()->PostTask( FROM_HERE, base::Bind(&PrinterCapsHandler::GetPrinterCapsAndDefaultsImpl, this, - base::MessageLoopProxy::current())); + base::ThreadTaskRunnerHandle::Get())); } void StartGetPrinterSemanticCapsAndDefaults() { - g_service_process->io_thread()->message_loop_proxy()->PostTask( + g_service_process->io_thread()->task_runner()->PostTask( FROM_HERE, base::Bind(&PrinterCapsHandler::GetPrinterSemanticCapsAndDefaultsImpl, - this, base::MessageLoopProxy::current())); + this, base::ThreadTaskRunnerHandle::Get())); } private: ~PrinterCapsHandler() override {} void GetPrinterCapsAndDefaultsImpl( - const scoped_refptr<base::MessageLoopProxy>& - client_message_loop_proxy) { - DCHECK(g_service_process->io_thread()->message_loop_proxy()-> - BelongsToCurrentThread()); + const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { + DCHECK(g_service_process->io_thread() + ->task_runner() + ->BelongsToCurrentThread()); scoped_ptr<ServiceUtilityProcessHost> utility_host( - new ServiceUtilityProcessHost(this, client_message_loop_proxy.get())); + new ServiceUtilityProcessHost(this, client_task_runner.get())); if (utility_host->StartGetPrinterCapsAndDefaults(printer_name_)) { // The object will self-destruct when the child process dies. utility_host.release(); } else { - client_message_loop_proxy->PostTask( - FROM_HERE, - base::Bind(&PrinterCapsHandler::OnChildDied, this)); + client_task_runner->PostTask( + FROM_HERE, base::Bind(&PrinterCapsHandler::OnChildDied, this)); } } void GetPrinterSemanticCapsAndDefaultsImpl( - const scoped_refptr<base::MessageLoopProxy>& - client_message_loop_proxy) { - DCHECK(g_service_process->io_thread()->message_loop_proxy()-> - BelongsToCurrentThread()); + const scoped_refptr<base::SingleThreadTaskRunner>& client_task_runner) { + DCHECK(g_service_process->io_thread() + ->task_runner() + ->BelongsToCurrentThread()); scoped_ptr<ServiceUtilityProcessHost> utility_host( - new ServiceUtilityProcessHost(this, client_message_loop_proxy.get())); + new ServiceUtilityProcessHost(this, client_task_runner.get())); if (utility_host->StartGetPrinterSemanticCapsAndDefaults(printer_name_)) { // The object will self-destruct when the child process dies. utility_host.release(); } else { - client_message_loop_proxy->PostTask( - FROM_HERE, - base::Bind(&PrinterCapsHandler::OnChildDied, this)); + client_task_runner->PostTask( + FROM_HERE, base::Bind(&PrinterCapsHandler::OnChildDied, this)); } } |