Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 * @param {!WebInspector.Target} target | 32 * @param {!WebInspector.Target} target |
| 33 */ | 33 */ |
| 34 WebInspector.ApplicationCacheModel = function(target) | 34 WebInspector.ApplicationCacheModel = function(target) |
| 35 { | 35 { |
| 36 WebInspector.SDKModel.call(this, WebInspector.ApplicationCacheModel, target) ; | 36 WebInspector.SDKModel.call(this, WebInspector.ApplicationCacheModel, target) ; |
| 37 | 37 |
| 38 target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheD ispatcher(this)); | 38 target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheD ispatcher(this)); |
| 39 this._agent = target.applicationCacheAgent(); | 39 this._agent = target.applicationCacheAgent(); |
| 40 this._agent.enable(); | 40 this._agent.enable(); |
| 41 | 41 |
| 42 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.FrameNavigated, this._frameNavigated, this); | 42 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target); |
|
pfeldman
2016/07/22 17:33:47
There should be no AppCacheModel when there is no
eostroukhov-old
2016/07/25 19:36:10
Done.
| |
| 43 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.FrameDetached, this._frameDetached, this); | 43 if (resourceTreeModel) { |
|
dgozman
2016/07/22 17:19:43
This model doesn't work without frames at all.
eostroukhov-old
2016/07/25 19:36:10
Done.
| |
| 44 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.FrameNavigated, this._frameNavigated, this); | |
| 45 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.FrameDetached, this._frameDetached, this); | |
| 46 } | |
| 44 | 47 |
| 45 this._statuses = {}; | 48 this._statuses = {}; |
| 46 this._manifestURLsByFrame = {}; | 49 this._manifestURLsByFrame = {}; |
| 47 | 50 |
| 48 this._mainFrameNavigated(); | 51 this._mainFrameNavigated(); |
| 49 this._onLine = true; | 52 this._onLine = true; |
| 50 } | 53 } |
| 51 | 54 |
| 52 WebInspector.ApplicationCacheModel.EventTypes = { | 55 WebInspector.ApplicationCacheModel.EventTypes = { |
| 53 FrameManifestStatusUpdated: "FrameManifestStatusUpdated", | 56 FrameManifestStatusUpdated: "FrameManifestStatusUpdated", |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 } | 272 } |
| 270 | 273 |
| 271 /** | 274 /** |
| 272 * @param {!WebInspector.Target} target | 275 * @param {!WebInspector.Target} target |
| 273 * @return {?WebInspector.ApplicationCacheModel} | 276 * @return {?WebInspector.ApplicationCacheModel} |
| 274 */ | 277 */ |
| 275 WebInspector.ApplicationCacheModel.fromTarget = function(target) | 278 WebInspector.ApplicationCacheModel.fromTarget = function(target) |
| 276 { | 279 { |
| 277 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI nspector.ApplicationCacheModel)); | 280 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI nspector.ApplicationCacheModel)); |
| 278 } | 281 } |
| OLD | NEW |