| 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 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> |
| 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/callback.h" | 14 #include "base/callback.h" |
| 13 #include "base/files/file.h" | 15 #include "base/files/file.h" |
| 14 #include "base/macros.h" | 16 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted_memory.h" | 17 #include "base/memory/ref_counted_memory.h" |
| 16 #include "base/task_runner.h" | 18 #include "base/task_runner.h" |
| 17 #include "base/trace_event/tracing_agent.h" | 19 #include "base/trace_event/tracing_agent.h" |
| 18 #include "chromeos/chromeos_export.h" | 20 #include "chromeos/chromeos_export.h" |
| 19 #include "chromeos/dbus/dbus_client.h" | 21 #include "chromeos/dbus/dbus_client.h" |
| 20 #include "dbus/file_descriptor.h" | 22 #include "dbus/file_descriptor.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 virtual void UploadCrashes() = 0; | 187 virtual void UploadCrashes() = 0; |
| 186 | 188 |
| 187 // A callback for WaitForServiceToBeAvailable(). | 189 // A callback for WaitForServiceToBeAvailable(). |
| 188 typedef base::Callback<void(bool service_is_ready)> | 190 typedef base::Callback<void(bool service_is_ready)> |
| 189 WaitForServiceToBeAvailableCallback; | 191 WaitForServiceToBeAvailableCallback; |
| 190 | 192 |
| 191 // Runs the callback as soon as the service becomes available. | 193 // Runs the callback as soon as the service becomes available. |
| 192 virtual void WaitForServiceToBeAvailable( | 194 virtual void WaitForServiceToBeAvailable( |
| 193 const WaitForServiceToBeAvailableCallback& callback) = 0; | 195 const WaitForServiceToBeAvailableCallback& callback) = 0; |
| 194 | 196 |
| 197 // A callback for SetOomScoreAdj(). |
| 198 typedef base::Callback<void(bool success, const std::string& output)> |
| 199 SetOomScoreAdjCallback; |
| 200 |
| 201 // Set OOM score oom_score_adj for some process. |
| 202 // Note that the corresponding DBus configuration of the debugd method |
| 203 // "SetOomScoreAdj" only permits setting OOM score for processes running by |
| 204 // user chronos or Android apps. |
| 205 virtual void SetOomScoreAdj(const std::map<int, int>& pid_to_oom_score_adj, |
| 206 const SetOomScoreAdjCallback& callback) = 0; |
| 207 |
| 195 // Factory function, creates a new instance and returns ownership. | 208 // Factory function, creates a new instance and returns ownership. |
| 196 // For normal usage, access the singleton via DBusThreadManager::Get(). | 209 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 197 static DebugDaemonClient* Create(); | 210 static DebugDaemonClient* Create(); |
| 198 | 211 |
| 199 protected: | 212 protected: |
| 200 // Create() should be used instead. | 213 // Create() should be used instead. |
| 201 DebugDaemonClient(); | 214 DebugDaemonClient(); |
| 202 | 215 |
| 203 private: | 216 private: |
| 204 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | 217 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); |
| 205 }; | 218 }; |
| 206 | 219 |
| 207 } // namespace chromeos | 220 } // namespace chromeos |
| 208 | 221 |
| 209 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | 222 #endif // CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ |
| OLD | NEW |