| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 result.push(this._resourcesMap[url]); | 720 result.push(this._resourcesMap[url]); |
| 721 return result; | 721 return result; |
| 722 }, | 722 }, |
| 723 | 723 |
| 724 /** | 724 /** |
| 725 * @param {string} url | 725 * @param {string} url |
| 726 * @return {?WebInspector.Resource} | 726 * @return {?WebInspector.Resource} |
| 727 */ | 727 */ |
| 728 resourceForURL: function(url) | 728 resourceForURL: function(url) |
| 729 { | 729 { |
| 730 var result; | 730 var resource = this._resourcesMap[url] || null; |
| 731 function filter(resource) | 731 if (resource) |
| 732 { | 732 return resource; |
| 733 if (resource.url === url) { | 733 for (var i = 0; !resource && i < this._childFrames.length; ++i) |
| 734 result = resource; | 734 resource = this._childFrames[i].resourceForURL(url); |
| 735 return true; | 735 return resource; |
| 736 } | |
| 737 } | |
| 738 this._callForFrameResources(filter); | |
| 739 return result || null; | |
| 740 }, | 736 }, |
| 741 | 737 |
| 742 /** | 738 /** |
| 743 * @param {function(!WebInspector.Resource)} callback | 739 * @param {function(!WebInspector.Resource)} callback |
| 744 * @return {boolean} | 740 * @return {boolean} |
| 745 */ | 741 */ |
| 746 _callForFrameResources: function(callback) | 742 _callForFrameResources: function(callback) |
| 747 { | 743 { |
| 748 for (var url in this._resourcesMap) { | 744 for (var url in this._resourcesMap) { |
| 749 if (callback(this._resourcesMap[url])) | 745 if (callback(this._resourcesMap[url])) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 | 932 |
| 937 /** | 933 /** |
| 938 * @override | 934 * @override |
| 939 */ | 935 */ |
| 940 navigationRequested: function() | 936 navigationRequested: function() |
| 941 { | 937 { |
| 942 // Frontend is not interested in when navigations are requested. | 938 // Frontend is not interested in when navigations are requested. |
| 943 } | 939 } |
| 944 | 940 |
| 945 } | 941 } |
| OLD | NEW |