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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 */ | 470 */ |
| 471 _makeResource: function(contentProvider) | 471 _makeResource: function(contentProvider) |
| 472 { | 472 { |
| 473 return { | 473 return { |
| 474 url: contentProvider.contentURL(), | 474 url: contentProvider.contentURL(), |
| 475 type: contentProvider.contentType().name() | 475 type: contentProvider.contentType().name() |
| 476 }; | 476 }; |
| 477 }, | 477 }, |
| 478 | 478 |
| 479 /** | 479 /** |
| 480 * @return {!Array.<!WebInspector.ContentProvider>} | 480 * @return {!Array<!WebInspector.ContentProvider>} |
| 481 */ | 481 */ |
| 482 _onGetPageResources: function() | 482 _onGetPageResources: function() |
| 483 { | 483 { |
| 484 var resources = {}; | 484 /** @type {!Map<string, !WebInspector.ContentProvider>} */ |
| 485 var resources = new Map(); | |
| 485 | 486 |
| 486 /** | 487 /** |
| 487 * @this {WebInspector.ExtensionServer} | 488 * @this {WebInspector.ExtensionServer} |
| 488 */ | 489 */ |
| 489 function pushResourceData(contentProvider) | 490 function pushResourceData(contentProvider) |
| 490 { | 491 { |
| 491 if (!resources[contentProvider.contentURL()]) | 492 if (!resources.has(contentProvider.contentURL())) |
| 492 resources[contentProvider.contentURL()] = this._makeResource(con tentProvider); | 493 resources.set(contentProvider.contentURL(), this._makeResource(c ontentProvider)); |
| 493 } | 494 } |
| 494 var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(W ebInspector.projectTypes.Network); | 495 var uiSourceCodes = WebInspector.workspace.uiSourceCodesForProjectType(W ebInspector.projectTypes.Network); |
| 495 uiSourceCodes = uiSourceCodes.concat(WebInspector.workspace.uiSourceCode sForProjectType(WebInspector.projectTypes.ContentScripts)); | 496 uiSourceCodes = uiSourceCodes.concat(WebInspector.workspace.uiSourceCode sForProjectType(WebInspector.projectTypes.ContentScripts)); |
| 496 uiSourceCodes.forEach(pushResourceData.bind(this)); | 497 uiSourceCodes.forEach(pushResourceData.bind(this)); |
| 497 for (var target of WebInspector.targetManager.targets()) | 498 for (var target of WebInspector.targetManager.targets()) |
| 498 target.resourceTreeModel.forAllResources(pushResourceData.bind(this) ); | 499 target.resourceTreeModel.forAllResources(pushResourceData.bind(this) ); |
| 499 return Object.values(resources); | 500 return Array.from(resources.values()); |
|
lushnikov
2016/07/20 03:02:50
return resources.valuesArray();
kozy
2016/07/20 17:55:18
Done.
| |
| 500 }, | 501 }, |
| 501 | 502 |
| 502 /** | 503 /** |
| 503 * @param {!WebInspector.ContentProvider} contentProvider | 504 * @param {!WebInspector.ContentProvider} contentProvider |
| 504 * @param {!Object} message | 505 * @param {!Object} message |
| 505 * @param {!MessagePort} port | 506 * @param {!MessagePort} port |
| 506 */ | 507 */ |
| 507 _getResourceContent: function(contentProvider, message, port) | 508 _getResourceContent: function(contentProvider, message, port) |
| 508 { | 509 { |
| 509 /** | 510 /** |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1081 /** | 1082 /** |
| 1082 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1083 * @typedef {{code: string, description: string, details: !Array.<*>}} |
| 1083 */ | 1084 */ |
| 1084 WebInspector.ExtensionStatus.Record; | 1085 WebInspector.ExtensionStatus.Record; |
| 1085 | 1086 |
| 1086 WebInspector.extensionAPI = {}; | 1087 WebInspector.extensionAPI = {}; |
| 1087 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1088 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
| 1088 | 1089 |
| 1089 /** @type {!WebInspector.ExtensionServer} */ | 1090 /** @type {!WebInspector.ExtensionServer} */ |
| 1090 WebInspector.extensionServer; | 1091 WebInspector.extensionServer; |
| OLD | NEW |