| 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 this._agent.enable(); | 41 this._agent.enable(); |
| 42 | 42 |
| 43 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Fra
meNavigated, this._frameNavigated, this); | 43 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Fra
meNavigated, this._frameNavigated, this); |
| 44 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Fra
meDetached, this._frameDetached, this); | 44 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events.Fra
meDetached, this._frameDetached, this); |
| 45 | 45 |
| 46 this._statuses = {}; | 46 this._statuses = {}; |
| 47 this._manifestURLsByFrame = {}; | 47 this._manifestURLsByFrame = {}; |
| 48 | 48 |
| 49 this._mainFrameNavigated(); | 49 this._mainFrameNavigated(); |
| 50 this._onLine = true; | 50 this._onLine = true; |
| 51 } | 51 }; |
| 52 | 52 |
| 53 /** @enum {symbol} */ | 53 /** @enum {symbol} */ |
| 54 WebInspector.ApplicationCacheModel.Events = { | 54 WebInspector.ApplicationCacheModel.Events = { |
| 55 FrameManifestStatusUpdated: Symbol("FrameManifestStatusUpdated"), | 55 FrameManifestStatusUpdated: Symbol("FrameManifestStatusUpdated"), |
| 56 FrameManifestAdded: Symbol("FrameManifestAdded"), | 56 FrameManifestAdded: Symbol("FrameManifestAdded"), |
| 57 FrameManifestRemoved: Symbol("FrameManifestRemoved"), | 57 FrameManifestRemoved: Symbol("FrameManifestRemoved"), |
| 58 FrameManifestsReset: Symbol("FrameManifestsReset"), | 58 FrameManifestsReset: Symbol("FrameManifestsReset"), |
| 59 NetworkStateChanged: Symbol("NetworkStateChanged") | 59 NetworkStateChanged: Symbol("NetworkStateChanged") |
| 60 } | 60 }; |
| 61 | 61 |
| 62 WebInspector.ApplicationCacheModel.prototype = { | 62 WebInspector.ApplicationCacheModel.prototype = { |
| 63 _frameNavigated: function(event) | 63 _frameNavigated: function(event) |
| 64 { | 64 { |
| 65 var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); | 65 var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data); |
| 66 if (frame.isMainFrame()) { | 66 if (frame.isMainFrame()) { |
| 67 this._mainFrameNavigated(); | 67 this._mainFrameNavigated(); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 /** | 230 /** |
| 231 * @param {boolean} isNowOnline | 231 * @param {boolean} isNowOnline |
| 232 */ | 232 */ |
| 233 _networkStateUpdated: function(isNowOnline) | 233 _networkStateUpdated: function(isNowOnline) |
| 234 { | 234 { |
| 235 this._onLine = isNowOnline; | 235 this._onLine = isNowOnline; |
| 236 this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.
NetworkStateChanged, isNowOnline); | 236 this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.Events.
NetworkStateChanged, isNowOnline); |
| 237 }, | 237 }, |
| 238 | 238 |
| 239 __proto__: WebInspector.SDKModel.prototype | 239 __proto__: WebInspector.SDKModel.prototype |
| 240 } | 240 }; |
| 241 | 241 |
| 242 /** | 242 /** |
| 243 * @constructor | 243 * @constructor |
| 244 * @implements {ApplicationCacheAgent.Dispatcher} | 244 * @implements {ApplicationCacheAgent.Dispatcher} |
| 245 */ | 245 */ |
| 246 WebInspector.ApplicationCacheDispatcher = function(applicationCacheModel) | 246 WebInspector.ApplicationCacheDispatcher = function(applicationCacheModel) |
| 247 { | 247 { |
| 248 this._applicationCacheModel = applicationCacheModel; | 248 this._applicationCacheModel = applicationCacheModel; |
| 249 } | 249 }; |
| 250 | 250 |
| 251 WebInspector.ApplicationCacheDispatcher.prototype = { | 251 WebInspector.ApplicationCacheDispatcher.prototype = { |
| 252 /** | 252 /** |
| 253 * @override | 253 * @override |
| 254 * @param {string} frameId | 254 * @param {string} frameId |
| 255 * @param {string} manifestURL | 255 * @param {string} manifestURL |
| 256 * @param {number} status | 256 * @param {number} status |
| 257 */ | 257 */ |
| 258 applicationCacheStatusUpdated: function(frameId, manifestURL, status) | 258 applicationCacheStatusUpdated: function(frameId, manifestURL, status) |
| 259 { | 259 { |
| 260 this._applicationCacheModel._statusUpdated(frameId, manifestURL, status)
; | 260 this._applicationCacheModel._statusUpdated(frameId, manifestURL, status)
; |
| 261 }, | 261 }, |
| 262 | 262 |
| 263 /** | 263 /** |
| 264 * @override | 264 * @override |
| 265 * @param {boolean} isNowOnline | 265 * @param {boolean} isNowOnline |
| 266 */ | 266 */ |
| 267 networkStateUpdated: function(isNowOnline) | 267 networkStateUpdated: function(isNowOnline) |
| 268 { | 268 { |
| 269 this._applicationCacheModel._networkStateUpdated(isNowOnline); | 269 this._applicationCacheModel._networkStateUpdated(isNowOnline); |
| 270 } | 270 } |
| 271 } | 271 }; |
| 272 | 272 |
| 273 /** | 273 /** |
| 274 * @param {!WebInspector.Target} target | 274 * @param {!WebInspector.Target} target |
| 275 * @return {?WebInspector.ApplicationCacheModel} | 275 * @return {?WebInspector.ApplicationCacheModel} |
| 276 */ | 276 */ |
| 277 WebInspector.ApplicationCacheModel.fromTarget = function(target) | 277 WebInspector.ApplicationCacheModel.fromTarget = function(target) |
| 278 { | 278 { |
| 279 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI
nspector.ApplicationCacheModel)); | 279 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI
nspector.ApplicationCacheModel)); |
| 280 } | 280 }; |
| OLD | NEW |