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

Unified Diff: Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

Issue 9187001: Merge 104563 - Web Inspector: fix DebuggerPresentationModel::uiSourceCodes - do not iterate (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
===================================================================
--- Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (revision 104675)
+++ Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (working copy)
@@ -36,6 +36,7 @@
{
// FIXME: apply formatter from outside as a generic mapping.
this._formatter = new WebInspector.ScriptFormatter();
+ this._rawSourceCodes = [];
this._rawSourceCodeForScriptId = {};
this._rawSourceCodeForURL = {};
this._rawSourceCodeForDocumentURL = {};
@@ -140,6 +141,7 @@
}
rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource);
+ this._rawSourceCodes.push(rawSourceCode);
this._bindScriptToRawSourceCode(script, rawSourceCode);
if (isInlineScript)
@@ -176,10 +178,10 @@
uiSourceCodes: function()
{
var result = [];
- for (var id in this._rawSourceCodeForScriptId) {
- var uiSourceCodeList = this._rawSourceCodeForScriptId[id].sourceMapping.uiSourceCodeList();
- for (var i = 0; i < uiSourceCodeList.length; ++i)
- result.push(uiSourceCodeList[i]);
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var uiSourceCodeList = this._rawSourceCodes[i].sourceMapping.uiSourceCodeList();
+ for (var j = 0; j < uiSourceCodeList.length; ++j)
+ result.push(uiSourceCodeList[j]);
}
return result;
},
@@ -331,8 +333,8 @@
this._formatSource = formatSource;
this._breakpointManager.reset();
- for (var id in this._rawSourceCodeForScriptId)
- this._rawSourceCodeForScriptId[id].setFormatted(this._formatSource);
+ for (var i = 0; i < this._rawSourceCodes.length; ++i)
+ this._rawSourceCodes[i].setFormatted(this._formatSource);
},
/**
@@ -382,8 +384,8 @@
_consoleCleared: function()
{
- for (var id in this._rawSourceCodeForScriptId)
- this._rawSourceCodeForScriptId[id].messages = [];
+ for (var i = 0; i < this._rawSourceCodes.length; ++i)
+ this._rawSourceCodes[i].messages = [];
this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.ConsoleMessagesCleared);
},
@@ -654,15 +656,16 @@
_debuggerReset: function()
{
- for (var id in this._rawSourceCodeForScriptId) {
- var rawSourceCode = this._rawSourceCodeForScriptId[id];
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var rawSourceCode = this._rawSourceCodes[i];
if (rawSourceCode.sourceMapping) {
var uiSourceCodeList = rawSourceCode.sourceMapping.uiSourceCodeList();
- for (var i = 0; i < uiSourceCodeList.length; ++i)
- this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, uiSourceCodeList[i]);
+ for (var j = 0; j < uiSourceCodeList.length; ++j)
+ this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, uiSourceCodeList[j]);
}
rawSourceCode.removeAllListeners();
}
+ this._rawSourceCodes = [];
this._rawSourceCodeForScriptId = {};
this._rawSourceCodeForURL = {};
this._rawSourceCodeForDocumentURL = {};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698