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 19 matching lines...) Expand all Loading... |
30 #include "content/public/common/child_process_host.h" | 30 #include "content/public/common/child_process_host.h" |
31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/mojo_channel_switches.h" | 32 #include "content/public/common/mojo_channel_switches.h" |
33 #include "content/public/common/result_codes.h" | 33 #include "content/public/common/result_codes.h" |
34 #include "content/public/common/sandbox_init.h" | 34 #include "content/public/common/sandbox_init.h" |
35 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 35 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
36 #include "mojo/edk/embedder/embedder.h" | 36 #include "mojo/edk/embedder/embedder.h" |
37 #include "mojo/edk/embedder/named_platform_channel_pair.h" | 37 #include "mojo/edk/embedder/named_platform_channel_pair.h" |
38 #include "mojo/edk/embedder/platform_channel_pair.h" | 38 #include "mojo/edk/embedder/platform_channel_pair.h" |
39 #include "mojo/edk/embedder/scoped_platform_handle.h" | 39 #include "mojo/edk/embedder/scoped_platform_handle.h" |
40 #include "printing/emf_win.h" | |
41 #include "sandbox/win/src/sandbox_policy.h" | 40 #include "sandbox/win/src/sandbox_policy.h" |
42 #include "sandbox/win/src/sandbox_types.h" | 41 #include "sandbox/win/src/sandbox_types.h" |
43 #include "ui/base/ui_base_switches.h" | 42 #include "ui/base/ui_base_switches.h" |
44 | 43 |
45 namespace { | 44 namespace { |
46 | 45 |
47 using content::ChildProcessHost; | 46 using content::ChildProcessHost; |
48 | 47 |
49 enum ServiceUtilityProcessHostEvent { | 48 enum ServiceUtilityProcessHostEvent { |
50 SERVICE_UTILITY_STARTED, | 49 SERVICE_UTILITY_STARTED, |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 int64_t size = file.GetLength(); | 434 int64_t size = file.GetLength(); |
436 if (size <= 0) { | 435 if (size <= 0) { |
437 OnRenderPDFPagesToMetafileDone(false); | 436 OnRenderPDFPagesToMetafileDone(false); |
438 return false; | 437 return false; |
439 } | 438 } |
440 std::vector<char> data(size); | 439 std::vector<char> data(size); |
441 if (file.ReadAtCurrentPos(data.data(), data.size()) != size) { | 440 if (file.ReadAtCurrentPos(data.data(), data.size()) != size) { |
442 OnRenderPDFPagesToMetafileDone(false); | 441 OnRenderPDFPagesToMetafileDone(false); |
443 return false; | 442 return false; |
444 } | 443 } |
445 printing::Emf emf; | 444 if (!OnRenderPDFPagesToMetafilePageDone(data, scale_factor)) { |
446 if (!emf.InitFromData(data.data(), data.size())) { | |
447 OnRenderPDFPagesToMetafileDone(false); | 445 OnRenderPDFPagesToMetafileDone(false); |
448 return false; | 446 return false; |
449 } | 447 } |
450 OnRenderPDFPagesToMetafilePageDone(scale_factor, emf); | |
451 return true; | 448 return true; |
452 } | 449 } |
OLD | NEW |