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

Side by Side Diff: tracing/tracing/value/diagnostics/diagnostic_map.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <!-- 8 <!--
9 Include all Diagnostic subclasses here so that DiagnosticMap.addDicts() and 9 Include all Diagnostic subclasses here so that DiagnosticMap.addDicts() and
10 DiagnosticMap.fromDict() always have access to all subclasses in the 10 DiagnosticMap.fromDict() always have access to all subclasses in the
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 * @param {string} name 62 * @param {string} name
63 * @return {tr.v.d.Diagnostic} 63 * @return {tr.v.d.Diagnostic}
64 */ 64 */
65 get: function(name) { 65 get: function(name) {
66 return this.diagnosticsByName_[name]; 66 return this.diagnosticsByName_[name];
67 }, 67 },
68 68
69 /** 69 /**
70 * Iterate over this map's key-value-pairs. 70 * Iterate over this map's key-value-pairs.
71 * 71 *
72 * @param {function(string, tr.v.d.Diagnostic)} cb 72 * @param {function(string, tr.v.d.Diagnostic)} callback
73 * @param {Object=} opt_this 73 * @param {Object=} opt_this
74 */ 74 */
75 forEach: function(cb, opt_this) { 75 forEach: function(callback, opt_this) {
76 tr.b.iterItems(this.diagnosticsByName_, cb, opt_this || this); 76 tr.b.iterItems(this.diagnosticsByName_, callback, opt_this || this);
77 }, 77 },
78 78
79 asDict: function() { 79 asDict: function() {
80 var dict = {}; 80 var dict = {};
81 this.forEach(function(name, diagnostic) { 81 this.forEach(function(name, diagnostic) {
82 dict[name] = diagnostic.asDict(); 82 dict[name] = diagnostic.asDict();
83 }); 83 });
84 return dict; 84 return dict;
85 } 85 }
86 }; 86 };
87 87
88 DiagnosticMap.fromDict = function(d) { 88 DiagnosticMap.fromDict = function(d) {
89 var diagnostics = new DiagnosticMap(); 89 var diagnostics = new DiagnosticMap();
90 diagnostics.addDicts(d); 90 diagnostics.addDicts(d);
91 return diagnostics; 91 return diagnostics;
92 }; 92 };
93 93
94 return { 94 return {
95 DiagnosticMap: DiagnosticMap 95 DiagnosticMap: DiagnosticMap
96 }; 96 };
97 }); 97 });
98 </script> 98 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/diagnostics/composition_test.html ('k') | tracing/tracing/value/diagnostics/iteration_info.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698