OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 6 #define CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Overriden from ChildProcessHost. | 101 // Overriden from ChildProcessHost. |
102 virtual bool CanShutdown() { return true; } | 102 virtual bool CanShutdown() { return true; } |
103 virtual void OnChildDied(); | 103 virtual void OnChildDied(); |
104 | 104 |
105 private: | 105 private: |
106 // Starts a process. Returns true iff it succeeded. | 106 // Starts a process. Returns true iff it succeeded. |
107 bool StartProcess(const FilePath& exposed_dir); | 107 bool StartProcess(const FilePath& exposed_dir); |
108 | 108 |
109 // IPC messages: | 109 // IPC messages: |
110 void OnMessageReceived(const IPC::Message& message); | 110 virtual void OnMessageReceived(const IPC::Message& message); |
111 // Called when at least one page in the specified PDF has been rendered | 111 // Called when at least one page in the specified PDF has been rendered |
112 // successfully into metafile_path_; | 112 // successfully into metafile_path_; |
113 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); | 113 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); |
114 // Any other messages to be handled by the client. | 114 // Any other messages to be handled by the client. |
115 bool MessageForClient(const IPC::Message& message); | 115 bool MessageForClient(const IPC::Message& message); |
116 | 116 |
117 #if defined(OS_WIN) // This hack is Windows-specific. | 117 #if defined(OS_WIN) // This hack is Windows-specific. |
118 void OnPreCacheFont(LOGFONT font); | 118 void OnPreCacheFont(LOGFONT font); |
119 #endif // defined(OS_WIN) | 119 #endif // defined(OS_WIN) |
120 | 120 |
121 // A pointer to our client interface, who will be informed of progress. | 121 // A pointer to our client interface, who will be informed of progress. |
122 scoped_refptr<Client> client_; | 122 scoped_refptr<Client> client_; |
123 scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_; | 123 scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_; |
124 bool waiting_for_reply_; | 124 bool waiting_for_reply_; |
125 // The path to the temp file where the metafile will be written to. | 125 // The path to the temp file where the metafile will be written to. |
126 FilePath metafile_path_; | 126 FilePath metafile_path_; |
127 // The temporary folder created for the metafile. | 127 // The temporary folder created for the metafile. |
128 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; | 128 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 130 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
131 }; | 131 }; |
132 | 132 |
133 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 133 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
OLD | NEW |