Changeset 244576 in webkit
- Timestamp:
- Apr 23, 2019, 6:20:32 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Base/FileUtilities.js (modified) (1 diff)
-
UserInterface/Views/NetworkTabContentView.js (modified) (1 diff)
-
UserInterface/Views/NetworkTableContentView.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r244566 r244576 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: support drag/drop for importing 4 https://bugs.webkit.org/show_bug.cgi?id=197221 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Views/NetworkTabContentView.js: 9 (WI.NetworkTabContentView.prototype.async.handleFileDrop): Added. 10 * UserInterface/Views/NetworkTableContentView.js: 11 (WI.NetworkTableContentView.prototype.processHAR): Added. 12 (WI.NetworkTableContentView.prototype._importHAR): 13 14 * UserInterface/Base/FileUtilities.js: 15 (WI.FileUtilities.async readText): 16 Only `await` if the result is a `Promise`. 17 1 18 2019-04-23 Devin Rousso <drousso@apple.com> 2 19 -
trunk/Source/WebInspectorUI/UserInterface/Base/FileUtilities.js
r243355 r244576 145 145 146 146 let promise = callback(result); 147 if (promise )147 if (promise instanceof Promise) 148 148 await promise; 149 149 } -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
r228024 r244576 84 84 } 85 85 86 async handleFileDrop(files) 87 { 88 await WI.FileUtilities.readJSON(files, (result) => this._networkTableContentView.processHAR(result)); 89 } 90 86 91 // Public 87 92 -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r244358 r244576 1243 1243 } 1244 1244 1245 processHAR(result) 1246 { 1247 let resources = WI.networkManager.processHAR(result); 1248 if (!resources) 1249 return; 1250 1251 let importedCollection = this._addCollection(); 1252 1253 let displayName = WI.UIString("Imported - %s").format(result.filename); 1254 this._addCollectionPathComponent(importedCollection, displayName, "network-har-icon"); 1255 1256 this._changeCollection(importedCollection); 1257 1258 for (let resource of resources) 1259 this._insertResourceAndReloadTable(resource); 1260 } 1261 1245 1262 handleClearShortcut(event) 1246 1263 { … … 2136 2153 _importHAR() 2137 2154 { 2138 WI.FileUtilities.importJSON((result) => { 2139 let resources = WI.networkManager.processHAR(result); 2140 if (!resources) 2141 return; 2142 2143 let importedCollection = this._addCollection(); 2144 2145 let displayName = WI.UIString("Imported - %s").format(result.filename); 2146 this._addCollectionPathComponent(importedCollection, displayName, "network-har-icon"); 2147 2148 this._changeCollection(importedCollection); 2149 2150 for (let resource of resources) 2151 this._insertResourceAndReloadTable(resource); 2152 }); 2155 WI.FileUtilities.importJSON((result) => this.processHAR(result)); 2153 2156 } 2154 2157
Note:
See TracChangeset
for help on using the changeset viewer.