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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.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 /* 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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 /** 1057 /**
1058 * @param {string} url 1058 * @param {string} url
1059 * @return {?WebInspector.Resource} 1059 * @return {?WebInspector.Resource}
1060 */ 1060 */
1061 resourceByURL: function(url) 1061 resourceByURL: function(url)
1062 { 1062 {
1063 var treeElement = this._treeElementForResource[url]; 1063 var treeElement = this._treeElementForResource[url];
1064 return treeElement ? treeElement._resource : null; 1064 return treeElement ? treeElement._resource : null;
1065 }, 1065 },
1066 1066
1067 /**
1068 * @override
1069 */
1067 appendChild: function(treeElement) 1070 appendChild: function(treeElement)
1068 { 1071 {
1069 this._insertInPresentationOrder(this, treeElement); 1072 this._insertInPresentationOrder(this, treeElement);
1070 }, 1073 },
1071 1074
1072 _insertInPresentationOrder: function(parentTreeElement, childTreeElement) 1075 _insertInPresentationOrder: function(parentTreeElement, childTreeElement)
1073 { 1076 {
1074 // Insert in the alphabetical order, first frames, then resources. Docum ent resource goes last. 1077 // Insert in the alphabetical order, first frames, then resources. Docum ent resource goes last.
1075 function typeWeight(treeElement) 1078 function typeWeight(treeElement)
1076 { 1079 {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 var target = this._storagePanel._target; 1307 var target = this._storagePanel._target;
1305 var model = target && WebInspector.ServiceWorkerCacheModel.fromTarget(ta rget); 1308 var model = target && WebInspector.ServiceWorkerCacheModel.fromTarget(ta rget);
1306 if (model) { 1309 if (model) {
1307 for (var cache of model.caches()) 1310 for (var cache of model.caches())
1308 this._addCache(model, cache); 1311 this._addCache(model, cache);
1309 } 1312 }
1310 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa cheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheAdded, this._cacheAdd ed, this); 1313 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa cheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheAdded, this._cacheAdd ed, this);
1311 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa cheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheRemoved, this._cacheR emoved, this); 1314 WebInspector.targetManager.addModelListener(WebInspector.ServiceWorkerCa cheModel, WebInspector.ServiceWorkerCacheModel.Events.CacheRemoved, this._cacheR emoved, this);
1312 }, 1315 },
1313 1316
1317 /**
1318 * @override
1319 */
1314 onattach: function() 1320 onattach: function()
1315 { 1321 {
1316 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this); 1322 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this);
1317 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 1323 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
1318 }, 1324 },
1319 1325
1320 _handleContextMenuEvent: function(event) 1326 _handleContextMenuEvent: function(event)
1321 { 1327 {
1322 var contextMenu = new WebInspector.ContextMenu(event); 1328 var contextMenu = new WebInspector.ContextMenu(event);
1323 contextMenu.appendItem(WebInspector.UIString("Refresh Caches"), this._re freshCaches.bind(this)); 1329 contextMenu.appendItem(WebInspector.UIString("Refresh Caches"), this._re freshCaches.bind(this));
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 this._cache = cache; 1415 this._cache = cache;
1410 }; 1416 };
1411 1417
1412 WebInspector.SWCacheTreeElement.prototype = { 1418 WebInspector.SWCacheTreeElement.prototype = {
1413 get itemURL() 1419 get itemURL()
1414 { 1420 {
1415 // I don't think this will work at all. 1421 // I don't think this will work at all.
1416 return "cache://" + this._cache.cacheId; 1422 return "cache://" + this._cache.cacheId;
1417 }, 1423 },
1418 1424
1425 /**
1426 * @override
1427 */
1419 onattach: function() 1428 onattach: function()
1420 { 1429 {
1421 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); 1430 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
1422 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 1431 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
1423 }, 1432 },
1424 1433
1425 _handleContextMenuEvent: function(event) 1434 _handleContextMenuEvent: function(event)
1426 { 1435 {
1427 var contextMenu = new WebInspector.ContextMenu(event); 1436 var contextMenu = new WebInspector.ContextMenu(event);
1428 contextMenu.appendItem(WebInspector.UIString("Delete"), this._clearCache .bind(this)); 1437 contextMenu.appendItem(WebInspector.UIString("Delete"), this._clearCache .bind(this));
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1603
1595 var targets = WebInspector.targetManager.targets(WebInspector.Target.Cap ability.Browser); 1604 var targets = WebInspector.targetManager.targets(WebInspector.Target.Cap ability.Browser);
1596 for (var i = 0; i < targets.length; ++i) { 1605 for (var i = 0; i < targets.length; ++i) {
1597 var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(targets[ i]); 1606 var indexedDBModel = WebInspector.IndexedDBModel.fromTarget(targets[ i]);
1598 var databases = indexedDBModel.databases(); 1607 var databases = indexedDBModel.databases();
1599 for (var j = 0; j < databases.length; ++j) 1608 for (var j = 0; j < databases.length; ++j)
1600 this._addIndexedDB(indexedDBModel, databases[j]); 1609 this._addIndexedDB(indexedDBModel, databases[j]);
1601 } 1610 }
1602 }, 1611 },
1603 1612
1613 /**
1614 * @override
1615 */
1604 onattach: function() 1616 onattach: function()
1605 { 1617 {
1606 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this); 1618 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this);
1607 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 1619 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
1608 }, 1620 },
1609 1621
1610 _handleContextMenuEvent: function(event) 1622 _handleContextMenuEvent: function(event)
1611 { 1623 {
1612 var contextMenu = new WebInspector.ContextMenu(event); 1624 var contextMenu = new WebInspector.ContextMenu(event);
1613 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this. refreshIndexedDB.bind(this)); 1625 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this. refreshIndexedDB.bind(this));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 this._databaseId = databaseId; 1723 this._databaseId = databaseId;
1712 this._idbObjectStoreTreeElements = {}; 1724 this._idbObjectStoreTreeElements = {};
1713 }; 1725 };
1714 1726
1715 WebInspector.IDBDatabaseTreeElement.prototype = { 1727 WebInspector.IDBDatabaseTreeElement.prototype = {
1716 get itemURL() 1728 get itemURL()
1717 { 1729 {
1718 return "indexedDB://" + this._databaseId.securityOrigin + "/" + this._da tabaseId.name; 1730 return "indexedDB://" + this._databaseId.securityOrigin + "/" + this._da tabaseId.name;
1719 }, 1731 },
1720 1732
1733 /**
1734 * @override
1735 */
1721 onattach: function() 1736 onattach: function()
1722 { 1737 {
1723 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); 1738 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
1724 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 1739 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
1725 }, 1740 },
1726 1741
1727 _handleContextMenuEvent: function(event) 1742 _handleContextMenuEvent: function(event)
1728 { 1743 {
1729 var contextMenu = new WebInspector.ContextMenu(event); 1744 var contextMenu = new WebInspector.ContextMenu(event);
1730 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this. _refreshIndexedDB.bind(this)); 1745 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this. _refreshIndexedDB.bind(this));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 this._databaseId = databaseId; 1833 this._databaseId = databaseId;
1819 this._idbIndexTreeElements = {}; 1834 this._idbIndexTreeElements = {};
1820 }; 1835 };
1821 1836
1822 WebInspector.IDBObjectStoreTreeElement.prototype = { 1837 WebInspector.IDBObjectStoreTreeElement.prototype = {
1823 get itemURL() 1838 get itemURL()
1824 { 1839 {
1825 return "indexedDB://" + this._databaseId.securityOrigin + "/" + this._da tabaseId.name + "/" + this._objectStore.name; 1840 return "indexedDB://" + this._databaseId.securityOrigin + "/" + this._da tabaseId.name + "/" + this._objectStore.name;
1826 }, 1841 },
1827 1842
1843 /**
1844 * @override
1845 */
1828 onattach: function() 1846 onattach: function()
1829 { 1847 {
1830 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); 1848 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
1831 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 1849 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
1832 }, 1850 },
1833 1851
1834 _handleContextMenuEvent: function(event) 1852 _handleContextMenuEvent: function(event)
1835 { 1853 {
1836 var contextMenu = new WebInspector.ContextMenu(event); 1854 var contextMenu = new WebInspector.ContextMenu(event);
1837 contextMenu.appendItem(WebInspector.UIString("Clear"), this._clearObject Store.bind(this)); 1855 contextMenu.appendItem(WebInspector.UIString("Clear"), this._clearObject Store.bind(this));
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 WebInspector.BaseStorageTreeElement.call(this, storagePanel, cookieDomain ? cookieDomain : WebInspector.UIString("Local Files"), ["cookie-tree-item", "resou rce-tree-item"]); 2062 WebInspector.BaseStorageTreeElement.call(this, storagePanel, cookieDomain ? cookieDomain : WebInspector.UIString("Local Files"), ["cookie-tree-item", "resou rce-tree-item"]);
2045 this._cookieDomain = cookieDomain; 2063 this._cookieDomain = cookieDomain;
2046 }; 2064 };
2047 2065
2048 WebInspector.CookieTreeElement.prototype = { 2066 WebInspector.CookieTreeElement.prototype = {
2049 get itemURL() 2067 get itemURL()
2050 { 2068 {
2051 return "cookies://" + this._cookieDomain; 2069 return "cookies://" + this._cookieDomain;
2052 }, 2070 },
2053 2071
2072 /**
2073 * @override
2074 */
2054 onattach: function() 2075 onattach: function()
2055 { 2076 {
2056 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); 2077 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
2057 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true); 2078 this.listItemElement.addEventListener("contextmenu", this._handleContext MenuEvent.bind(this), true);
2058 }, 2079 },
2059 2080
2060 /** 2081 /**
2061 * @param {!Event} event 2082 * @param {!Event} event
2062 */ 2083 */
2063 _handleContextMenuEvent: function(event) 2084 _handleContextMenuEvent: function(event)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 __proto__: WebInspector.VBox.prototype 2226 __proto__: WebInspector.VBox.prototype
2206 }; 2227 };
2207 2228
2208 /** 2229 /**
2209 * @return {!WebInspector.ResourcesPanel} 2230 * @return {!WebInspector.ResourcesPanel}
2210 */ 2231 */
2211 WebInspector.ResourcesPanel._instance = function() 2232 WebInspector.ResourcesPanel._instance = function()
2212 { 2233 {
2213 return /** @type {!WebInspector.ResourcesPanel} */ (self.runtime.sharedInsta nce(WebInspector.ResourcesPanel)); 2234 return /** @type {!WebInspector.ResourcesPanel} */ (self.runtime.sharedInsta nce(WebInspector.ResourcesPanel));
2214 }; 2235 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698