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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js

Issue 2752333002: DevTools: more efficiently dispose messages on console clear (Closed)
Patch Set: Set instead of array 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 onTextEditorContentSet() { 168 onTextEditorContentSet() {
169 if (this._diff) 169 if (this._diff)
170 this._diff.updateDiffMarkersImmediately(); 170 this._diff.updateDiffMarkersImmediately();
171 super.onTextEditorContentSet(); 171 super.onTextEditorContentSet();
172 for (var message of this._allMessages()) 172 for (var message of this._allMessages())
173 this._addMessageToSource(message); 173 this._addMessageToSource(message);
174 this._decorateAllTypes(); 174 this._decorateAllTypes();
175 } 175 }
176 176
177 /** 177 /**
178 * @return {!Array<!Workspace.UISourceCode.Message>} 178 * @return {!Set<!Workspace.UISourceCode.Message>}
179 */ 179 */
180 _allMessages() { 180 _allMessages() {
181 return this._persistenceBinding ? 181 if (this._persistenceBinding) {
182 this._persistenceBinding.network.messages().concat(this._persistenceBind ing.fileSystem.messages()) : 182 var combinedSet = this._persistenceBinding.network.messages();
183 this._uiSourceCode.messages(); 183 combinedSet.addAll(this._persistenceBinding.fileSystem.messages());
184 return combinedSet;
185 }
186 return this._uiSourceCode.messages();
184 } 187 }
185 188
186 /** 189 /**
187 * @override 190 * @override
188 * @param {!Common.TextRange} oldRange 191 * @param {!Common.TextRange} oldRange
189 * @param {!Common.TextRange} newRange 192 * @param {!Common.TextRange} newRange
190 */ 193 */
191 onTextChanged(oldRange, newRange) { 194 onTextChanged(oldRange, newRange) {
192 if (this._diff) 195 if (this._diff)
193 this._diff.updateDiffMarkersWhenPossible(); 196 this._diff.updateDiffMarkersWhenPossible();
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 681
679 /** 682 /**
680 * @param {!Workspace.UISourceCode.Message} a 683 * @param {!Workspace.UISourceCode.Message} a
681 * @param {!Workspace.UISourceCode.Message} b 684 * @param {!Workspace.UISourceCode.Message} b
682 * @return {number} 685 * @return {number}
683 */ 686 */
684 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { 687 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) {
685 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - 688 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] -
686 Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; 689 Workspace.UISourceCode.Message._messageLevelPriority[b.level()];
687 }; 690 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698