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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved.
eakuefner 2017/08/18 23:24:29 2017
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/tracing/base/base.html">
9
10 <script>
11 'use strict';
12 tr.exportTo('tr.v.ui', function() {
13 const DIAGNOSTIC_SPAN_BEHAVIOR = {
14 created() {
15 this.diagnostic_ = undefined;
16 this.name_ = undefined;
17 this.histogram_ = undefined;
18 },
19
20 attached() {
21 if (this.diagnostic_) this.updateContents_();
22 },
23
24 get diagnostic() {
25 return this.diagnostic_;
26 },
27
28 build(diagnostic, name, histogram) {
29 this.diagnostic_ = diagnostic;
30 this.name_ = name;
31 this.histogram_ = histogram;
32 if (this.isAttached) this.updateContents_();
33 },
34
35 updateContents_() {
36 throw new Error('dom-modules must override updateContents_()');
37 }
38 };
39
40 return {
41 DIAGNOSTIC_SPAN_BEHAVIOR,
42 };
43 });
44 </script>
OLDNEW
« 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