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

Unified Diff: chrome/utility/printing_handler.h

Issue 566693002: Use file handles to interact with utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wed Sep 17 10:40:51 PDT 2014 Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/utility/printing_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/printing_handler.h
diff --git a/chrome/utility/printing_handler.h b/chrome/utility/printing_handler.h
index d0135f5b2ba84f7be5e34ec46b654aef0854cd6c..db0194d51f8d6035427ae790202d2c8b6be40068 100644
--- a/chrome/utility/printing_handler.h
+++ b/chrome/utility/printing_handler.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "chrome/utility/utility_message_handler.h"
#include "ipc/ipc_platform_file.h"
+#include "printing/pdf_render_settings.h"
#if !defined(ENABLE_FULL_PRINTING) && !defined(OS_WIN)
#error "Windows or full printing must be enabled"
@@ -34,11 +35,12 @@ class PrintingHandler : public UtilityMessageHandler {
private:
// IPC message handlers.
#if defined(OS_WIN)
- void OnRenderPDFPagesToMetafile(
- IPC::PlatformFileForTransit pdf_transit,
- const base::FilePath& metafile_path,
- const printing::PdfRenderSettings& settings,
- const std::vector<printing::PageRange>& page_ranges);
+ void OnRenderPDFPagesToMetafile(IPC::PlatformFileForTransit pdf_transit,
+ const printing::PdfRenderSettings& settings);
+ void OnRenderPDFPagesToMetafileGetPage(
+ int page_number,
+ IPC::PlatformFileForTransit output_file);
+ void OnRenderPDFPagesToMetafileStop();
#endif // OS_WIN
#if defined(ENABLE_FULL_PRINTING)
void OnRenderPDFPagesToPWGRaster(
@@ -49,18 +51,10 @@ class PrintingHandler : public UtilityMessageHandler {
#endif // ENABLE_FULL_PRINTING
#if defined(OS_WIN)
- // Helper method for Windows.
- // |highest_rendered_page_number| is set to -1 on failure to render any page.
- // |page_ranges| is both input and output. If supplied as input, only the
- // specified pages will be rendered. If an empty vector is supplied it will
- // be filled with a range of all pages that were rendered.
- bool RenderPDFToWinMetafile(
- base::File pdf_file,
- const base::FilePath& metafile_path,
- const printing::PdfRenderSettings& settings,
- std::vector<printing::PageRange>* page_ranges,
- int* highest_rendered_page_number,
- double* scale_factor);
+ int LoadPDF(base::File pdf_file);
+ bool RenderPdfPageToMetafile(int page_number,
+ base::File output_file,
+ double* scale_factor);
#endif // OS_WIN
#if defined(ENABLE_FULL_PRINTING)
bool RenderPDFPagesToPWGRaster(
@@ -73,6 +67,11 @@ class PrintingHandler : public UtilityMessageHandler {
void OnGetPrinterSemanticCapsAndDefaults(const std::string& printer_name);
#endif // ENABLE_FULL_PRINTING
+#if defined(OS_WIN)
+ std::vector<char> pdf_data_;
+ printing::PdfRenderSettings pdf_rendering_settings_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(PrintingHandler);
};
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/utility/printing_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698