OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 var frameId = event.data.frameId; | 309 var frameId = event.data.frameId; |
310 var frame = this._frames[frameId]; | 310 var frame = this._frames[frameId]; |
311 if (!frame) | 311 if (!frame) |
312 return; | 312 return; |
313 | 313 |
314 var url = event.data.url; | 314 var url = event.data.url; |
315 if (frame._resourcesMap[url]) | 315 if (frame._resourcesMap[url]) |
316 return; | 316 return; |
317 | 317 |
318 var resource = new WebInspector.Resource(null, url, frame.url, frameId,
event.data.loaderId, WebInspector.resourceTypes[event.data.resourceType], event.
data.mimeType); | 318 var resource = new WebInspector.Resource(this.target(), null, url, frame
.url, frameId, event.data.loaderId, WebInspector.resourceTypes[event.data.resour
ceType], event.data.mimeType); |
319 frame.addResource(resource); | 319 frame.addResource(resource); |
320 }, | 320 }, |
321 | 321 |
322 /** | 322 /** |
323 * @param {!PageAgent.FrameId} frameId | 323 * @param {!PageAgent.FrameId} frameId |
324 * @return {!WebInspector.ResourceTreeFrame} | 324 * @return {!WebInspector.ResourceTreeFrame} |
325 */ | 325 */ |
326 frameForId: function(frameId) | 326 frameForId: function(frameId) |
327 { | 327 { |
328 return this._frames[frameId]; | 328 return this._frames[frameId]; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 /** | 451 /** |
452 * @param {!PageAgent.Frame} frame | 452 * @param {!PageAgent.Frame} frame |
453 * @param {string} url | 453 * @param {string} url |
454 * @param {!WebInspector.ResourceType} type | 454 * @param {!WebInspector.ResourceType} type |
455 * @param {string} mimeType | 455 * @param {string} mimeType |
456 * @return {!WebInspector.Resource} | 456 * @return {!WebInspector.Resource} |
457 */ | 457 */ |
458 _createResourceFromFramePayload: function(frame, url, type, mimeType) | 458 _createResourceFromFramePayload: function(frame, url, type, mimeType) |
459 { | 459 { |
460 return new WebInspector.Resource(null, url, frame.url, frame.id, frame.l
oaderId, type, mimeType); | 460 return new WebInspector.Resource(this.target(), null, url, frame.url, fr
ame.id, frame.loaderId, type, mimeType); |
461 }, | 461 }, |
462 | 462 |
463 /** | 463 /** |
464 * @param {boolean=} ignoreCache | 464 * @param {boolean=} ignoreCache |
465 * @param {string=} scriptToEvaluateOnLoad | 465 * @param {string=} scriptToEvaluateOnLoad |
466 * @param {string=} scriptPreprocessor | 466 * @param {string=} scriptPreprocessor |
467 */ | 467 */ |
468 reloadPage: function(ignoreCache, scriptToEvaluateOnLoad, scriptPreprocessor
) | 468 reloadPage: function(ignoreCache, scriptToEvaluateOnLoad, scriptPreprocessor
) |
469 { | 469 { |
470 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.
WillReloadPage); | 470 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.
WillReloadPage); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 * @param {!WebInspector.NetworkRequest} request | 650 * @param {!WebInspector.NetworkRequest} request |
651 * @return {!WebInspector.Resource} | 651 * @return {!WebInspector.Resource} |
652 */ | 652 */ |
653 _addRequest: function(request) | 653 _addRequest: function(request) |
654 { | 654 { |
655 var resource = this._resourcesMap[request.url]; | 655 var resource = this._resourcesMap[request.url]; |
656 if (resource && resource.request === request) { | 656 if (resource && resource.request === request) { |
657 // Already in the tree, we just got an extra update. | 657 // Already in the tree, we just got an extra update. |
658 return resource; | 658 return resource; |
659 } | 659 } |
660 resource = new WebInspector.Resource(request, request.url, request.docum
entURL, request.frameId, request.loaderId, request.type, request.mimeType); | 660 resource = new WebInspector.Resource(this.target(), request, request.url
, request.documentURL, request.frameId, request.loaderId, request.type, request.
mimeType); |
661 this._resourcesMap[resource.url] = resource; | 661 this._resourcesMap[resource.url] = resource; |
662 this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.Even
tTypes.ResourceAdded, resource); | 662 this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.Even
tTypes.ResourceAdded, resource); |
663 return resource; | 663 return resource; |
664 }, | 664 }, |
665 | 665 |
666 /** | 666 /** |
667 * @return {!Array.<!WebInspector.Resource>} | 667 * @return {!Array.<!WebInspector.Resource>} |
668 */ | 668 */ |
669 resources: function() | 669 resources: function() |
670 { | 670 { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 screencastVisibilityChanged: function(visible) | 811 screencastVisibilityChanged: function(visible) |
812 { | 812 { |
813 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr
eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible}); | 813 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr
eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible}); |
814 } | 814 } |
815 } | 815 } |
816 | 816 |
817 /** | 817 /** |
818 * @type {!WebInspector.ResourceTreeModel} | 818 * @type {!WebInspector.ResourceTreeModel} |
819 */ | 819 */ |
820 WebInspector.resourceTreeModel; | 820 WebInspector.resourceTreeModel; |
OLD | NEW |