| 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 12 matching lines...) Expand all Loading... |
| 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @constructor | 30 * @constructor |
| 31 * @extends {WebInspector.SDKModel} | 31 * @extends {WebInspector.SDKModel} |
| 32 * @param {!WebInspector.Target} target | 32 * @param {!WebInspector.Target} target |
| 33 * @param {!WebInspector.ResourceTreeModel} resourceTreeModel |
| 33 */ | 34 */ |
| 34 WebInspector.ApplicationCacheModel = function(target) | 35 WebInspector.ApplicationCacheModel = function(target, resourceTreeModel) |
| 35 { | 36 { |
| 36 WebInspector.SDKModel.call(this, WebInspector.ApplicationCacheModel, target)
; | 37 WebInspector.SDKModel.call(this, WebInspector.ApplicationCacheModel, target)
; |
| 37 | 38 |
| 38 target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheD
ispatcher(this)); | 39 target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheD
ispatcher(this)); |
| 39 this._agent = target.applicationCacheAgent(); | 40 this._agent = target.applicationCacheAgent(); |
| 40 this._agent.enable(); | 41 this._agent.enable(); |
| 41 | 42 |
| 42 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.FrameNavigated, this._frameNavigated, this); | 43 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes
.FrameNavigated, this._frameNavigated, this); |
| 43 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.FrameDetached, this._frameDetached, this); | 44 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes
.FrameDetached, this._frameDetached, this); |
| 44 | 45 |
| 45 this._statuses = {}; | 46 this._statuses = {}; |
| 46 this._manifestURLsByFrame = {}; | 47 this._manifestURLsByFrame = {}; |
| 47 | 48 |
| 48 this._mainFrameNavigated(); | 49 this._mainFrameNavigated(); |
| 49 this._onLine = true; | 50 this._onLine = true; |
| 50 } | 51 } |
| 51 | 52 |
| 52 WebInspector.ApplicationCacheModel.EventTypes = { | 53 WebInspector.ApplicationCacheModel.EventTypes = { |
| 53 FrameManifestStatusUpdated: "FrameManifestStatusUpdated", | 54 FrameManifestStatusUpdated: "FrameManifestStatusUpdated", |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 270 } |
| 270 | 271 |
| 271 /** | 272 /** |
| 272 * @param {!WebInspector.Target} target | 273 * @param {!WebInspector.Target} target |
| 273 * @return {?WebInspector.ApplicationCacheModel} | 274 * @return {?WebInspector.ApplicationCacheModel} |
| 274 */ | 275 */ |
| 275 WebInspector.ApplicationCacheModel.fromTarget = function(target) | 276 WebInspector.ApplicationCacheModel.fromTarget = function(target) |
| 276 { | 277 { |
| 277 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI
nspector.ApplicationCacheModel)); | 278 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI
nspector.ApplicationCacheModel)); |
| 278 } | 279 } |
| OLD | NEW |