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

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

Issue 2914293002: [IndexedDB] [DevTools] Right-click 'Refresh' on database now updates object store view, also fixed … (Closed)
Patch Set: Better handling of null database in view, removed extra lines in test file, moved utility test func… Created 3 years, 6 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 /* 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 } 1079 }
1080 1080
1081 _handleContextMenuEvent(event) { 1081 _handleContextMenuEvent(event) {
1082 var contextMenu = new UI.ContextMenu(event); 1082 var contextMenu = new UI.ContextMenu(event);
1083 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this.refreshInd exedDB.bind(this)); 1083 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this.refreshInd exedDB.bind(this));
1084 contextMenu.show(); 1084 contextMenu.show();
1085 } 1085 }
1086 1086
1087 refreshIndexedDB() { 1087 refreshIndexedDB() {
1088 for (var indexedDBModel of SDK.targetManager.models(Resources.IndexedDBModel )) 1088 for (var indexedDBModel of SDK.targetManager.models(Resources.IndexedDBModel ))
1089 indexedDBModel.refreshDatabaseNames(); 1089 indexedDBModel.refreshDatabaseNames(); // Adds IDBDatabaseTreeElements.
dgozman 2017/06/02 21:48:41 I think we should not rely on this face. After all
kristipark 2017/06/03 01:42:44 Unfortunately unless refreshDatabaseNames is calle
1090 for (var i = 0; i < this._idbDatabaseTreeElements.length; ++i)
1091 this._idbDatabaseTreeElements[i]._refreshIndexedDB();
1090 } 1092 }
1091 1093
1092 /** 1094 /**
1093 * @param {!Common.Event} event 1095 * @param {!Common.Event} event
1094 */ 1096 */
1095 _indexedDBAdded(event) { 1097 _indexedDBAdded(event) {
1096 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data.databaseId); 1098 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data.databaseId);
1097 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); 1099 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model);
1098 this._addIndexedDB(model, databaseId); 1100 this._addIndexedDB(model, databaseId);
1099 } 1101 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu Event.bind(this), true); 1192 this.listItemElement.addEventListener('contextmenu', this._handleContextMenu Event.bind(this), true);
1191 } 1193 }
1192 1194
1193 _handleContextMenuEvent(event) { 1195 _handleContextMenuEvent(event) {
1194 var contextMenu = new UI.ContextMenu(event); 1196 var contextMenu = new UI.ContextMenu(event);
1195 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn dexedDB.bind(this)); 1197 contextMenu.appendItem(Common.UIString('Refresh IndexedDB'), this._refreshIn dexedDB.bind(this));
1196 contextMenu.show(); 1198 contextMenu.show();
1197 } 1199 }
1198 1200
1199 _refreshIndexedDB() { 1201 _refreshIndexedDB() {
1200 this._model.refreshDatabaseNames(); 1202 this._model.refreshDatabase(this._databaseId);
1201 } 1203 }
1202 1204
1203 /** 1205 /**
1204 * @param {!Resources.IndexedDBModel.Database} database 1206 * @param {!Resources.IndexedDBModel.Database} database
1205 */ 1207 */
1206 update(database) { 1208 update(database) {
1207 this._database = database; 1209 this._database = database;
1208 var objectStoreNames = {}; 1210 var objectStoreNames = {};
1209 for (var objectStoreName in this._database.objectStores) { 1211 for (var objectStoreName in this._database.objectStores) {
1210 var objectStore = this._database.objectStores[objectStoreName]; 1212 var objectStore = this._database.objectStores[objectStoreName];
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 1643
1642 this.element.classList.add('storage-view'); 1644 this.element.classList.add('storage-view');
1643 this._emptyWidget = new UI.EmptyWidget(''); 1645 this._emptyWidget = new UI.EmptyWidget('');
1644 this._emptyWidget.show(this.element); 1646 this._emptyWidget.show(this.element);
1645 } 1647 }
1646 1648
1647 setText(text) { 1649 setText(text) {
1648 this._emptyWidget.text = text; 1650 this._emptyWidget.text = text;
1649 } 1651 }
1650 }; 1652 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698