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

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

Issue 2988823002: DeviceInfo into GenericSets (Closed)
Patch Set: Remove how-to-write-metrics-device image Created 3 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 side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/value/diagnostics/merged_device_info.html
diff --git a/tracing/tracing/value/diagnostics/merged_device_info.html b/tracing/tracing/value/diagnostics/merged_device_info.html
deleted file mode 100644
index 9fa5d5b755f56abc37ad971d97ce0ebd89e952c9..0000000000000000000000000000000000000000
--- a/tracing/tracing/value/diagnostics/merged_device_info.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright 2017 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/base/utils.html">
-<link rel="import" href="/tracing/value/diagnostics/diagnostic.html">
-
-<script>
-'use strict';
-
-tr.exportTo('tr.v.d', function() {
- class MergedDeviceInfo extends tr.v.d.Diagnostic {
- constructor() {
- super();
-
- this.chromeVersions_ = new Set();
- this.osNames_ = new Set();
- this.osVersions_ = new Set();
- }
-
- clone() {
- const clone = new tr.v.d.MergedDeviceInfo();
- clone.addDiagnostic(this);
- return clone;
- }
-
- addToHistogram(hist) {
- hist.diagnostics.set(tr.v.d.RESERVED_NAMES.DEVICE, this);
- }
-
- canAddDiagnostic(otherDiagnostic) {
- return otherDiagnostic instanceof MergedDeviceInfo ||
- otherDiagnostic instanceof tr.v.d.DeviceInfo;
- }
-
- addDiagnostic(otherDiagnostic) {
- if (otherDiagnostic instanceof MergedDeviceInfo) {
- for (const name of otherDiagnostic.osNames) {
- this.osNames.add(name);
- }
- for (const name of otherDiagnostic.osVersions) {
- this.osVersions.add(name);
- }
- for (const name of otherDiagnostic.chromeVersions) {
- this.chromeVersions.add(name);
- }
- return this;
- }
-
- if (otherDiagnostic.osName) {
- this.osNames.add(otherDiagnostic.osName);
- }
- if (otherDiagnostic.osVersion) {
- this.osVersions.add(otherDiagnostic.osVersion);
- }
- if (otherDiagnostic.chromeVersion) {
- this.chromeVersions.add(otherDiagnostic.chromeVersion);
- }
- return this;
- }
-
- equals(other) {
- if (!(other instanceof MergedDeviceInfo)) return false;
- if (!tr.b.setsEqual(this.chromeVersions, other.chromeVersions)) {
- return false;
- }
- if (!tr.b.setsEqual(this.osVersions, other.osVersions)) return false;
- if (!tr.b.setsEqual(this.osNames, other.osNames)) return false;
- return true;
- }
-
- asDictInto_(d) {
- d.chromeVersions = Array.from(this.chromeVersions);
- d.osNames = Array.from(this.osNames);
- d.osVersions = Array.from(this.osVersions);
- }
-
- static fromDict(d) {
- const info = new MergedDeviceInfo();
- for (const chromeVersion of d.chromeVersions) {
- info.chromeVersions.add(chromeVersion);
- }
- for (const osName of d.osNames) {
- info.osNames.add(osName);
- }
- for (const osVersion of d.osVersions) {
- info.osVersions.add(osVersion);
- }
- return info;
- }
-
- get chromeVersions() {
- return this.chromeVersions_;
- }
-
- get osNames() {
- return this.osNames_;
- }
-
- get osVersions() {
- return this.osVersions_;
- }
- }
-
- tr.v.d.Diagnostic.register(MergedDeviceInfo, {
- elementName: 'tr-v-ui-merged-device-info-span'
- });
-
- return {
- MergedDeviceInfo,
- };
-});
-</script>
« no previous file with comments | « tracing/tracing/value/diagnostics/device_info.html ('k') | tracing/tracing/value/diagnostics/merged_device_info_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698