Changeset 76587 in webkit
- Timestamp:
- Jan 25, 2011 5:32:33 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76586 r76587 1 2011-01-25 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: bind resources to URLs upon adding them into the tree. 6 https://bugs.webkit.org/show_bug.cgi?id=53013 7 8 * inspector/debugger-scripts-expected.txt: 9 * inspector/debugger-scripts.html: 10 1 11 2011-01-25 Nikolas Zimmermann <nzimmermann@rim.com> 2 12 -
trunk/LayoutTests/inspector/debugger-scripts-expected.txt
r76129 r76587 4 4 script 1: 5 5 offset: 5:8 6 length: 10 966 length: 1050 7 7 script 2: 8 8 offset: 38:21 -
trunk/LayoutTests/inspector/debugger-scripts.html
r76129 r76587 18 18 function step2(event) 19 19 { 20 var script = WebInspector.debuggerModel.scriptForSourceID(event.data);20 var script = event.data; 21 21 if (script.sourceURL !== WebInspector.mainResource.url) 22 22 return; -
trunk/Source/WebCore/ChangeLog
r76586 r76587 1 2011-01-25 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: bind resources to URLs upon adding them into the tree. 6 https://bugs.webkit.org/show_bug.cgi?id=53013 7 8 * inspector/front-end/AuditRules.js: 9 (WebInspector.AuditRules.UnusedCssRule.prototype.doRun.evalCallback.selectorsCallback): 10 * inspector/front-end/CSSStyleModel.js: 11 (WebInspector.CSSStyleModel.prototype._styleSheetChanged.callback): 12 (WebInspector.CSSStyleModel.prototype._styleSheetChanged): 13 * inspector/front-end/DebuggerModel.js: 14 (WebInspector.DebuggerModel.prototype._parsedScriptSource): 15 * inspector/front-end/NetworkManager.js: 16 (WebInspector.NetworkManager.prototype._processCachedResources): 17 (WebInspector.NetworkManager.prototype.inflightResourceForURL): 18 (WebInspector.NetworkDispatcher): 19 (WebInspector.NetworkDispatcher.prototype.willSendRequest): 20 (WebInspector.NetworkDispatcher.prototype.markResourceAsCached): 21 (WebInspector.NetworkDispatcher.prototype.didReceiveResponse): 22 (WebInspector.NetworkDispatcher.prototype.didReceiveContentLength): 23 (WebInspector.NetworkDispatcher.prototype.didFinishLoading): 24 (WebInspector.NetworkDispatcher.prototype.didFailLoading): 25 (WebInspector.NetworkDispatcher.prototype.willSendWebSocketHandshakeRequest): 26 (WebInspector.NetworkDispatcher.prototype.didReceiveWebSocketHandshakeResponse): 27 (WebInspector.NetworkDispatcher.prototype.didCloseWebSocket): 28 (WebInspector.NetworkDispatcher.prototype._appendRedirect): 29 (WebInspector.NetworkDispatcher.prototype._startResource): 30 (WebInspector.NetworkDispatcher.prototype._finishResource): 31 (WebInspector.NetworkDispatcher.prototype._createResource): 32 * inspector/front-end/ResourceTreeModel.js: 33 (WebInspector.ResourceTreeModel.prototype.addResourceToFrame): 34 (WebInspector.ResourceTreeModel.prototype._bindResourceURL): 35 (WebInspector.ResourceTreeModel.prototype._clearResources): 36 (WebInspector.ResourceTreeModel.prototype._unbindResourceURL): 37 * inspector/front-end/ResourcesPanel.js: 38 (WebInspector.ResourcesPanel.prototype.canShowSourceLine): 39 (WebInspector.ResourcesPanel.prototype.showSourceLine): 40 * inspector/front-end/ScriptsPanel.js: 41 (WebInspector.ScriptsPanel.prototype._parsedScriptSource): 42 (WebInspector.ScriptsPanel.prototype._addScript): 43 1 44 2011-01-25 Nikolas Zimmermann <nzimmermann@rim.com> 2 45 -
trunk/Source/WebCore/inspector/front-end/AuditRules.js
r76105 r76587 327 327 continue; 328 328 329 var resource = WebInspector.resource TreeModel.resourceForURL(styleSheet.sourceURL);329 var resource = WebInspector.resourceForURL(styleSheet.sourceURL); 330 330 var isInlineBlock = resource && resource.type == WebInspector.Resource.Type.Document; 331 331 var url = !isInlineBlock ? WebInspector.AuditRuleResult.linkifyDisplayName(styleSheet.sourceURL) : String.sprintf("Inline block #%d", ++inlineBlockOrdinal); -
trunk/Source/WebCore/inspector/front-end/CSSStyleModel.js
r74740 r76587 163 163 function callback(href, content) 164 164 { 165 var resource = WebInspector.resource TreeModel.resourceForURL(href);165 var resource = WebInspector.resourceForURL(href); 166 166 if (resource && resource.type === WebInspector.Resource.Type.Stylesheet) 167 167 resource.setContent(content, this._onRevert.bind(this, styleSheetId)); -
trunk/Source/WebCore/inspector/front-end/DebuggerModel.js
r76509 r76587 248 248 var script = new WebInspector.Script(sourceID, sourceURL, "", lineOffset, columnOffset, length, undefined, undefined, scriptWorldType); 249 249 this._scripts[sourceID] = script; 250 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, s ourceID);250 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, script); 251 251 }, 252 252 -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r76519 r76587 62 62 WebInspector.mainResource = mainResource; 63 63 mainResource.isMainResource = true; 64 }, 65 66 inflightResourceForURL: function(url) 67 { 68 return this._dispatcher._inflightResourcesByURL[url]; 64 69 } 65 70 } … … 70 75 { 71 76 this._manager = manager; 72 this._inflightResources = {}; 77 this._inflightResourcesById = {}; 78 this._inflightResourcesByURL = {}; 73 79 this._resourceTreeModel = resourceTreeModel; 74 80 this._lastIdentifierForCachedResource = 0; … … 129 135 willSendRequest: function(identifier, time, request, redirectResponse) 130 136 { 131 var resource = this._inflightResources [identifier];137 var resource = this._inflightResourcesById[identifier]; 132 138 if (!resource) 133 139 return; … … 152 158 markResourceAsCached: function(identifier) 153 159 { 154 var resource = this._inflightResources [identifier];160 var resource = this._inflightResourcesById[identifier]; 155 161 if (!resource) 156 162 return; … … 162 168 didReceiveResponse: function(identifier, time, resourceType, response) 163 169 { 164 var resource = this._inflightResources [identifier];170 var resource = this._inflightResourcesById[identifier]; 165 171 if (!resource) 166 172 return; … … 177 183 didReceiveContentLength: function(identifier, time, lengthReceived) 178 184 { 179 var resource = this._inflightResources [identifier];185 var resource = this._inflightResourcesById[identifier]; 180 186 if (!resource) 181 187 return; … … 189 195 didFinishLoading: function(identifier, finishTime) 190 196 { 191 var resource = this._inflightResources [identifier];197 var resource = this._inflightResourcesById[identifier]; 192 198 if (!resource) 193 199 return; … … 198 204 didFailLoading: function(identifier, time, localizedDescription) 199 205 { 200 var resource = this._inflightResources [identifier];206 var resource = this._inflightResourcesById[identifier]; 201 207 if (!resource) 202 208 return; … … 257 263 willSendWebSocketHandshakeRequest: function(identifier, time, request) 258 264 { 259 var resource = this._inflightResources [identifier];265 var resource = this._inflightResourcesById[identifier]; 260 266 if (!resource) 261 267 return; … … 271 277 didReceiveWebSocketHandshakeResponse: function(identifier, time, response) 272 278 { 273 var resource = this._inflightResources [identifier];279 var resource = this._inflightResourcesById[identifier]; 274 280 if (!resource) 275 281 return; … … 286 292 didCloseWebSocket: function(identifier, time) 287 293 { 288 var resource = this._inflightResources [identifier];294 var resource = this._inflightResourcesById[identifier]; 289 295 if (!resource) 290 296 return; … … 294 300 _appendRedirect: function(identifier, time, redirectURL) 295 301 { 296 var originalResource = this._inflightResources [identifier];302 var originalResource = this._inflightResourcesById[identifier]; 297 303 var previousRedirects = originalResource.redirects || []; 298 304 originalResource.identifier = "redirected:" + identifier + "." + previousRedirects.length; 299 305 delete originalResource.redirects; 300 306 this._finishResource(originalResource, time); 301 // We bound resource early, but it happened to be a redirect and won't make it through to302 // the resource tree -- so unbind it.303 // FIXME: we should bind upon adding to the tree only (encapsulated into ResourceTreeModel),304 // Script debugger should do explicit late binding on its own.305 this._resourceTreeModel.unbindResourceURL(originalResource);306 307 307 var newResource = this._createResource(identifier, redirectURL, originalResource.loader, originalResource.stackTrace); 308 308 newResource.redirects = previousRedirects.concat(originalResource); … … 312 312 _startResource: function(resource) 313 313 { 314 this._inflightResources[resource.identifier] = resource; 314 this._inflightResourcesById[resource.identifier] = resource; 315 this._inflightResourcesByURL[resource.url] = resource; 315 316 this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceStarted, resource); 316 317 }, … … 326 327 resource.finished = true; 327 328 this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResourceFinished, resource); 328 delete this._inflightResources[resource.identifier]; 329 delete this._inflightResourcesById[resource.identifier]; 330 delete this._inflightResourcesByURL[resource.url]; 329 331 }, 330 332 … … 365 367 var resource = new WebInspector.Resource(identifier, url); 366 368 resource.loader = loader; 367 if (loader) {369 if (loader) 368 370 resource.documentURL = loader.url; 369 this._resourceTreeModel.bindResourceURL(resource);370 }371 371 resource.stackTrace = stackTrace; 372 372 return resource; -
trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js
r76519 r76587 83 83 } 84 84 resourcesForFrame.push(resource); 85 this._bindResourceURL(resource); 85 86 86 87 WebInspector.panels.resources.addResourceToFrame(frameId, resource); … … 130 131 }, 131 132 132 bindResourceURL: function(resource)133 _bindResourceURL: function(resource) 133 134 { 134 135 var resourceForURL = this._resourcesByURL[resource.url]; … … 170 171 continue; 171 172 } 172 this. unbindResourceURL(resource);173 this._unbindResourceURL(resource); 173 174 } 174 175 … … 196 197 }, 197 198 198 unbindResourceURL: function(resource)199 _unbindResourceURL: function(resource) 199 200 { 200 201 var resourceForURL = this._resourcesByURL[resource.url]; -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r76504 r76587 339 339 canShowSourceLine: function(url, line) 340 340 { 341 return !!WebInspector.resource TreeModel.resourceForURL(url);341 return !!WebInspector.resourceForURL(url); 342 342 }, 343 343 344 344 showSourceLine: function(url, line) 345 345 { 346 var resource = WebInspector.resource TreeModel.resourceForURL(url);346 var resource = WebInspector.resourceForURL(url); 347 347 if (resource.type === WebInspector.Resource.Type.XHR) { 348 348 // Show XHRs in the network panel only. … … 353 353 return; 354 354 } 355 this.showResource(WebInspector.resource TreeModel.resourceForURL(url), line);355 this.showResource(WebInspector.resourceForURL(url), line); 356 356 }, 357 357 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r76497 r76587 243 243 _parsedScriptSource: function(event) 244 244 { 245 var sourceID = event.data; 246 var script = WebInspector.debuggerModel.scriptForSourceID(sourceID); 247 this._addScript(script); 245 this._addScript(event.data); 248 246 }, 249 247 … … 276 274 _addScript: function(script) 277 275 { 278 var resource = WebInspector. resourceForURL(script.sourceURL);276 var resource = WebInspector.networkManager.inflightResourceForURL(script.sourceURL) || WebInspector.resourceForURL(script.sourceURL); 279 277 if (resource) { 280 278 if (resource.finished) {
Note: See TracChangeset
for help on using the changeset viewer.