OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/service/service_utility_process_host.h" | 5 #include "chrome/service/service_utility_process_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 OnGetPrinterSemanticCapsAndDefaultsFailed) | 325 OnGetPrinterSemanticCapsAndDefaultsFailed) |
326 IPC_MESSAGE_UNHANDLED(handled = false) | 326 IPC_MESSAGE_UNHANDLED(handled = false) |
327 IPC_END_MESSAGE_MAP() | 327 IPC_END_MESSAGE_MAP() |
328 return handled; | 328 return handled; |
329 } | 329 } |
330 | 330 |
331 const base::Process& ServiceUtilityProcessHost::GetProcess() const { | 331 const base::Process& ServiceUtilityProcessHost::GetProcess() const { |
332 return process_; | 332 return process_; |
333 } | 333 } |
334 | 334 |
| 335 void ServiceUtilityProcessHost::BindInterface( |
| 336 const std::string& interface_name, |
| 337 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 338 child_process_host_->BindInterface(interface_name, std::move(interface_pipe)); |
| 339 } |
| 340 |
335 void ServiceUtilityProcessHost::OnMetafileSpooled(bool success) { | 341 void ServiceUtilityProcessHost::OnMetafileSpooled(bool success) { |
336 if (!success || pdf_to_emf_state_->OnPageProcessed()) | 342 if (!success || pdf_to_emf_state_->OnPageProcessed()) |
337 OnPDFToEmfFinished(success); | 343 OnPDFToEmfFinished(success); |
338 } | 344 } |
339 | 345 |
340 void ServiceUtilityProcessHost::OnRenderPDFPagesToMetafilesPageCount( | 346 void ServiceUtilityProcessHost::OnRenderPDFPagesToMetafilesPageCount( |
341 int page_count) { | 347 int page_count) { |
342 DCHECK(waiting_for_reply_); | 348 DCHECK(waiting_for_reply_); |
343 if (!pdf_to_emf_state_ || page_count <= 0 || | 349 if (!pdf_to_emf_state_ || page_count <= 0 || |
344 pdf_to_emf_state_->has_page_count()) { | 350 pdf_to_emf_state_->has_page_count()) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 return false; | 443 return false; |
438 } | 444 } |
439 printing::Emf emf; | 445 printing::Emf emf; |
440 if (!emf.InitFromData(data.data(), data.size())) { | 446 if (!emf.InitFromData(data.data(), data.size())) { |
441 OnRenderPDFPagesToMetafileDone(false); | 447 OnRenderPDFPagesToMetafileDone(false); |
442 return false; | 448 return false; |
443 } | 449 } |
444 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); | 450 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); |
445 return true; | 451 return true; |
446 } | 452 } |
OLD | NEW |