| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 18 #include "content/public/common/child_process_host_delegate.h" | 18 #include "content/public/common/child_process_host_delegate.h" |
| 19 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 20 #include "printing/pdf_render_settings.h" | 20 #include "printing/pdf_render_settings.h" |
| 21 | 21 |
| 22 namespace base { |
| 22 class CommandLine; | 23 class CommandLine; |
| 23 | |
| 24 namespace base { | |
| 25 class MessageLoopProxy; | 24 class MessageLoopProxy; |
| 26 class ScopedTempDir; | 25 class ScopedTempDir; |
| 27 } // namespace base | 26 } // namespace base |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 class ChildProcessHost; | 29 class ChildProcessHost; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace printing { | 32 namespace printing { |
| 34 class Emf; | 33 class Emf; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 private: | 125 private: |
| 127 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the | 126 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the |
| 128 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is | 127 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is |
| 129 // true. | 128 // true. |
| 130 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); | 129 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); |
| 131 | 130 |
| 132 // Launch the child process synchronously. | 131 // Launch the child process synchronously. |
| 133 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. | 132 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. |
| 134 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored | 133 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored |
| 135 // if |no_sandbox| is true. | 134 // if |no_sandbox| is true. |
| 136 bool Launch(CommandLine* cmd_line, | 135 bool Launch(base::CommandLine* cmd_line, |
| 137 bool no_sandbox, | 136 bool no_sandbox, |
| 138 const base::FilePath& exposed_dir); | 137 const base::FilePath& exposed_dir); |
| 139 | 138 |
| 140 base::ProcessHandle handle() const { return handle_; } | 139 base::ProcessHandle handle() const { return handle_; } |
| 141 | 140 |
| 142 // Messages handlers: | 141 // Messages handlers: |
| 143 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number, | 142 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number, |
| 144 double scale_factor); | 143 double scale_factor); |
| 145 void OnRenderPDFPagesToMetafileFailed(); | 144 void OnRenderPDFPagesToMetafileFailed(); |
| 146 void OnGetPrinterCapsAndDefaultsSucceeded( | 145 void OnGetPrinterCapsAndDefaultsSucceeded( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 163 base::FilePath metafile_path_; | 162 base::FilePath metafile_path_; |
| 164 // The temporary folder created for the metafile. | 163 // The temporary folder created for the metafile. |
| 165 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; | 164 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; |
| 166 // Start time of operation. | 165 // Start time of operation. |
| 167 base::Time start_time_; | 166 base::Time start_time_; |
| 168 | 167 |
| 169 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 168 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
| 170 }; | 169 }; |
| 171 | 170 |
| 172 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 171 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |