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

Unified Diff: chrome/browser/printing/pdf_to_emf_converter.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 | « no previous file | chrome/browser/printing/pdf_to_emf_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/pdf_to_emf_converter.h
diff --git a/chrome/browser/printing/pdf_to_emf_converter.h b/chrome/browser/printing/pdf_to_emf_converter.h
index ca7adc41bedfbdfb3501d0624f363873a920d9e0..fac038c8aad35b8da569ed222674bf2f1c73bfd5 100644
--- a/chrome/browser/printing/pdf_to_emf_converter.h
+++ b/chrome/browser/printing/pdf_to_emf_converter.h
@@ -7,7 +7,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted_memory.h"
-#include "base/memory/scoped_vector.h"
+#include "base/memory/scoped_ptr.h"
namespace base {
class FilePath;
@@ -20,18 +20,27 @@ class PdfRenderSettings;
class PdfToEmfConverter {
public:
- // Callback for when the PDF is converted to an EMF.
- // Takes ownership of metafiles.
- typedef base::Callback<void(double /*scale_factor*/,
- ScopedVector<MetafilePlayer>* /*emf_files*/)>
- ResultCallback;
- virtual ~PdfToEmfConverter() {}
+ typedef base::Callback<void(int page_count)> StartCallback;
+ typedef base::Callback<void(int page_number,
+ double scale_factor,
+ scoped_ptr<MetafilePlayer> emf)> GetPageCallback;
+
+ virtual ~PdfToEmfConverter();
static scoped_ptr<PdfToEmfConverter> CreateDefault();
- virtual void Start(base::RefCountedMemory* data,
- const printing::PdfRenderSettings& conversion_settings,
- const ResultCallback& callback) = 0;
+ // Starts conversion of PDF provided as |data|. Calls |start_callback|
+ // with positive |page_count|. |page_count| is 0 if initialization failed.
+ virtual void Start(const scoped_refptr<base::RefCountedMemory>& data,
+ const PdfRenderSettings& conversion_settings,
+ const StartCallback& start_callback) = 0;
+
+ // Requests conversion of the page. |page_number| is 0-base page number in
+ // PDF provided in Start() call.
+ // Calls |get_page_callback| after conversion. |emf| of callback in not NULL
+ // if conversion succeeded.
+ virtual void GetPage(int page_number,
+ const GetPageCallback& get_page_callback) = 0;
};
} // namespace printing
« no previous file with comments | « no previous file | chrome/browser/printing/pdf_to_emf_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698