| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // in a sandbox. | 104 // in a sandbox. |
| 105 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); | 105 bool StartGetPrinterCapsAndDefaults(const std::string& printer_name); |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 // Allows this method to be overridden for tests. | 108 // Allows this method to be overridden for tests. |
| 109 virtual base::FilePath GetUtilityProcessCmd(); | 109 virtual base::FilePath GetUtilityProcessCmd(); |
| 110 | 110 |
| 111 // ChildProcessHostDelegate implementation: | 111 // ChildProcessHostDelegate implementation: |
| 112 virtual void OnChildDisconnected() OVERRIDE; | 112 virtual void OnChildDisconnected() OVERRIDE; |
| 113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 114 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
| 114 | 115 |
| 115 private: | 116 private: |
| 116 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the | 117 // Starts a process. Returns true iff it succeeded. |exposed_dir| is the |
| 117 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is | 118 // path to the exposed to the sandbox. This is ignored if |no_sandbox| is |
| 118 // true. | 119 // true. |
| 119 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); | 120 bool StartProcess(bool no_sandbox, const base::FilePath& exposed_dir); |
| 120 | 121 |
| 121 // Launch the child process synchronously. | 122 // Launch the child process synchronously. |
| 122 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. | 123 // TODO(sanjeevr): Determine whether we need to make the launch asynchronous. |
| 123 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored | 124 // |exposed_dir| is the path to tbe exposed to the sandbox. This is ignored |
| (...skipping 21 matching lines...) Expand all Loading... |
| 145 bool waiting_for_reply_; | 146 bool waiting_for_reply_; |
| 146 // 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. |
| 147 base::FilePath metafile_path_; | 148 base::FilePath metafile_path_; |
| 148 // The temporary folder created for the metafile. | 149 // The temporary folder created for the metafile. |
| 149 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; | 150 scoped_ptr<base::ScopedTempDir> scratch_metafile_dir_; |
| 150 | 151 |
| 151 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); | 152 DISALLOW_COPY_AND_ASSIGN(ServiceUtilityProcessHost); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ | 155 #endif // CHROME_SERVICE_SERVICE_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |