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

Unified Diff: tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html

Issue 2948023002: Fix periodic dumping for memory-infra on Android. (Closed)
Patch Set: fix tests. Created 3 years, 6 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/ui/extras/about_tracing/record_selection_dialog.html
diff --git a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
index 9c5de3b3aef6d51c2a4477f56ff4ca4e64effcfa..8eb9399f420e49fcfbacff91b806b14a794911d9 100644
--- a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
+++ b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog.html
@@ -455,48 +455,36 @@ tr.exportTo('tr.ui.e.about_tracing', function() {
}
},
- categoryFilter() {
+ includedAndExcludedCategories() {
+ let includedCategories = [];
+ let excludedCategories = [];
if (this.usingPreset_()) {
- const categories = [];
const allCategories = this.allCategories_();
for (const category in allCategories) {
- const disabled = category.indexOf('disabled-by-default-') === 0;
+ const disabledByDefault =
+ category.indexOf('disabled-by-default-') === 0;
if (this.currentlyChosenPreset_.indexOf(category) >= 0) {
- if (disabled) {
- categories.push(category);
+ if (disabledByDefault) {
+ includedCategories.push(category);
}
} else {
- if (!disabled) {
- categories.push('-' + category);
+ if (!disabledByDefault) {
+ excludedCategories.push(category);
}
}
}
- return categories.join(',');
+ return {
+ included: includedCategories,
+ excluded: excludedCategories
+ };
}
- let categories = this.unselectedCategories_();
- const categoriesLength = categories.length;
- const negatedCategories = [];
- for (let i = 0; i < categoriesLength; ++i) {
- // Skip any category with a , as it will cause issues when we negate.
- // Both sides should have been added as separate categories, these can
- // only come from settings.
- if (categories[i].match(/,/)) continue;
- negatedCategories.push('-' + categories[i]);
- }
- categories = negatedCategories.join(',');
-
- let disabledCategories = this.enabledDisabledByDefaultCategories_();
- disabledCategories = disabledCategories.join(',');
-
- const results = [];
- if (categories !== '') {
- results.push(categories);
- }
- if (disabledCategories !== '') {
- results.push(disabledCategories);
- }
- return results.join(',');
+ excludedCategories = this.unselectedCategories_();
+ includedCategories = this.enabledDisabledByDefaultCategories_();
+ return {
+ included: includedCategories,
+ excluded: excludedCategories
+ };
},
clickRecordButton() {

Powered by Google App Engine
This is Rietveld 408576698