| 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> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // in a sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 114 // in a sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
| 115 bool StartGetPrinterSemanticCapsAndDefaults(const std::string& printer_name); | 115 bool StartGetPrinterSemanticCapsAndDefaults(const std::string& printer_name); |
| 116 | 116 |
| 117 protected: | 117 protected: |
| 118 // Allows this method to be overridden for tests. | 118 // Allows this method to be overridden for tests. |
| 119 virtual base::FilePath GetUtilityProcessCmd(); | 119 virtual base::FilePath GetUtilityProcessCmd(); |
| 120 | 120 |
| 121 // ChildProcessHostDelegate implementation: | 121 // ChildProcessHostDelegate implementation: |
| 122 virtual void OnChildDisconnected() OVERRIDE; | 122 virtual void OnChildDisconnected() OVERRIDE; |
| 123 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 123 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 124 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
| 124 | 125 |
| 125 private: | 126 private: |
| 126 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the | 127 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the |
| 127 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is | 128 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is |
| 128 // true. | 129 // true. |
| 129 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); | 130 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); |
| 130 | 131 |
| 131 // Launch the child process synchronously. | 132 // Launch the child process synchronously. |
| 132 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. | 133 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. |
| 133 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored | 134 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored |
| (...skipping 28 matching lines...) Expand all Loading... |
| 162 base::FilePath metafile_path_; | 163 base::FilePath metafile_path_; |
| 163 // The temporary folder created for the metafile. | 164 // The temporary folder created for the metafile. |
| 164 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; | 165 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; |
| 165 // Start time of operation. | 166 // Start time of operation. |
| 166 base::Time start_time_; | 167 base::Time start_time_; |
| 167 | 168 |
| 168 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 169 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
| 169 }; | 170 }; |
| 170 | 171 |
| 171 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 172 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |