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 CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 6 #define CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 SetOomScoreAdjCallback; | 202 SetOomScoreAdjCallback; |
203 | 203 |
204 // Set OOM score oom_score_adj for some process. | 204 // Set OOM score oom_score_adj for some process. |
205 // Note that the corresponding DBus configuration of the debugd method | 205 // Note that the corresponding DBus configuration of the debugd method |
206 // "SetOomScoreAdj" only permits setting OOM score for processes running by | 206 // "SetOomScoreAdj" only permits setting OOM score for processes running by |
207 // user chronos or Android apps. | 207 // user chronos or Android apps. |
208 virtual void SetOomScoreAdj( | 208 virtual void SetOomScoreAdj( |
209 const std::map<pid_t, int32_t>& pid_to_oom_score_adj, | 209 const std::map<pid_t, int32_t>& pid_to_oom_score_adj, |
210 const SetOomScoreAdjCallback& callback) = 0; | 210 const SetOomScoreAdjCallback& callback) = 0; |
211 | 211 |
| 212 // A callback to handle the result of CupsAddPrinter. |
| 213 using CupsAddPrinterCallback = base::Callback<void(bool success)>; |
| 214 |
| 215 // Calls CupsAddPrinter. |name| is the printer name. |uri| is the device |
| 216 // uri. |ppd_path| is the absolute path to the PPD file. |ipp_everywhere| |
| 217 // is true for autoconf of IPP Everywhere printers. |callback| is called with |
| 218 // true if adding the printer to CUPS was successful and false if there was an |
| 219 // error. |error_callback| will be called if there was an error in |
| 220 // communicating with debugd. |
| 221 virtual void CupsAddPrinter(const std::string& name, |
| 222 const std::string& uri, |
| 223 const std::string& ppd_path, |
| 224 bool ipp_everywhere, |
| 225 const CupsAddPrinterCallback& callback, |
| 226 const base::Closure& error_callback) = 0; |
| 227 |
| 228 // A callback to handle the result of CupsRemovePrinter. |
| 229 using CupsRemovePrinterCallback = base::Callback<void(bool success)>; |
| 230 |
| 231 // Calls CupsRemovePrinter. |name| is the printer name as registered in |
| 232 // CUPS. |callback| is called with true if removing the printer from CUPS was |
| 233 // successful and false if there was an error. |error_callback| will be |
| 234 // called if there was an error in communicating with debugd. |
| 235 virtual void CupsRemovePrinter(const std::string& name, |
| 236 const CupsRemovePrinterCallback& callback, |
| 237 const base::Closure& error_callback) = 0; |
| 238 |
212 // Factory function, creates a new instance and returns ownership. | 239 // Factory function, creates a new instance and returns ownership. |
213 // For normal usage, access the singleton via DBusThreadManager::Get(). | 240 // For normal usage, access the singleton via DBusThreadManager::Get(). |
214 static DebugDaemonClient* Create(); | 241 static DebugDaemonClient* Create(); |
215 | 242 |
216 protected: | 243 protected: |
217 // Create() should be used instead. | 244 // Create() should be used instead. |
218 DebugDaemonClient(); | 245 DebugDaemonClient(); |
219 | 246 |
220 private: | 247 private: |
221 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | 248 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); |
222 }; | 249 }; |
223 | 250 |
224 } // namespace chromeos | 251 } // namespace chromeos |
225 | 252 |
226 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 253 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
OLD | NEW |