Chromium Code Reviews| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 return result; | 100 return result; |
| 101 } | 101 } |
| 102 return null; | 102 return null; |
| 103 } | 103 } |
| 104 | 104 |
| 105 WebInspector.ResourceTreeModel.prototype = { | 105 WebInspector.ResourceTreeModel.prototype = { |
| 106 _fetchResourceTree: function() | 106 _fetchResourceTree: function() |
| 107 { | 107 { |
| 108 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */ | 108 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */ |
| 109 this._frames = {}; | 109 this._frames = {}; |
| 110 | 110 this._cachedResourcesProcessed = false; |
| 111 if (this.target().isDedicatedWorker()) { | |
| 112 this._cachedResourcesProcessed = true; | |
| 113 return; | |
| 114 } | |
| 115 | |
| 116 delete this._cachedResourcesProcessed; | |
| 117 this._agent.getResourceTree(this._processCachedResources.bind(this)); | 111 this._agent.getResourceTree(this._processCachedResources.bind(this)); |
| 118 }, | 112 }, |
| 119 | 113 |
| 120 _processCachedResources: function(error, mainFramePayload) | 114 _processCachedResources: function(error, mainFramePayload) |
| 121 { | 115 { |
| 122 if (error) { | 116 if (error) { |
| 123 console.error(JSON.stringify(error)); | 117 // FIXME: support targets that don't have resourceTreeModel. |
|
pfeldman
2015/07/02 17:28:07
This clearly breaks something :)
yurys
2015/07/02 21:21:26
All the tests are passing and it works fine on usu
| |
| 118 if (this.target().isPage() || this.target().isServiceWorker()) | |
| 119 console.error(JSON.stringify(error)); | |
| 120 this._cachedResourcesProcessed = true; | |
| 124 return; | 121 return; |
| 125 } | 122 } |
| 126 | 123 |
| 127 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes. WillLoadCachedResources); | 124 this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes. WillLoadCachedResources); |
| 128 this._inspectedPageURL = mainFramePayload.frame.url; | 125 this._inspectedPageURL = mainFramePayload.frame.url; |
| 129 | 126 |
| 130 // Do not process SW resources. | 127 // Do not process SW resources. |
| 131 if (this.target().isPage()) | 128 if (this.target().isPage()) |
| 132 this._addFramesRecursively(null, mainFramePayload); | 129 this._addFramesRecursively(null, mainFramePayload); |
| 133 else | 130 else |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 918 }, | 915 }, |
| 919 | 916 |
| 920 /** | 917 /** |
| 921 * @override | 918 * @override |
| 922 */ | 919 */ |
| 923 interstitialHidden: function() | 920 interstitialHidden: function() |
| 924 { | 921 { |
| 925 // Frontend is not interested in interstitials. | 922 // Frontend is not interested in interstitials. |
| 926 } | 923 } |
| 927 } | 924 } |
| OLD | NEW |