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

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

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: Created 4 years, 1 month 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 /** 5 /**
6 * Invariant: This model can only be constructed on a ServiceWorker target. 6 * Invariant: This model can only be constructed on a ServiceWorker target.
7 * @constructor 7 * @constructor
8 * @extends {WebInspector.SDKModel} 8 * @extends {WebInspector.SDKModel}
9 * @param {!WebInspector.Target} target 9 * @param {!WebInspector.Target} target
10 * @param {!WebInspector.SecurityOriginManager} securityOriginManager 10 * @param {!WebInspector.SecurityOriginManager} securityOriginManager
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 * @return {!Array.<!WebInspector.ServiceWorkerCacheModel.Cache>} 120 * @return {!Array.<!WebInspector.ServiceWorkerCacheModel.Cache>}
121 */ 121 */
122 caches: function() 122 caches: function()
123 { 123 {
124 var caches = new Array(); 124 var caches = new Array();
125 for (var cache of this._caches.values()) 125 for (var cache of this._caches.values())
126 caches.push(cache); 126 caches.push(cache);
127 return caches; 127 return caches;
128 }, 128 },
129 129
130 /**
131 * @override
132 */
130 dispose: function() 133 dispose: function()
131 { 134 {
132 for (var cache of this._caches.values()) 135 for (var cache of this._caches.values())
133 this._cacheRemoved(cache); 136 this._cacheRemoved(cache);
134 this._caches.clear(); 137 this._caches.clear();
135 if (this._enabled) { 138 if (this._enabled) {
136 this._securityOriginManager.removeEventListener(WebInspector.Securit yOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this); 139 this._securityOriginManager.removeEventListener(WebInspector.Securit yOriginManager.Events.SecurityOriginAdded, this._securityOriginAdded, this);
137 this._securityOriginManager.removeEventListener(WebInspector.Securit yOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this); 140 this._securityOriginManager.removeEventListener(WebInspector.Securit yOriginManager.Events.SecurityOriginRemoved, this._securityOriginRemoved, this);
138 } 141 }
139 }, 142 },
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 WebInspector.ServiceWorkerCacheModel.fromTarget = function(target) 335 WebInspector.ServiceWorkerCacheModel.fromTarget = function(target)
333 { 336 {
334 if (!target.hasBrowserCapability()) 337 if (!target.hasBrowserCapability())
335 return null; 338 return null;
336 var instance = /** @type {?WebInspector.ServiceWorkerCacheModel} */ (target. model(WebInspector.ServiceWorkerCacheModel)); 339 var instance = /** @type {?WebInspector.ServiceWorkerCacheModel} */ (target. model(WebInspector.ServiceWorkerCacheModel));
337 if (!instance) 340 if (!instance)
338 instance = new WebInspector.ServiceWorkerCacheModel(target, WebInspector .SecurityOriginManager.fromTarget(target)); 341 instance = new WebInspector.ServiceWorkerCacheModel(target, WebInspector .SecurityOriginManager.fromTarget(target));
339 return instance; 342 return instance;
340 }; 343 };
341 344
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698