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

Unified Diff: tracing/tracing/value/ui/diagnostic_span_behavior.html

Issue 3002973002: Refactor diagnostic spans to share a polymer behavior. (Closed)
Patch Set: Created 3 years, 4 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 | « tracing/tracing/value/ui/diagnostic_span.html ('k') | tracing/tracing/value/ui/generic_set_span.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/ui/diagnostic_span_behavior.html
diff --git a/tracing/tracing/value/ui/diagnostic_span_behavior.html b/tracing/tracing/value/ui/diagnostic_span_behavior.html
new file mode 100644
index 0000000000000000000000000000000000000000..a40c15cb1c8dab1614e284b8f3d7de872c325b83
--- /dev/null
+++ b/tracing/tracing/value/ui/diagnostic_span_behavior.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<!--
+Copyright 2016 The Chromium Authors. All rights reserved.
eakuefner 2017/08/18 23:24:29 2017
+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/base/base.html">
+
+<script>
+'use strict';
+tr.exportTo('tr.v.ui', function() {
+ const DIAGNOSTIC_SPAN_BEHAVIOR = {
+ created() {
+ this.diagnostic_ = undefined;
+ this.name_ = undefined;
+ this.histogram_ = undefined;
+ },
+
+ attached() {
+ if (this.diagnostic_) this.updateContents_();
+ },
+
+ get diagnostic() {
+ return this.diagnostic_;
+ },
+
+ build(diagnostic, name, histogram) {
+ this.diagnostic_ = diagnostic;
+ this.name_ = name;
+ this.histogram_ = histogram;
+ if (this.isAttached) this.updateContents_();
+ },
+
+ updateContents_() {
+ throw new Error('dom-modules must override updateContents_()');
+ }
+ };
+
+ return {
+ DIAGNOSTIC_SPAN_BEHAVIOR,
+ };
+});
+</script>
« no previous file with comments | « tracing/tracing/value/ui/diagnostic_span.html ('k') | tracing/tracing/value/ui/generic_set_span.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698