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

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

Issue 2851913002: [DevTools] Do not expose agents on Target
Patch Set: storage and tests.js Created 3 years, 7 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 SDK.ServiceWorkerCacheModel = class extends SDK.SDKModel { 7 SDK.ServiceWorkerCacheModel = class extends SDK.SDKModel {
8 /** 8 /**
9 * Invariant: This model can only be constructed on a ServiceWorker target. 9 * Invariant: This model can only be constructed on a ServiceWorker target.
10 * @param {!SDK.Target} target 10 * @param {!SDK.Target} target
11 * @param {!Protocol.Dispatcher} dispatcher
11 */ 12 */
12 constructor(target) { 13 constructor(target, dispatcher) {
13 super(target); 14 super(target, dispatcher);
14 15
15 /** @type {!Map<string, !SDK.ServiceWorkerCacheModel.Cache>} */ 16 /** @type {!Map<string, !SDK.ServiceWorkerCacheModel.Cache>} */
16 this._caches = new Map(); 17 this._caches = new Map();
17 18
18 this._agent = target.cacheStorageAgent(); 19 this._agent = dispatcher.cacheStorageAgent();
19 20
20 this._securityOriginManager = target.model(SDK.SecurityOriginManager); 21 this._securityOriginManager = target.model(SDK.SecurityOriginManager);
21 22
22 /** @type {boolean} */ 23 /** @type {boolean} */
23 this._enabled = false; 24 this._enabled = false;
24 } 25 }
25 26
26 enable() { 27 enable() {
27 if (this._enabled) 28 if (this._enabled)
28 return; 29 return;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 304 }
304 305
305 /** 306 /**
306 * @override 307 * @override
307 * @return {string} 308 * @return {string}
308 */ 309 */
309 toString() { 310 toString() {
310 return this.securityOrigin + this.cacheName; 311 return this.securityOrigin + this.cacheName;
311 } 312 }
312 }; 313 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698