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

Unified Diff: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js

Issue 2752333002: DevTools: more efficiently dispose messages on console clear (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
index 4fa5b554791586c37976b94c5f63d1532deb9929..0176428dab1bc0f3193f41d7e87bbddb0232f0ba 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
@@ -566,6 +566,19 @@ Workspace.UISourceCode = class extends Common.Object {
this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved, message);
}
+ /**
+ * @param {!Set<!Workspace.UISourceCode.Message>} messagesToRemove
+ */
+ removeMessages(messagesToRemove) {
+ var remainingMessages = this._messages.filter(message => {
+ var keep = !messagesToRemove.has(message);
+ if (!keep)
+ this.dispatchEventToListeners(Workspace.UISourceCode.Events.MessageRemoved, message);
+ return keep;
+ });
+ this._messages = remainingMessages;
+ }
+
_removeAllMessages() {
if (!this._messages)
return;
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698