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

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

Issue 2562453003: [DevTools] Remove Common.Event.target field. (Closed)
Patch Set: works Created 4 years 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) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 if (!model) 1257 if (!model)
1258 return; 1258 return;
1259 model.refreshCacheNames(); 1259 model.refreshCacheNames();
1260 } 1260 }
1261 } 1261 }
1262 1262
1263 /** 1263 /**
1264 * @param {!Common.Event} event 1264 * @param {!Common.Event} event
1265 */ 1265 */
1266 _cacheAdded(event) { 1266 _cacheAdded(event) {
1267 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data); 1267 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca che);
1268 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.target); 1268 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model);
1269 this._addCache(model, cache); 1269 this._addCache(model, cache);
1270 } 1270 }
1271 1271
1272 /** 1272 /**
1273 * @param {!SDK.ServiceWorkerCacheModel} model 1273 * @param {!SDK.ServiceWorkerCacheModel} model
1274 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache 1274 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache
1275 */ 1275 */
1276 _addCache(model, cache) { 1276 _addCache(model, cache) {
1277 var swCacheTreeElement = new Resources.SWCacheTreeElement(this._storagePanel , model, cache); 1277 var swCacheTreeElement = new Resources.SWCacheTreeElement(this._storagePanel , model, cache);
1278 this._swCacheTreeElements.push(swCacheTreeElement); 1278 this._swCacheTreeElements.push(swCacheTreeElement);
1279 this.appendChild(swCacheTreeElement); 1279 this.appendChild(swCacheTreeElement);
1280 } 1280 }
1281 1281
1282 /** 1282 /**
1283 * @param {!Common.Event} event 1283 * @param {!Common.Event} event
1284 */ 1284 */
1285 _cacheRemoved(event) { 1285 _cacheRemoved(event) {
1286 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data); 1286 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca che);
1287 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.target); 1287 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model);
1288 1288
1289 var swCacheTreeElement = this._cacheTreeElement(model, cache); 1289 var swCacheTreeElement = this._cacheTreeElement(model, cache);
1290 if (!swCacheTreeElement) 1290 if (!swCacheTreeElement)
1291 return; 1291 return;
1292 1292
1293 swCacheTreeElement.clear(); 1293 swCacheTreeElement.clear();
1294 this.removeChild(swCacheTreeElement); 1294 this.removeChild(swCacheTreeElement);
1295 this._swCacheTreeElements.remove(swCacheTreeElement); 1295 this._swCacheTreeElements.remove(swCacheTreeElement);
1296 } 1296 }
1297 1297
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 refreshIndexedDB() { 1522 refreshIndexedDB() {
1523 var targets = SDK.targetManager.targets(SDK.Target.Capability.Browser); 1523 var targets = SDK.targetManager.targets(SDK.Target.Capability.Browser);
1524 for (var i = 0; i < targets.length; ++i) 1524 for (var i = 0; i < targets.length; ++i)
1525 Resources.IndexedDBModel.fromTarget(targets[i]).refreshDatabaseNames(); 1525 Resources.IndexedDBModel.fromTarget(targets[i]).refreshDatabaseNames();
1526 } 1526 }
1527 1527
1528 /** 1528 /**
1529 * @param {!Common.Event} event 1529 * @param {!Common.Event} event
1530 */ 1530 */
1531 _indexedDBAdded(event) { 1531 _indexedDBAdded(event) {
1532 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data); 1532 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data.databaseId);
1533 var model = /** @type {!Resources.IndexedDBModel} */ (event.target); 1533 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model);
1534 this._addIndexedDB(model, databaseId); 1534 this._addIndexedDB(model, databaseId);
1535 } 1535 }
1536 1536
1537 /** 1537 /**
1538 * @param {!Resources.IndexedDBModel} model 1538 * @param {!Resources.IndexedDBModel} model
1539 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId 1539 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId
1540 */ 1540 */
1541 _addIndexedDB(model, databaseId) { 1541 _addIndexedDB(model, databaseId) {
1542 var idbDatabaseTreeElement = new Resources.IDBDatabaseTreeElement(this._stor agePanel, model, databaseId); 1542 var idbDatabaseTreeElement = new Resources.IDBDatabaseTreeElement(this._stor agePanel, model, databaseId);
1543 this._idbDatabaseTreeElements.push(idbDatabaseTreeElement); 1543 this._idbDatabaseTreeElements.push(idbDatabaseTreeElement);
1544 this.appendChild(idbDatabaseTreeElement); 1544 this.appendChild(idbDatabaseTreeElement);
1545 model.refreshDatabase(databaseId); 1545 model.refreshDatabase(databaseId);
1546 } 1546 }
1547 1547
1548 /** 1548 /**
1549 * @param {!Common.Event} event 1549 * @param {!Common.Event} event
1550 */ 1550 */
1551 _indexedDBRemoved(event) { 1551 _indexedDBRemoved(event) {
1552 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data); 1552 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data.databaseId);
1553 var model = /** @type {!Resources.IndexedDBModel} */ (event.target); 1553 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model);
1554 1554
1555 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId) ; 1555 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId) ;
1556 if (!idbDatabaseTreeElement) 1556 if (!idbDatabaseTreeElement)
1557 return; 1557 return;
1558 1558
1559 idbDatabaseTreeElement.clear(); 1559 idbDatabaseTreeElement.clear();
1560 this.removeChild(idbDatabaseTreeElement); 1560 this.removeChild(idbDatabaseTreeElement);
1561 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement); 1561 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement);
1562 } 1562 }
1563 1563
1564 /** 1564 /**
1565 * @param {!Common.Event} event 1565 * @param {!Common.Event} event
1566 */ 1566 */
1567 _indexedDBLoaded(event) { 1567 _indexedDBLoaded(event) {
1568 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data ); 1568 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data .database);
1569 var model = /** @type {!Resources.IndexedDBModel} */ (event.target); 1569 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model);
1570 1570
1571 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da tabaseId); 1571 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da tabaseId);
1572 if (!idbDatabaseTreeElement) 1572 if (!idbDatabaseTreeElement)
1573 return; 1573 return;
1574 1574
1575 idbDatabaseTreeElement.update(database); 1575 idbDatabaseTreeElement.update(database);
1576 } 1576 }
1577 1577
1578 /** 1578 /**
1579 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId 1579 * @param {!Resources.IndexedDBModel.DatabaseId} databaseId
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 2050
2051 this.element.classList.add('storage-view'); 2051 this.element.classList.add('storage-view');
2052 this._emptyWidget = new UI.EmptyWidget(''); 2052 this._emptyWidget = new UI.EmptyWidget('');
2053 this._emptyWidget.show(this.element); 2053 this._emptyWidget.show(this.element);
2054 } 2054 }
2055 2055
2056 setText(text) { 2056 setText(text) {
2057 this._emptyWidget.text = text; 2057 this._emptyWidget.text = text;
2058 } 2058 }
2059 }; 2059 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698