OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/memory/ref_counted_memory.h" | |
10 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" | |
11 | |
12 namespace dbus { | |
13 class Bus; | |
14 } // namespace dbus | |
15 | |
16 namespace chromeos { | |
17 | |
18 // DebugDaemonClient is used to communicate with the debug daemon. | |
19 class DebugDaemonClient { | |
20 public: | |
21 virtual ~DebugDaemonClient(); | |
22 | |
23 // Requests to start system/kernel tracing. | |
24 virtual void StartSystemTracing() = 0; | |
25 | |
26 // Called once RequestStopSystemTracing() is complete. Takes one parameter: | |
27 // - result: the data collected while tracing was active | |
28 typedef base::Callback<void(const scoped_refptr<base::RefCountedString>& | |
29 result)> StopSystemTracingCallback; | |
30 | |
31 // Requests to stop system tracing and calls |callback| when completed. | |
32 virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& | |
33 callback) = 0; | |
34 | |
35 // Returns an empty SystemTracingCallback that does nothing. | |
36 static StopSystemTracingCallback EmptyStopSystemTracingCallback(); | |
37 | |
38 // Factory function, creates a new instance and returns ownership. | |
39 // For normal usage, access the singleton via DBusThreadManager::Get(). | |
40 static DebugDaemonClient* Create(DBusClientImplementationType type, | |
41 dbus::Bus* bus); | |
42 protected: | |
43 // Create() should be used instead. | |
44 DebugDaemonClient(); | |
45 | |
46 private: | |
47 DISALLOW_COPY_AND_ASSIGN(DebugDaemonClient); | |
48 }; | |
49 | |
50 } // namespace chromeos | |
51 | |
52 #endif // CHROME_BROWSER_CHROMEOS_DBUS_DEBUG_DAEMON_CLIENT_H_ | |
OLD | NEW |