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

Unified Diff: tracing/tracing/value/diagnostics/generic.html

Issue 2000063006: Define DiagnosticMap and a basic Diagnostic hierarchy (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 7 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
Index: tracing/tracing/value/diagnostics/generic.html
diff --git a/tracing/tracing/value/diagnostics/generic.html b/tracing/tracing/value/diagnostics/generic.html
new file mode 100644
index 0000000000000000000000000000000000000000..83be50d843a0d41c33b73c23b9c93b546bc83c24
--- /dev/null
+++ b/tracing/tracing/value/diagnostics/generic.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<!--
+Copyright 2016 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+
+<link rel="import" href="/tracing/value/diagnostics/diagnostic.html">
+
+<script>
+'use strict';
+
+tr.exportTo('tr.v.d', function() {
+ /**
+ * A Generic diagnostic can contain any Plain-Ol'-Data objects that can be
+ * serialized using JSON.stringify(): null, boolean, number, string, array,
+ * dict. Generic diagnostics cannot contain tr.v.Value objects!
+ *
+ * @constructor
+ * @param {*} value
+ */
+ function Generic(value) {
+ this.value = value;
+ }
+
+ Generic.prototype = {
+ __proto__: tr.v.d.Diagnostic.prototype,
+
+ _asDictInto: function(d) {
+ d.value = this.value;
+ }
+ };
+
+ Generic.fromDict = function(d) {
+ return new Generic(d.value);
+ };
+
+ tr.v.d.Diagnostic.register(Generic);
+
+ return {
+ Generic: Generic
+ };
+});
+</script>
« no previous file with comments | « tracing/tracing/value/diagnostics/diagnostic_map.html ('k') | tracing/tracing/value/diagnostics/related_value_set.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698