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> |