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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: reupload Created 4 years, 3 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: third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
index 78ad36d60053c0181ce5d567d0f0487f5707ee86..28aaadcb0cdb0a593150bea6faefe7c408ec1542 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/FilteredUISourceCodeListDelegate.js
@@ -22,6 +22,9 @@ WebInspector.FilteredUISourceCodeListDelegate = function(defaultScores, history)
}
WebInspector.FilteredUISourceCodeListDelegate.prototype = {
+ /**
+ * @param {!WebInspector.Event} event
+ */
_projectRemoved: function(event)
{
var project = /** @type {!WebInspector.Project} */ (event.data);
@@ -40,11 +43,22 @@ WebInspector.FilteredUISourceCodeListDelegate.prototype = {
for (var i = 0; i < projects.length; ++i) {
if (skipProject && projects[i] === skipProject)
continue;
- this._uiSourceCodes = this._uiSourceCodes.concat(projects[i].uiSourceCodes());
+ var uiSourceCodes = projects[i].uiSourceCodes().filter(this._filterUISourceCode.bind(this));
+ this._uiSourceCodes = this._uiSourceCodes.concat(uiSourceCodes);
}
},
/**
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @return {boolean}
+ */
+ _filterUISourceCode: function(uiSourceCode)
+ {
+ var binding = WebInspector.persistence.binding(uiSourceCode);
+ return !binding || binding.network === uiSourceCode;
+ },
+
+ /**
* @param {?WebInspector.UISourceCode} uiSourceCode
* @param {number=} lineNumber
* @param {number=} columnNumber
@@ -196,7 +210,7 @@ WebInspector.FilteredUISourceCodeListDelegate.prototype = {
_uiSourceCodeAdded: function(event)
{
var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
- if (!this.filterProject(uiSourceCode.project()))
+ if (!this._filterUISourceCode(uiSourceCode) || !this.filterProject(uiSourceCode.project()))
return;
this._uiSourceCodes.push(uiSourceCode);
this.refresh();

Powered by Google App Engine
This is Rietveld 408576698