OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeEle
ment(this, WebInspector.UIString("Session Storage"), "SessionStorage", ["domstor
age-storage-tree-item", "session-storage"]); | 60 this.sessionStorageListTreeElement = new WebInspector.StorageCategoryTreeEle
ment(this, WebInspector.UIString("Session Storage"), "SessionStorage", ["domstor
age-storage-tree-item", "session-storage"]); |
61 this._sidebarTree.appendChild(this.sessionStorageListTreeElement); | 61 this._sidebarTree.appendChild(this.sessionStorageListTreeElement); |
62 | 62 |
63 this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(thi
s, WebInspector.UIString("Cookies"), "Cookies", ["cookie-storage-tree-item"]); | 63 this.cookieListTreeElement = new WebInspector.StorageCategoryTreeElement(thi
s, WebInspector.UIString("Cookies"), "Cookies", ["cookie-storage-tree-item"]); |
64 this._sidebarTree.appendChild(this.cookieListTreeElement); | 64 this._sidebarTree.appendChild(this.cookieListTreeElement); |
65 | 65 |
66 this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeE
lement(this, WebInspector.UIString("Application Cache"), "ApplicationCache", ["a
pplication-cache-storage-tree-item"]); | 66 this.applicationCacheListTreeElement = new WebInspector.StorageCategoryTreeE
lement(this, WebInspector.UIString("Application Cache"), "ApplicationCache", ["a
pplication-cache-storage-tree-item"]); |
67 this._sidebarTree.appendChild(this.applicationCacheListTreeElement); | 67 this._sidebarTree.appendChild(this.applicationCacheListTreeElement); |
68 | 68 |
| 69 this.cacheStorageListTreeElement = new WebInspector.ServiceWorkerCacheTreeEl
ement(this); |
| 70 this._sidebarTree.appendChild(this.cacheStorageListTreeElement); |
| 71 |
69 if (Runtime.experiments.isEnabled("fileSystemInspection")) { | 72 if (Runtime.experiments.isEnabled("fileSystemInspection")) { |
70 this.fileSystemListTreeElement = new WebInspector.FileSystemListTreeElem
ent(this); | 73 this.fileSystemListTreeElement = new WebInspector.FileSystemListTreeElem
ent(this); |
71 this._sidebarTree.appendChild(this.fileSystemListTreeElement); | 74 this._sidebarTree.appendChild(this.fileSystemListTreeElement); |
72 } | 75 } |
73 | 76 |
74 var mainView = new WebInspector.VBox(); | 77 var mainView = new WebInspector.VBox(); |
75 this.storageViews = mainView.element.createChild("div", "vbox flex-auto"); | 78 this.storageViews = mainView.element.createChild("div", "vbox flex-auto"); |
76 this._storageViewToolbar = new WebInspector.Toolbar(mainView.element); | 79 this._storageViewToolbar = new WebInspector.Toolbar(mainView.element); |
77 this._storageViewToolbar.element.classList.add("resources-toolbar"); | 80 this._storageViewToolbar.element.classList.add("resources-toolbar"); |
78 this.splitView().setMainView(mainView); | 81 this.splitView().setMainView(mainView); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 /** | 118 /** |
116 * @override | 119 * @override |
117 * @param {!WebInspector.Target} target | 120 * @param {!WebInspector.Target} target |
118 */ | 121 */ |
119 targetAdded: function(target) | 122 targetAdded: function(target) |
120 { | 123 { |
121 if (this._target) | 124 if (this._target) |
122 return; | 125 return; |
123 this._target = target; | 126 this._target = target; |
124 | 127 |
125 if (target.isServiceWorker()) { | |
126 this.serviceWorkerCacheListTreeElement = new WebInspector.ServiceWor
kerCacheTreeElement(this); | |
127 this._sidebarTree.appendChild(this.serviceWorkerCacheListTreeElement
); | |
128 } | |
129 | |
130 if (target.serviceWorkerManager && Runtime.experiments.isEnabled("servic
eWorkersInResources")) { | 128 if (target.serviceWorkerManager && Runtime.experiments.isEnabled("servic
eWorkersInResources")) { |
131 this.serviceWorkersTreeElement = new WebInspector.ServiceWorkersTree
Element(this); | 129 this.serviceWorkersTreeElement = new WebInspector.ServiceWorkersTree
Element(this); |
132 this._sidebarTree.appendChild(this.serviceWorkersTreeElement); | 130 this._sidebarTree.appendChild(this.serviceWorkersTreeElement); |
133 } | 131 } |
134 | 132 |
135 this._databaseModel = WebInspector.DatabaseModel.fromTarget(target); | 133 this._databaseModel = WebInspector.DatabaseModel.fromTarget(target); |
136 this._domStorageModel = WebInspector.DOMStorageModel.fromTarget(target); | 134 this._domStorageModel = WebInspector.DOMStorageModel.fromTarget(target); |
137 | 135 |
138 if (target.resourceTreeModel.cachedResourcesLoaded()) | 136 if (target.resourceTreeModel.cachedResourcesLoaded()) |
139 this._initialize(); | 137 this._initialize(); |
(...skipping 20 matching lines...) Expand all Loading... |
160 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event
s.DatabaseAdded, this._databaseAdded, this); | 158 this._databaseModel.removeEventListener(WebInspector.DatabaseModel.Event
s.DatabaseAdded, this._databaseAdded, this); |
161 | 159 |
162 this._resetWithFrames(); | 160 this._resetWithFrames(); |
163 }, | 161 }, |
164 | 162 |
165 _initialize: function() | 163 _initialize: function() |
166 { | 164 { |
167 this._databaseModel.enable(); | 165 this._databaseModel.enable(); |
168 this._domStorageModel.enable(); | 166 this._domStorageModel.enable(); |
169 WebInspector.IndexedDBModel.fromTarget(this._target).enable(); | 167 WebInspector.IndexedDBModel.fromTarget(this._target).enable(); |
| 168 WebInspector.ServiceWorkerCacheModel.fromTarget(this._target).enable(); |
170 | 169 |
171 if (this._target.isPage()) | 170 if (this._target.isPage()) |
172 this._populateResourceTree(); | 171 this._populateResourceTree(); |
173 this._populateDOMStorageTree(); | 172 this._populateDOMStorageTree(); |
174 this._populateApplicationCacheTree(); | 173 this._populateApplicationCacheTree(); |
175 this.indexedDBListTreeElement._initialize(); | 174 this.indexedDBListTreeElement._initialize(); |
176 if (this.serviceWorkerCacheListTreeElement) | 175 this.cacheStorageListTreeElement._initialize(); |
177 this.serviceWorkerCacheListTreeElement._initialize(); | |
178 if (Runtime.experiments.isEnabled("fileSystemInspection")) | 176 if (Runtime.experiments.isEnabled("fileSystemInspection")) |
179 this.fileSystemListTreeElement._initialize(); | 177 this.fileSystemListTreeElement._initialize(); |
180 this._initDefaultSelection(); | 178 this._initDefaultSelection(); |
181 this._initialized = true; | 179 this._initialized = true; |
182 }, | 180 }, |
183 | 181 |
184 _loadEventFired: function() | 182 _loadEventFired: function() |
185 { | 183 { |
186 this._initDefaultSelection(); | 184 this._initDefaultSelection(); |
187 }, | 185 }, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 this._databaseQueryViews.clear(); | 224 this._databaseQueryViews.clear(); |
227 this._databaseTreeElements.clear(); | 225 this._databaseTreeElements.clear(); |
228 this._domStorageViews.clear(); | 226 this._domStorageViews.clear(); |
229 this._domStorageTreeElements.clear(); | 227 this._domStorageTreeElements.clear(); |
230 this._cookieViews = {}; | 228 this._cookieViews = {}; |
231 | 229 |
232 this.databasesListTreeElement.removeChildren(); | 230 this.databasesListTreeElement.removeChildren(); |
233 this.localStorageListTreeElement.removeChildren(); | 231 this.localStorageListTreeElement.removeChildren(); |
234 this.sessionStorageListTreeElement.removeChildren(); | 232 this.sessionStorageListTreeElement.removeChildren(); |
235 this.cookieListTreeElement.removeChildren(); | 233 this.cookieListTreeElement.removeChildren(); |
236 if (this.serviceWorkerCacheListTreeElement) | 234 this.cacheStorageListTreeElement.removeChildren(); |
237 this.serviceWorkerCacheListTreeElement.removeChildren(); | |
238 | 235 |
239 if (this.visibleView && !(this.visibleView instanceof WebInspector.Stora
geCategoryView)) | 236 if (this.visibleView && !(this.visibleView instanceof WebInspector.Stora
geCategoryView)) |
240 this.visibleView.detach(); | 237 this.visibleView.detach(); |
241 | 238 |
242 this._storageViewToolbar.removeToolbarItems(); | 239 this._storageViewToolbar.removeToolbarItems(); |
243 | 240 |
244 if (this._sidebarTree.selectedTreeElement) | 241 if (this._sidebarTree.selectedTreeElement) |
245 this._sidebarTree.selectedTreeElement.deselect(); | 242 this._sidebarTree.selectedTreeElement.deselect(); |
246 }, | 243 }, |
247 | 244 |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 }, | 1411 }, |
1415 | 1412 |
1416 __proto__: WebInspector.BaseStorageTreeElement.prototype | 1413 __proto__: WebInspector.BaseStorageTreeElement.prototype |
1417 } | 1414 } |
1418 | 1415 |
1419 | 1416 |
1420 /** | 1417 /** |
1421 * @constructor | 1418 * @constructor |
1422 * @extends {WebInspector.StorageCategoryTreeElement} | 1419 * @extends {WebInspector.StorageCategoryTreeElement} |
1423 * @param {!WebInspector.ResourcesPanel} storagePanel | 1420 * @param {!WebInspector.ResourcesPanel} storagePanel |
1424 * @implements {WebInspector.TargetManager.Observer} | |
1425 */ | 1421 */ |
1426 WebInspector.ServiceWorkerCacheTreeElement = function(storagePanel) | 1422 WebInspector.ServiceWorkerCacheTreeElement = function(storagePanel) |
1427 { | 1423 { |
1428 WebInspector.StorageCategoryTreeElement.call(this, storagePanel, WebInspecto
r.UIString("Service Worker Cache"), "ServiceWorkerCache", ["service-worker-cache
-storage-tree-item"]); | 1424 WebInspector.StorageCategoryTreeElement.call(this, storagePanel, WebInspecto
r.UIString("Cache Storage"), "CacheStorage", ["service-worker-cache-storage-tree
-item"]); |
1429 } | 1425 } |
1430 | 1426 |
1431 WebInspector.ServiceWorkerCacheTreeElement.prototype = { | 1427 WebInspector.ServiceWorkerCacheTreeElement.prototype = { |
1432 _initialize: function() | 1428 _initialize: function() |
1433 { | 1429 { |
1434 /** @type {!Array.<!WebInspector.SWCacheTreeElement>} */ | 1430 /** @type {!Array.<!WebInspector.SWCacheTreeElement>} */ |
1435 this._swCacheTreeElements = []; | 1431 this._swCacheTreeElements = []; |
1436 var targets = WebInspector.targetManager.targets(); | 1432 var target = this._storagePanel._target; |
1437 for (var i = 0; i < targets.length; ++i) { | 1433 if (target) { |
1438 if (!targets[i].serviceWorkerCacheModel) | 1434 var model = WebInspector.ServiceWorkerCacheModel.fromTarget(target); |
1439 continue; | 1435 var caches = model.caches(); |
1440 var caches = targets[i].serviceWorkerCacheModel.caches(); | 1436 for (var cache of caches) |
1441 for (var j = 0; j < caches.length; ++j) | 1437 this._addCache(model, cache); |
1442 this._addCache(targets[i].serviceWorkerCacheModel, caches[j]); | |
1443 } | 1438 } |
1444 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa
cheModel, WebInspector.ServiceWorkerCacheModel.EventTypes.CacheAdded, this._cach
eAdded, this); | 1439 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa
cheModel, WebInspector.ServiceWorkerCacheModel.EventTypes.CacheAdded, this._cach
eAdded, this); |
1445 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa
cheModel, WebInspector.ServiceWorkerCacheModel.EventTypes.CacheRemoved, this._ca
cheRemoved, this); | 1440 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa
cheModel, WebInspector.ServiceWorkerCacheModel.EventTypes.CacheRemoved, this._ca
cheRemoved, this); |
1446 this._refreshCaches(); | |
1447 WebInspector.targetManager.observeTargets(this); | |
1448 }, | 1441 }, |
1449 | 1442 |
1450 onattach: function() | 1443 onattach: function() |
1451 { | 1444 { |
1452 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this); | 1445 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this); |
1453 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), true); | 1446 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), true); |
1454 }, | 1447 }, |
1455 | 1448 |
1456 /** | |
1457 * @override | |
1458 * @param {!WebInspector.Target} target | |
1459 */ | |
1460 targetAdded: function(target) | |
1461 { | |
1462 if (target.isServiceWorker() && target.serviceWorkerCacheModel) | |
1463 this._refreshCaches(); | |
1464 }, | |
1465 | |
1466 /** | |
1467 * @override | |
1468 * @param {!WebInspector.Target} target | |
1469 */ | |
1470 targetRemoved: function(target) {}, | |
1471 | |
1472 _handleContextMenuEvent: function(event) | 1449 _handleContextMenuEvent: function(event) |
1473 { | 1450 { |
1474 var contextMenu = new WebInspector.ContextMenu(event); | 1451 var contextMenu = new WebInspector.ContextMenu(event); |
1475 contextMenu.appendItem(WebInspector.UIString("Refresh Caches"), this._re
freshCaches.bind(this)); | 1452 contextMenu.appendItem(WebInspector.UIString("Refresh Caches"), this._re
freshCaches.bind(this)); |
1476 contextMenu.show(); | 1453 contextMenu.show(); |
1477 }, | 1454 }, |
1478 | 1455 |
1479 _refreshCaches: function() | 1456 _refreshCaches: function() |
1480 { | 1457 { |
1481 var targets = WebInspector.targetManager.targets(); | 1458 var target = this._storagePanel._target; |
1482 for (var i = 0; i < targets.length; ++i) { | 1459 if (target) { |
1483 if (targets[i].serviceWorkerCacheModel) | 1460 var model = WebInspector.ServiceWorkerCacheModel.fromTarget(target); |
1484 targets[i].serviceWorkerCacheModel.refreshCacheNames(); | 1461 model.refreshCacheNames(); |
1485 } | 1462 } |
1486 }, | 1463 }, |
1487 | 1464 |
1488 /** | 1465 /** |
1489 * @param {!WebInspector.Event} event | 1466 * @param {!WebInspector.Event} event |
1490 */ | 1467 */ |
1491 _cacheAdded: function(event) | 1468 _cacheAdded: function(event) |
1492 { | 1469 { |
1493 var cacheId = /** @type {!WebInspector.ServiceWorkerCacheModel.CacheId}
*/ (event.data); | 1470 var cache = /** @type {!WebInspector.ServiceWorkerCacheModel.Cache} */ (
event.data); |
1494 var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.
target); | 1471 var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.
target); |
1495 this._addCache(model, cacheId); | 1472 this._addCache(model, cache); |
1496 }, | 1473 }, |
1497 | 1474 |
1498 /** | 1475 /** |
1499 * @param {!WebInspector.ServiceWorkerCacheModel} model | 1476 * @param {!WebInspector.ServiceWorkerCacheModel} model |
1500 * @param {!WebInspector.ServiceWorkerCacheModel.CacheId} cacheId | 1477 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache |
1501 */ | 1478 */ |
1502 _addCache: function(model, cacheId) | 1479 _addCache: function(model, cache) |
1503 { | 1480 { |
1504 var swCacheTreeElement = new WebInspector.SWCacheTreeElement(this._stora
gePanel, model, cacheId); | 1481 var swCacheTreeElement = new WebInspector.SWCacheTreeElement(this._stora
gePanel, model, cache); |
1505 this._swCacheTreeElements.push(swCacheTreeElement); | 1482 this._swCacheTreeElements.push(swCacheTreeElement); |
1506 this.appendChild(swCacheTreeElement); | 1483 this.appendChild(swCacheTreeElement); |
1507 }, | 1484 }, |
1508 | 1485 |
1509 /** | 1486 /** |
1510 * @param {!WebInspector.Event} event | 1487 * @param {!WebInspector.Event} event |
1511 */ | 1488 */ |
1512 _cacheRemoved: function(event) | 1489 _cacheRemoved: function(event) |
1513 { | 1490 { |
1514 var cacheId = /** @type {!WebInspector.ServiceWorkerCacheModel.CacheId}
*/ (event.data); | 1491 var cache = /** @type {!WebInspector.ServiceWorkerCacheModel.Cache} */ (
event.data); |
1515 var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.
target); | 1492 var model = /** @type {!WebInspector.ServiceWorkerCacheModel} */ (event.
target); |
1516 | 1493 |
1517 var swCacheTreeElement = this._cacheTreeElement(model, cacheId); | 1494 var swCacheTreeElement = this._cacheTreeElement(model, cache); |
1518 if (!swCacheTreeElement) | 1495 if (!swCacheTreeElement) |
1519 return; | 1496 return; |
1520 | 1497 |
1521 swCacheTreeElement.clear(); | 1498 swCacheTreeElement.clear(); |
1522 this.removeChild(swCacheTreeElement); | 1499 this.removeChild(swCacheTreeElement); |
1523 this._swCacheTreeElements.remove(swCacheTreeElement); | 1500 this._swCacheTreeElements.remove(swCacheTreeElement); |
1524 }, | 1501 }, |
1525 | 1502 |
1526 /** | 1503 /** |
1527 * @param {!WebInspector.ServiceWorkerCacheModel} model | 1504 * @param {!WebInspector.ServiceWorkerCacheModel} model |
1528 * @param {!WebInspector.ServiceWorkerCacheModel.CacheId} cacheId | 1505 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache |
1529 * @return {?WebInspector.SWCacheTreeElement} | 1506 * @return {?WebInspector.SWCacheTreeElement} |
1530 */ | 1507 */ |
1531 _cacheTreeElement: function(model, cacheId) | 1508 _cacheTreeElement: function(model, cache) |
1532 { | 1509 { |
1533 var index = -1; | 1510 var index = -1; |
1534 for (var i = 0; i < this._swCacheTreeElements.length; ++i) { | 1511 for (var i = 0; i < this._swCacheTreeElements.length; ++i) { |
1535 if (this._swCacheTreeElements[i]._cacheId.equals(cacheId) && this._s
wCacheTreeElements[i]._model === model) { | 1512 if (this._swCacheTreeElements[i]._cache.equals(cache) && this._swCac
heTreeElements[i]._model === model) { |
1536 index = i; | 1513 index = i; |
1537 break; | 1514 break; |
1538 } | 1515 } |
1539 } | 1516 } |
1540 if (index !== -1) | 1517 if (index !== -1) |
1541 return this._swCacheTreeElements[i]; | 1518 return this._swCacheTreeElements[i]; |
1542 return null; | 1519 return null; |
1543 }, | 1520 }, |
1544 | 1521 |
1545 __proto__: WebInspector.StorageCategoryTreeElement.prototype | 1522 __proto__: WebInspector.StorageCategoryTreeElement.prototype |
1546 } | 1523 } |
1547 | 1524 |
1548 /** | 1525 /** |
1549 * @constructor | 1526 * @constructor |
1550 * @extends {WebInspector.BaseStorageTreeElement} | 1527 * @extends {WebInspector.BaseStorageTreeElement} |
1551 * @param {!WebInspector.ResourcesPanel} storagePanel | 1528 * @param {!WebInspector.ResourcesPanel} storagePanel |
1552 * @param {!WebInspector.ServiceWorkerCacheModel} model | 1529 * @param {!WebInspector.ServiceWorkerCacheModel} model |
1553 * @param {!WebInspector.ServiceWorkerCacheModel.CacheId} cacheId | 1530 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache |
1554 */ | 1531 */ |
1555 WebInspector.SWCacheTreeElement = function(storagePanel, model, cacheId) | 1532 WebInspector.SWCacheTreeElement = function(storagePanel, model, cache) |
1556 { | 1533 { |
1557 WebInspector.BaseStorageTreeElement.call(this, storagePanel, cacheId.name, [
"service-worker-cache-tree-item"]); | 1534 WebInspector.BaseStorageTreeElement.call(this, storagePanel, cache.cacheName
+ " - " + cache.securityOrigin, ["service-worker-cache-tree-item"]); |
1558 this._model = model; | 1535 this._model = model; |
1559 this._cacheId = cacheId; | 1536 this._cache = cache; |
1560 } | 1537 } |
1561 | 1538 |
1562 WebInspector.SWCacheTreeElement.prototype = { | 1539 WebInspector.SWCacheTreeElement.prototype = { |
1563 get itemURL() | 1540 get itemURL() |
1564 { | 1541 { |
1565 // I don't think this will work at all. | 1542 // I don't think this will work at all. |
1566 return "swcache://" + this._cacheId.name; | 1543 return "cache://" + this._cache.cacheId; |
1567 }, | 1544 }, |
1568 | 1545 |
1569 onattach: function() | 1546 onattach: function() |
1570 { | 1547 { |
1571 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); | 1548 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); |
1572 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), true); | 1549 this.listItemElement.addEventListener("contextmenu", this._handleContext
MenuEvent.bind(this), true); |
1573 }, | 1550 }, |
1574 | 1551 |
1575 _handleContextMenuEvent: function(event) | 1552 _handleContextMenuEvent: function(event) |
1576 { | 1553 { |
1577 var contextMenu = new WebInspector.ContextMenu(event); | 1554 var contextMenu = new WebInspector.ContextMenu(event); |
1578 contextMenu.appendItem(WebInspector.UIString("Delete"), this._clearCache
.bind(this)); | 1555 contextMenu.appendItem(WebInspector.UIString("Delete"), this._clearCache
.bind(this)); |
1579 contextMenu.show(); | 1556 contextMenu.show(); |
1580 }, | 1557 }, |
1581 | 1558 |
1582 _clearCache: function() | 1559 _clearCache: function() |
1583 { | 1560 { |
1584 this._model.deleteCache(this._cacheId); | 1561 this._model.deleteCache(this._cache); |
1585 }, | 1562 }, |
1586 | 1563 |
1587 /** | 1564 /** |
1588 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache | 1565 * @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache |
1589 */ | 1566 */ |
1590 update: function(cache) | 1567 update: function(cache) |
1591 { | 1568 { |
1592 this._cache = cache; | 1569 this._cache = cache; |
1593 if (this._view) | 1570 if (this._view) |
1594 this._view.update(cache); | 1571 this._view.update(cache); |
1595 }, | 1572 }, |
1596 | 1573 |
1597 /** | 1574 /** |
1598 * @override | 1575 * @override |
1599 * @return {boolean} | 1576 * @return {boolean} |
1600 */ | 1577 */ |
1601 onselect: function(selectedByUser) | 1578 onselect: function(selectedByUser) |
1602 { | 1579 { |
1603 WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, select
edByUser); | 1580 WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, select
edByUser); |
1604 if (!this._view) | 1581 if (!this._view) |
1605 this._view = new WebInspector.ServiceWorkerCacheView(this._model, th
is._cacheId, this._cache); | 1582 this._view = new WebInspector.ServiceWorkerCacheView(this._model, th
is._cache); |
1606 | 1583 |
1607 this._storagePanel.showServiceWorkerCache(this._view); | 1584 this._storagePanel.showServiceWorkerCache(this._view); |
1608 return false; | 1585 return false; |
1609 }, | 1586 }, |
1610 | 1587 |
1611 clear: function() | 1588 clear: function() |
1612 { | 1589 { |
1613 if (this._view) | 1590 if (this._view) |
1614 this._view.clear(); | 1591 this._view.clear(); |
1615 }, | 1592 }, |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 WebInspector.ResourcesPanelFactory.prototype = { | 2408 WebInspector.ResourcesPanelFactory.prototype = { |
2432 /** | 2409 /** |
2433 * @override | 2410 * @override |
2434 * @return {!WebInspector.Panel} | 2411 * @return {!WebInspector.Panel} |
2435 */ | 2412 */ |
2436 createPanel: function() | 2413 createPanel: function() |
2437 { | 2414 { |
2438 return WebInspector.ResourcesPanel._instance(); | 2415 return WebInspector.ResourcesPanel._instance(); |
2439 } | 2416 } |
2440 } | 2417 } |
OLD | NEW |