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

Unified Diff: Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js

Issue 336183005: Remove title() from TimelineModel.Record (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
diff --git a/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js b/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
index bcf95f52e3df2dc9e0a8ed2f8c3cfdcf8821df7d..55970933d64204ffccdc2df23f8eaed271803ea7 100644
--- a/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
+++ b/Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js
@@ -74,6 +74,15 @@ WebInspector.TimelineUIUtilsImpl.prototype = {
/**
* @param {!WebInspector.TimelineModel.Record} record
+ * @return {string}
+ */
+ titleForRecord: function(record)
+ {
+ return WebInspector.TimelineUIUtilsImpl.recordTitle(record);
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
* @param {!WebInspector.Linkifier} linkifier
* @param {boolean} loadedFromFile
* @return {?Node}
@@ -105,6 +114,20 @@ WebInspector.TimelineUIUtilsImpl.prototype = {
return WebInspector.TimelineUIUtilsImpl._createEventDivider(recordType, title);
},
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @param {!RegExp} regExp
+ * @return {boolean}
+ */
+ testContentMatching: function(record, regExp)
+ {
+ var tokens = [WebInspector.TimelineUIUtilsImpl.recordTitle(record)];
+ var data = record.data();
+ for (var key in data)
+ tokens.push(data[key])
+ return regExp.test(tokens.join("|"));
+ },
+
__proto__: WebInspector.TimelineUIUtils.prototype
}
@@ -119,6 +142,24 @@ WebInspector.TimelineUIUtilsImpl._coalescableRecordTypes[WebInspector.TimelineMo
/**
* @param {!WebInspector.TimelineModel.Record} record
+ * @return {string}
+ */
+WebInspector.TimelineUIUtilsImpl.recordTitle = function(record)
+{
+ var recordData = record.data();
+ if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp)
+ return recordData["message"];
+ if (record.type() === WebInspector.TimelineModel.RecordType.JSFrame)
+ return recordData["functionName"];
+ if (WebInspector.TimelineUIUtilsImpl.isEventDivider(record)) {
+ var startTime = Number.millisToString(record.startTime() - record._model.minimumRecordTime());
+ return WebInspector.UIString("%s at %s", WebInspector.TimelineUIUtils.recordStyle(record).title, startTime, true);
+ }
+ return WebInspector.TimelineUIUtils.recordStyle(record).title;
+}
+
+/**
+ * @param {!WebInspector.TimelineModel.Record} record
* @return {boolean}
*/
WebInspector.TimelineUIUtilsImpl.isEventDivider = function(record)
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtils.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698