| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/process.h" | 18 #include "base/process.h" |
| 19 #include "base/task.h" | 19 #include "base/task.h" |
| 20 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
| 21 #include "content/public/common/child_process_host_delegate.h" | 21 #include "content/public/common/child_process_host_delegate.h" |
| 22 #include "printing/pdf_render_settings.h" | 22 #include "printing/pdf_render_settings.h" |
| 23 | 23 |
| 24 class ChildProcessHost; | |
| 25 class CommandLine; | 24 class CommandLine; |
| 26 class ScopedTempDir; | 25 class ScopedTempDir; |
| 27 | 26 |
| 28 namespace base { | 27 namespace base { |
| 29 class MessageLoopProxy; | 28 class MessageLoopProxy; |
| 30 } // namespace base | 29 } // namespace base |
| 31 | 30 |
| 31 namespace content { |
| 32 class ChildProcessHost; |
| 33 } |
| 34 |
| 32 namespace printing { | 35 namespace printing { |
| 33 class Emf; | 36 class Emf; |
| 34 struct PageRange; | 37 struct PageRange; |
| 35 struct PrinterCapsAndDefaults; | 38 struct PrinterCapsAndDefaults; |
| 36 } // namespace printing | 39 } // namespace printing |
| 37 | 40 |
| 38 // Acts as the service-side host to a utility child process. A | 41 // Acts as the service-side host to a utility child process. A |
| 39 // utility process is a short-lived sandboxed process that is created to run | 42 // utility process is a short-lived sandboxed process that is created to run |
| 40 // a specific task. | 43 // a specific task. |
| 41 class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { | 44 class ServiceUtilityProcessHost : public content::ChildProcessHostDelegate { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 base::ProcessHandle handle() const { return handle_; } | 131 base::ProcessHandle handle() const { return handle_; } |
| 129 | 132 |
| 130 // Messages handlers: | 133 // Messages handlers: |
| 131 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); | 134 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); |
| 132 void OnRenderPDFPagesToMetafileFailed(); | 135 void OnRenderPDFPagesToMetafileFailed(); |
| 133 void OnGetPrinterCapsAndDefaultsSucceeded( | 136 void OnGetPrinterCapsAndDefaultsSucceeded( |
| 134 const std::string& printer_name, | 137 const std::string& printer_name, |
| 135 const printing::PrinterCapsAndDefaults& caps_and_defaults); | 138 const printing::PrinterCapsAndDefaults& caps_and_defaults); |
| 136 void OnGetPrinterCapsAndDefaultsFailed(const std::string& printer_name); | 139 void OnGetPrinterCapsAndDefaultsFailed(const std::string& printer_name); |
| 137 | 140 |
| 138 scoped_ptr<ChildProcessHost> child_process_host_; | 141 scoped_ptr<content::ChildProcessHost> child_process_host_; |
| 139 base::ProcessHandle handle_; | 142 base::ProcessHandle handle_; |
| 140 // A pointer to our client interface, who will be informed of progress. | 143 // A pointer to our client interface, who will be informed of progress. |
| 141 scoped_refptr<Client> client_; | 144 scoped_refptr<Client> client_; |
| 142 scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_; | 145 scoped_refptr<base::MessageLoopProxy> client_message_loop_proxy_; |
| 143 bool waiting_for_reply_; | 146 bool waiting_for_reply_; |
| 144 // The path to the temp file where the metafile will be written to. | 147 // The path to the temp file where the metafile will be written to. |
| 145 FilePath metafile_path_; | 148 FilePath metafile_path_; |
| 146 // The temporary folder created for the metafile. | 149 // The temporary folder created for the metafile. |
| 147 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; | 150 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; |
| 148 | 151 |
| 149 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 152 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 155 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |