Changeset 99689 in webkit


Ignore:
Timestamp:
Nov 9, 2011 5:02:03 AM (13 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Extract ApplicationCacheModel from ApplicationCacheItemsView.
https://bugs.webkit.org/show_bug.cgi?id=71850

Reviewed by Pavel Feldman.

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/compile-front-end.sh:
  • inspector/front-end/ApplicationCacheItemsView.js:

(WebInspector.ApplicationCacheItemsView):
(WebInspector.ApplicationCacheItemsView.prototype._update):

  • inspector/front-end/ApplicationCacheModel.js: Added.

(WebInspector.ApplicationCacheModel):
(WebInspector.ApplicationCacheModel.prototype.getApplicationCachesAsync):
(WebInspector.ApplicationCacheDispatcher):
(WebInspector.ApplicationCacheDispatcher.prototype.updateApplicationCacheStatus):
(WebInspector.ApplicationCacheDispatcher.prototype.updateNetworkState):

  • inspector/front-end/ResourcesPanel.js:

(WebInspector.ResourcesPanel.prototype.wasShown):
(WebInspector.ResourcesPanel.prototype.reset):
(WebInspector.ResourcesPanel.prototype._populateResourceTree):
(WebInspector.ResourcesPanel.prototype.showApplicationCache):
(WebInspector.ResourcesPanel.prototype._initializeApplicationCacheModel):

  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/inspector.html:
Location:
trunk/Source/WebCore
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99686 r99689  
     12011-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
    1292011-11-09  Vsevolod Vlasov  <vsevik@chromium.org>
    230
  • trunk/Source/WebCore/WebCore.gypi

    r99659 r99689  
    62756275            'inspector/front-end/AdvancedSearchController.js',
    62766276            'inspector/front-end/ApplicationCacheItemsView.js',
     6277            'inspector/front-end/ApplicationCacheModel.js',
    62776278            'inspector/front-end/AuditCategories.js',
    62786279            'inspector/front-end/AuditFormatters.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r99659 r99689  
    6857468574                                </File>
    6857568575                                <File
     68576                                        RelativePath="..\inspector\front-end\ApplicationCacheModel.js"
     68577                                        >
     68578                                </File>
     68579                                <File
    6857668580                                        RelativePath="..\inspector\front-end\AuditCategories.js"
    6857768581                                        >
  • trunk/Source/WebCore/inspector/compile-front-end.sh

    r98945 r99689  
    4646        --js Source/WebCore/inspector/front-end/HandlerRegistry.js \
    4747        --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 \
    4950        --js Source/WebCore/inspector/front-end/CompilerSourceMapping.js \
    5051        --js Source/WebCore/inspector/front-end/CompilerSourceMappingProvider.js \
  • trunk/Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js

    r98225 r99689  
    2828 * @extends {WebInspector.View}
    2929 */
    30 WebInspector.ApplicationCacheItemsView = function(treeElement, appcacheDomain)
     30WebInspector.ApplicationCacheItemsView = function(model, treeElement, appcacheDomain)
    3131{
    3232    WebInspector.View.call(this);
     33   
     34    this._model = model;
    3335
    3436    this.element.addStyleClass("storage-view");
     
    150152    _update: function()
    151153    {
    152         WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync(this._updateCallback.bind(this));
     154        this._model.getApplicationCachesAsync(this._updateCallback.bind(this));
    153155    },
    154156
     
    275277
    276278WebInspector.ApplicationCacheItemsView.prototype.__proto__ = WebInspector.View.prototype;
    277 
    278 /**
    279  * @constructor
    280  * @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  
    109109    {
    110110        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        }
    112119    },
    113120
     
    119126    _initDefaultSelection: function()
    120127    {
    121         if (!this._treeElementForFrameId)
     128        if (!this._initialized)
    122129            return;
    123130
     
    138145    reset: function()
    139146    {
     147        this.resourcesListTreeElement.removeChildren();
     148        this._treeElementForFrameId = {};
     149
    140150        this._origins = {};
    141151        this._domains = {};
     
    178188    _populateResourceTree: function()
    179189    {
    180         if (this._treeElementForFrameId)
    181             return;
    182 
    183190        this._treeElementForFrameId = {};
    184191        WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, this._frameAdded, this);
     
    187194        WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, this._resourceAdded, this);
    188195        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);
    190197
    191198        function populateFrame(frameId)
     
    202209        }
    203210        populateFrame.call(this, "");
    204 
    205         this._initDefaultSelection();
    206211    },
    207212
     
    258263        if (frameTreeElement)
    259264            frameTreeElement.frameNavigated(event.data.frame);
    260     },
    261 
    262     _resetResourcesTree: function()
    263     {
    264         this.resourcesListTreeElement.removeChildren();
    265         this._treeElementForFrameId = {};
    266         this.reset();
    267265    },
    268266
     
    487485        var view = this._applicationCacheView;
    488486        if (!view) {
    489             view = new WebInspector.ApplicationCacheItemsView(treeElement, appcacheDomain);
     487            view = new WebInspector.ApplicationCacheItemsView(this._applicationCacheModel, treeElement, appcacheDomain);
    490488            this._applicationCacheView = view;
    491489        }
     
    569567    },
    570568
     569    _initializeApplicationCacheModel: function()
     570    {
     571        this._applicationCacheModel = new WebInspector.ApplicationCacheModel();
     572    },
     573   
    571574    updateApplicationCacheStatus: function(status)
    572575    {
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r99159 r99689  
    44    <file>AdvancedSearchController.js</file>
    55    <file>ApplicationCacheItemsView.js</file>
     6    <file>ApplicationCacheModel.js</file>
    67    <file>AuditCategories.js</file>
    78    <file>AuditFormatters.js</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r99410 r99689  
    7979    <script type="text/javascript" src="CookiesTable.js"></script>
    8080    <script type="text/javascript" src="CookieItemsView.js"></script>
     81    <script type="text/javascript" src="ApplicationCacheModel.js"></script>
    8182    <script type="text/javascript" src="ApplicationCacheItemsView.js"></script>
    8283    <script type="text/javascript" src="Script.js"></script>
Note: See TracChangeset for help on using the changeset viewer.