Changeset 99689 in webkit
- Timestamp:
- Nov 9, 2011 5:02:03 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99686 r99689 1 2011-11-09 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Extract ApplicationCacheModel from ApplicationCacheItemsView. 4 https://bugs.webkit.org/show_bug.cgi?id=71850 5 6 Reviewed by Pavel Feldman. 7 8 * WebCore.gypi: 9 * WebCore.vcproj/WebCore.vcproj: 10 * inspector/compile-front-end.sh: 11 * inspector/front-end/ApplicationCacheItemsView.js: 12 (WebInspector.ApplicationCacheItemsView): 13 (WebInspector.ApplicationCacheItemsView.prototype._update): 14 * inspector/front-end/ApplicationCacheModel.js: Added. 15 (WebInspector.ApplicationCacheModel): 16 (WebInspector.ApplicationCacheModel.prototype.getApplicationCachesAsync): 17 (WebInspector.ApplicationCacheDispatcher): 18 (WebInspector.ApplicationCacheDispatcher.prototype.updateApplicationCacheStatus): 19 (WebInspector.ApplicationCacheDispatcher.prototype.updateNetworkState): 20 * inspector/front-end/ResourcesPanel.js: 21 (WebInspector.ResourcesPanel.prototype.wasShown): 22 (WebInspector.ResourcesPanel.prototype.reset): 23 (WebInspector.ResourcesPanel.prototype._populateResourceTree): 24 (WebInspector.ResourcesPanel.prototype.showApplicationCache): 25 (WebInspector.ResourcesPanel.prototype._initializeApplicationCacheModel): 26 * inspector/front-end/WebKit.qrc: 27 * inspector/front-end/inspector.html: 28 1 29 2011-11-09 Vsevolod Vlasov <vsevik@chromium.org> 2 30 -
trunk/Source/WebCore/WebCore.gypi
r99659 r99689 6275 6275 'inspector/front-end/AdvancedSearchController.js', 6276 6276 'inspector/front-end/ApplicationCacheItemsView.js', 6277 'inspector/front-end/ApplicationCacheModel.js', 6277 6278 'inspector/front-end/AuditCategories.js', 6278 6279 'inspector/front-end/AuditFormatters.js', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r99659 r99689 68574 68574 </File> 68575 68575 <File 68576 RelativePath="..\inspector\front-end\ApplicationCacheModel.js" 68577 > 68578 </File> 68579 <File 68576 68580 RelativePath="..\inspector\front-end\AuditCategories.js" 68577 68581 > -
trunk/Source/WebCore/inspector/compile-front-end.sh
r98945 r99689 46 46 --js Source/WebCore/inspector/front-end/HandlerRegistry.js \ 47 47 --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \ 48 --module jsmodule_sdk:25:jsmodule_common \ 48 --module jsmodule_sdk:26:jsmodule_common \ 49 --js Source/WebCore/inspector/front-end/ApplicationCacheModel.js \ 49 50 --js Source/WebCore/inspector/front-end/CompilerSourceMapping.js \ 50 51 --js Source/WebCore/inspector/front-end/CompilerSourceMappingProvider.js \ -
trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
r98225 r99689 28 28 * @extends {WebInspector.View} 29 29 */ 30 WebInspector.ApplicationCacheItemsView = function( treeElement, appcacheDomain)30 WebInspector.ApplicationCacheItemsView = function(model, treeElement, appcacheDomain) 31 31 { 32 32 WebInspector.View.call(this); 33 34 this._model = model; 33 35 34 36 this.element.addStyleClass("storage-view"); … … 150 152 _update: function() 151 153 { 152 WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync(this._updateCallback.bind(this));154 this._model.getApplicationCachesAsync(this._updateCallback.bind(this)); 153 155 }, 154 156 … … 275 277 276 278 WebInspector.ApplicationCacheItemsView.prototype.__proto__ = WebInspector.View.prototype; 277 278 /**279 * @constructor280 * @implements {ApplicationCacheAgent.Dispatcher}281 */282 WebInspector.ApplicationCacheDispatcher = function()283 {284 }285 286 WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync = function(callback)287 {288 function mycallback(error, applicationCaches)289 {290 // FIXME: Currently, this list only returns a single application cache.291 if (!error && applicationCaches)292 callback(applicationCaches);293 }294 295 ApplicationCacheAgent.getApplicationCaches(mycallback);296 }297 298 WebInspector.ApplicationCacheDispatcher.prototype = {299 updateApplicationCacheStatus: function(status)300 {301 WebInspector.panels.resources.updateApplicationCacheStatus(status);302 },303 304 updateNetworkState: function(isNowOnline)305 {306 WebInspector.panels.resources.updateNetworkState(isNowOnline);307 }308 }309 310 InspectorBackend.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher()); -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r99686 r99689 109 109 { 110 110 WebInspector.Panel.prototype.wasShown.call(this); 111 this._populateResourceTree(); 111 if (!this._initialized) { 112 this._populateResourceTree(); 113 this._initializeApplicationCacheModel(); 114 115 this._initDefaultSelection(); 116 117 this._initialized = true; 118 } 112 119 }, 113 120 … … 119 126 _initDefaultSelection: function() 120 127 { 121 if (!this._ treeElementForFrameId)128 if (!this._initialized) 122 129 return; 123 130 … … 138 145 reset: function() 139 146 { 147 this.resourcesListTreeElement.removeChildren(); 148 this._treeElementForFrameId = {}; 149 140 150 this._origins = {}; 141 151 this._domains = {}; … … 178 188 _populateResourceTree: function() 179 189 { 180 if (this._treeElementForFrameId)181 return;182 183 190 this._treeElementForFrameId = {}; 184 191 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, this._frameAdded, this); … … 187 194 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, this._resourceAdded, this); 188 195 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this); 189 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources, this. _resetResourcesTree, this);196 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources, this.reset, this); 190 197 191 198 function populateFrame(frameId) … … 202 209 } 203 210 populateFrame.call(this, ""); 204 205 this._initDefaultSelection();206 211 }, 207 212 … … 258 263 if (frameTreeElement) 259 264 frameTreeElement.frameNavigated(event.data.frame); 260 },261 262 _resetResourcesTree: function()263 {264 this.resourcesListTreeElement.removeChildren();265 this._treeElementForFrameId = {};266 this.reset();267 265 }, 268 266 … … 487 485 var view = this._applicationCacheView; 488 486 if (!view) { 489 view = new WebInspector.ApplicationCacheItemsView(t reeElement, appcacheDomain);487 view = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, treeElement, appcacheDomain); 490 488 this._applicationCacheView = view; 491 489 } … … 569 567 }, 570 568 569 _initializeApplicationCacheModel: function() 570 { 571 this._applicationCacheModel = new WebInspector.ApplicationCacheModel(); 572 }, 573 571 574 updateApplicationCacheStatus: function(status) 572 575 { -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r99159 r99689 4 4 <file>AdvancedSearchController.js</file> 5 5 <file>ApplicationCacheItemsView.js</file> 6 <file>ApplicationCacheModel.js</file> 6 7 <file>AuditCategories.js</file> 7 8 <file>AuditFormatters.js</file> -
trunk/Source/WebCore/inspector/front-end/inspector.html
r99410 r99689 79 79 <script type="text/javascript" src="CookiesTable.js"></script> 80 80 <script type="text/javascript" src="CookieItemsView.js"></script> 81 <script type="text/javascript" src="ApplicationCacheModel.js"></script> 81 82 <script type="text/javascript" src="ApplicationCacheItemsView.js"></script> 82 83 <script type="text/javascript" src="Script.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.