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 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Starts a process to get capabilities and defaults for the specified | 98 // Starts a process to get capabilities and defaults for the specified |
99 // printer. Used on Windows to isolate the service process from printer driver | 99 // printer. Used on Windows to isolate the service process from printer driver |
100 // crashes by executing this in a separate process. The process does not run | 100 // crashes by executing this in a separate process. The process does not run |
101 // in a sandbox. | 101 // in a sandbox. |
102 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); | 102 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); |
103 | 103 |
104 protected: | 104 protected: |
105 // Allows this method to be overridden for tests. | 105 // Allows this method to be overridden for tests. |
106 virtual FilePath GetUtilityProcessCmd(); | 106 virtual FilePath GetUtilityProcessCmd(); |
107 | 107 |
108 // Overriden from ChildProcessHost. | 108 // ChildProcessHost implementation. |
109 virtual bool CanShutdown() OVERRIDE; | 109 virtual bool CanShutdown() OVERRIDE; |
110 virtual void OnChildDied() OVERRIDE; | 110 virtual void OnChildDied() OVERRIDE; |
111 | 111 |
112 private: | 112 private: |
113 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the | 113 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the |
114 // path to tbe exposed to the sandbox. This is ignored if |no_sandbox| is | 114 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is |
115 // true. | 115 // true. |
116 bool StartProcess(bool no_sandbox, const FilePath& exposed_dir); | 116 bool StartProcess(bool no_sandbox, const FilePath& exposed_dir); |
117 | 117 |
118 // IPC messages: | 118 // IPC messages: |
119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
120 // Called when at least one page in the specified PDF has been rendered | 120 // Called when at least one page in the specified PDF has been rendered |
121 // successfully into metafile_path_; | 121 // successfully into metafile_path_; |
122 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); | 122 void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number); |
123 // Called when PDF rendering failed. | 123 // Called when PDF rendering failed. |
124 void OnRenderPDFPagesToMetafileFailed(); | 124 void OnRenderPDFPagesToMetafileFailed(); |
(...skipping 19 matching lines...) Expand all Loading... |
144 FilePath metafile_path_; | 144 FilePath metafile_path_; |
145 // The temporary folder created for the metafile. | 145 // The temporary folder created for the metafile. |
146 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; | 146 scoped_ptr<ScopedTempDir> scratch_metafile_dir_; |
147 // The unique id created for the process. | 147 // The unique id created for the process. |
148 int process_id_; | 148 int process_id_; |
149 | 149 |
150 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 150 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
151 }; | 151 }; |
152 | 152 |
153 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 153 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
OLD | NEW |