diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 06:17:41 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 06:17:41 +0000 |
commit | 489ab8a147a5d5c78757f2910e0b598453c61962 (patch) | |
tree | 26d27dec1e352b9e812fb981597242dc63a90221 /chrome/service/service_utility_process_host.h | |
parent | 95c0dc4adedaf68ca2e1ce0a3df70e98bc35260b (diff) | |
download | chromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.zip chromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.tar.gz chromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.tar.bz2 |
Changed the implementation of the utility process method to render a PDF into a metafile to use a file-backed metafile as opposed to an in-memory metafile.
BUG=None.
TEST=Test Cloud Print proxy with Chrome OS generated PDFs.
Review URL: http://codereview.chromium.org/3600001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_utility_process_host.h')
-rw-r--r-- | chrome/service/service_utility_process_host.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h index c069426..477e945 100644 --- a/chrome/service/service_utility_process_host.h +++ b/chrome/service/service_utility_process_host.h @@ -15,6 +15,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/ref_counted.h" #include "base/task.h" #include "ipc/ipc_channel.h" @@ -22,7 +23,7 @@ #include "printing/native_metafile.h" class CommandLine; -class FilePath; +class ScopedTempDir; namespace base { class MessageLoopProxy; @@ -67,6 +68,9 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost { friend class ServiceUtilityProcessHost; void OnMessageReceived(const IPC::Message& message); + // Invoked when a metafile file is ready. + void MetafileAvailable(const FilePath& metafile_path, + int highest_rendered_page_number); DISALLOW_COPY_AND_ASSIGN(Client); }; @@ -100,21 +104,28 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost { private: // Starts a process. Returns true iff it succeeded. - bool StartProcess(); + bool StartProcess(const FilePath& exposed_dir); // IPC messages: void OnMessageReceived(const IPC::Message& message); + // Called when at least one page in the specified PDF has been rendered + // successfully into metafile_path_; + void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); + // Any other messages to be handled by the client. bool MessageForClient(const IPC::Message& message); #if defined(OS_WIN) // This hack is Windows-specific. void OnPreCacheFont(LOGFONT font); #endif // defined(OS_WIN) - // A pointer to our client interface, who will be informed of progress. scoped_refptr<Client> client_; scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_; bool waiting_for_reply_; + // The path to the temp file where the metafile will be written to. + FilePath metafile_path_; + // The temporary folder created for the metafile. + scoped_ptr<ScopedTempDir> scratch_metafile_dir_; DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); }; |