Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Unified Diff: include/v8-platform.h

Issue 2367603002: [tracing] Support ConvertableToTraceFormat argument type. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/libplatform/tracing/trace-writer.cc » ('j') | src/tracing/trace-event.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-platform.h
diff --git a/include/v8-platform.h b/include/v8-platform.h
index d0b7aed8fc5a333bbef5281f8969db521e91c7af..e9006465e0d27cb59a8bd61029e14b9ffeb62f56 100644
--- a/include/v8-platform.h
+++ b/include/v8-platform.h
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <string>
namespace v8 {
@@ -17,24 +18,38 @@ class Isolate;
*/
class Task {
public:
- virtual ~Task() {}
+ virtual ~Task() = default;
virtual void Run() = 0;
};
-
/**
-* An IdleTask represents a unit of work to be performed in idle time.
-* The Run method is invoked with an argument that specifies the deadline in
-* seconds returned by MonotonicallyIncreasingTime().
-* The idle task is expected to complete by this deadline.
-*/
+ * An IdleTask represents a unit of work to be performed in idle time.
+ * The Run method is invoked with an argument that specifies the deadline in
+ * seconds returned by MonotonicallyIncreasingTime().
+ * The idle task is expected to complete by this deadline.
+ */
class IdleTask {
public:
- virtual ~IdleTask() {}
+ virtual ~IdleTask() = default;
virtual void Run(double deadline_in_seconds) = 0;
};
+/**
+ * The interface represents complex arguments to trace events.
+ */
+class ConvertableToTraceFormat {
+ public:
+ virtual ~ConvertableToTraceFormat() = default;
+
+ /**
+ * Append the class info to the provided |out| string. The appended
+ * data must be a valid JSON object. Strings must be properly quoted, and
+ * escaped. There is no processing applied to the content after it is
+ * appended.
+ */
+ virtual void AppendAsTraceFormat(std::string* out) const = 0;
+};
/**
* V8 Platform abstraction layer.
@@ -54,7 +69,7 @@ class Platform {
kLongRunningTask
};
- virtual ~Platform() {}
+ virtual ~Platform() = default;
/**
* Gets the number of threads that are used to execute background tasks. Is
« no previous file with comments | « no previous file | src/libplatform/tracing/trace-writer.cc » ('j') | src/tracing/trace-event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698