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

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

Issue 2782773002: [DevTools] Remove SDKModels' fromTarget methods (Closed)
Patch Set: addressed review comments Created 3 years, 8 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 22 matching lines...) Expand all
33 /** 33 /**
34 * @param {!SDK.Target} target 34 * @param {!SDK.Target} target
35 */ 35 */
36 constructor(target) { 36 constructor(target) {
37 super(target); 37 super(target);
38 38
39 target.registerApplicationCacheDispatcher(new Resources.ApplicationCacheDisp atcher(this)); 39 target.registerApplicationCacheDispatcher(new Resources.ApplicationCacheDisp atcher(this));
40 this._agent = target.applicationCacheAgent(); 40 this._agent = target.applicationCacheAgent();
41 this._agent.enable(); 41 this._agent.enable();
42 42
43 var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); 43 var resourceTreeModel = target.model(SDK.ResourceTreeModel);
44 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigat ed, this._frameNavigated, this); 44 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigat ed, this._frameNavigated, this);
45 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameDetache d, this._frameDetached, this); 45 resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameDetache d, this._frameDetached, this);
46 46
47 this._statuses = {}; 47 this._statuses = {};
48 this._manifestURLsByFrame = {}; 48 this._manifestURLsByFrame = {};
49 49
50 this._mainFrameNavigated(); 50 this._mainFrameNavigated();
51 this._onLine = true; 51 this._onLine = true;
52 } 52 }
53 53
54 /**
55 * @param {!SDK.Target} target
56 * @return {?Resources.ApplicationCacheModel}
57 */
58 static fromTarget(target) {
59 return target.model(Resources.ApplicationCacheModel);
60 }
61
62 _frameNavigated(event) { 54 _frameNavigated(event) {
63 var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data); 55 var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data);
64 if (frame.isMainFrame()) { 56 if (frame.isMainFrame()) {
65 this._mainFrameNavigated(); 57 this._mainFrameNavigated();
66 return; 58 return;
67 } 59 }
68 60
69 this._agent.getManifestForFrame(frame.id, this._manifestForFrameLoaded.bind( this, frame.id)); 61 this._agent.getManifestForFrame(frame.id, this._manifestForFrameLoaded.bind( this, frame.id));
70 } 62 }
71 63
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 246 }
255 247
256 /** 248 /**
257 * @override 249 * @override
258 * @param {boolean} isNowOnline 250 * @param {boolean} isNowOnline
259 */ 251 */
260 networkStateUpdated(isNowOnline) { 252 networkStateUpdated(isNowOnline) {
261 this._applicationCacheModel._networkStateUpdated(isNowOnline); 253 this._applicationCacheModel._networkStateUpdated(isNowOnline);
262 } 254 }
263 }; 255 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698