Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ApplicationCacheModel.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
43 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.FrameDetached, this._frameDetached, this); 43 if (resourceTreeModel)
44 {
dgozman 2016/07/14 16:29:29 { on previous line
eostroukhov-old 2016/07/20 23:46:15 Done.
45 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.FrameNavigated, this._frameNavigated, this);
46 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventT ypes.FrameDetached, this._frameDetached, this);
47 }
44 48
45 this._statuses = {}; 49 this._statuses = {};
46 this._manifestURLsByFrame = {}; 50 this._manifestURLsByFrame = {};
47 51
48 this._mainFrameNavigated(); 52 this._mainFrameNavigated();
49 this._onLine = true; 53 this._onLine = true;
50 } 54 }
51 55
52 WebInspector.ApplicationCacheModel.EventTypes = { 56 WebInspector.ApplicationCacheModel.EventTypes = {
53 FrameManifestStatusUpdated: "FrameManifestStatusUpdated", 57 FrameManifestStatusUpdated: "FrameManifestStatusUpdated",
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 273 }
270 274
271 /** 275 /**
272 * @param {!WebInspector.Target} target 276 * @param {!WebInspector.Target} target
273 * @return {?WebInspector.ApplicationCacheModel} 277 * @return {?WebInspector.ApplicationCacheModel}
274 */ 278 */
275 WebInspector.ApplicationCacheModel.fromTarget = function(target) 279 WebInspector.ApplicationCacheModel.fromTarget = function(target)
276 { 280 {
277 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI nspector.ApplicationCacheModel)); 281 return /** @type {?WebInspector.ApplicationCacheModel} */ (target.model(WebI nspector.ApplicationCacheModel));
278 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698