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

Unified Diff: chrome/browser/resources/tracing/timeline_model.js

Issue 10170001: Find feature for tracing, at long last. (Closed) Base URL: git://localhost/home/nduca/Local/chrome/src@master
Patch Set: patch for landing Created 8 years, 8 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: chrome/browser/resources/tracing/timeline_model.js
diff --git a/chrome/browser/resources/tracing/timeline_model.js b/chrome/browser/resources/tracing/timeline_model.js
index 6c86331d41afab16e04c44929753d5741eae2851..193cea39c4d01457c2efb19f48c1a2b7bcf60cd8 100644
--- a/chrome/browser/resources/tracing/timeline_model.js
+++ b/chrome/browser/resources/tracing/timeline_model.js
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+'use strict';
/**
* @fileoverview TimelineModel is a parsed representation of the
@@ -212,7 +213,6 @@ cr.define('tracing', function() {
', tid: ' + this.tid +
(this.name ? ', name: ' + this.name : '');
}
-
};
/**
@@ -579,7 +579,6 @@ cr.define('tracing', function() {
}
return groups;
}
-
};
/**
@@ -1006,7 +1005,7 @@ cr.define('tracing', function() {
if (opt_zeroAndBoost === undefined)
opt_zeroAndBoost = true;
- activeImporters = [];
+ var activeImporters = [];
var importer = this.importOneTrace_(eventData, false);
activeImporters.push(importer);
if (opt_additionalEventData) {
@@ -1036,6 +1035,24 @@ cr.define('tracing', function() {
}
};
+ /**
+ * @constructor A filter that can be passed into
+ * Timeline.findAllObjectsMatchingFilter
+ */
+ function TimelineFilter(text) {
+ this.text_ = text;
+ }
+ TimelineFilter.prototype = {
+ __proto__: Object.prototype,
+
+ matchSlice: function(slice) {
+ if (this.text_.length == 0)
+ return false;
+ return slice.title.indexOf(this.text_) != -1;
+ }
+
+ };
+
return {
getPallette: getPallette,
getPalletteHighlightIdBoost: getPalletteHighlightIdBoost,
@@ -1051,7 +1068,8 @@ cr.define('tracing', function() {
TimelineProcess: TimelineProcess,
TimelineCpu: TimelineCpu,
TimelineAsyncSliceGroup: TimelineAsyncSliceGroup,
- TimelineModel: TimelineModel
+ TimelineModel: TimelineModel,
+ TimelineFilter: TimelineFilter
};
});
« no previous file with comments | « chrome/browser/resources/tracing/timeline.js ('k') | chrome/browser/resources/tracing/timeline_model_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698