Index: Source/devtools/front_end/DOMStorage.js |
diff --git a/Source/devtools/front_end/DOMStorage.js b/Source/devtools/front_end/DOMStorage.js |
index fc68b6a307f0b46e20e25cd16d21d191fc5e985a..6cc203b922206f47442f561b80638f302ff6845a 100644 |
--- a/Source/devtools/front_end/DOMStorage.js |
+++ b/Source/devtools/front_end/DOMStorage.js |
@@ -29,6 +29,7 @@ |
/** |
* @constructor |
+ * @extends {WebInspector.Object} |
* @param {string} securityOrigin |
* @param {boolean} isLocalStorage |
*/ |
@@ -49,6 +50,13 @@ WebInspector.DOMStorage.storageId = function(securityOrigin, isLocalStorage) |
return { securityOrigin: securityOrigin, isLocalStorage: isLocalStorage }; |
} |
+WebInspector.DOMStorage.Events = { |
+ DOMStorageItemsCleared: "DOMStorageItemsCleared", |
+ DOMStorageItemRemoved: "DOMStorageItemRemoved", |
+ DOMStorageItemAdded: "DOMStorageItemAdded", |
+ DOMStorageItemUpdated: "DOMStorageItemUpdated" |
+} |
+ |
WebInspector.DOMStorage.prototype = { |
/** @return {DOMStorageAgent.StorageId} */ |
@@ -102,7 +110,9 @@ WebInspector.DOMStorage.prototype = { |
redo: function() |
{ |
this._storageHistory.redo(); |
- } |
+ }, |
+ |
+ __proto__: WebInspector.Object.prototype |
} |
/** |
@@ -325,11 +335,7 @@ WebInspector.DOMStorageModel = function() |
WebInspector.DOMStorageModel.Events = { |
DOMStorageAdded: "DOMStorageAdded", |
- DOMStorageRemoved: "DOMStorageRemoved", |
- DOMStorageItemsCleared: "DOMStorageItemsCleared", |
- DOMStorageItemRemoved: "DOMStorageItemRemoved", |
- DOMStorageItemAdded: "DOMStorageItemAdded", |
- DOMStorageItemUpdated: "DOMStorageItemUpdated" |
+ DOMStorageRemoved: "DOMStorageRemoved" |
} |
WebInspector.DOMStorageModel.prototype = { |
@@ -388,10 +394,11 @@ WebInspector.DOMStorageModel.prototype = { |
_domStorageItemsCleared: function(storageId) |
{ |
var domStorage = this.storageForId(storageId); |
- var storageData = { |
- storage: domStorage |
- }; |
- this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageItemsCleared, storageData); |
+ if (!domStorage) |
+ return; |
+ |
+ var eventData = {}; |
+ domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemsCleared, eventData); |
}, |
/** |
@@ -401,45 +408,42 @@ WebInspector.DOMStorageModel.prototype = { |
_domStorageItemRemoved: function(storageId, key) |
{ |
var domStorage = this.storageForId(storageId); |
- var storageData = { |
- storage: domStorage, |
- key: key |
- }; |
- this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageItemRemoved, storageData); |
+ if (!domStorage) |
+ return; |
+ |
+ var eventData = { key: key }; |
+ domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemRemoved, eventData); |
}, |
/** |
* @param {DOMStorageAgent.StorageId} storageId |
* @param {string} key |
- * @param {string} newValue |
+ * @param {string} value |
*/ |
- _domStorageItemAdded: function(storageId, key, newValue) |
+ _domStorageItemAdded: function(storageId, key, value) |
{ |
var domStorage = this.storageForId(storageId); |
- var storageData = { |
- storage: domStorage, |
- key: key, |
- newValue: newValue |
- }; |
- this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageItemAdded, storageData); |
+ if (!domStorage) |
+ return; |
+ |
+ var eventData = { key: key, value: value }; |
+ domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemAdded, eventData); |
}, |
/** |
* @param {DOMStorageAgent.StorageId} storageId |
* @param {string} key |
* @param {string} oldValue |
- * @param {string} newValue |
+ * @param {string} value |
*/ |
- _domStorageItemUpdated: function(storageId, key, oldValue, newValue) |
+ _domStorageItemUpdated: function(storageId, key, oldValue, value) |
{ |
var domStorage = this.storageForId(storageId); |
- var storageData = { |
- storage: domStorage, |
- key: key, |
- oldValue: oldValue, |
- newValue: newValue |
- }; |
- this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageItemUpdated, storageData); |
+ if (!domStorage) |
+ return; |
+ |
+ var eventData = { key: key, oldValue: oldValue, value: value }; |
+ domStorage.dispatchEventToListeners(WebInspector.DOMStorage.Events.DOMStorageItemUpdated, eventData); |
}, |
/** |
@@ -497,22 +501,22 @@ WebInspector.DOMStorageDispatcher.prototype = { |
/** |
* @param {DOMStorageAgent.StorageId} storageId |
* @param {string} key |
- * @param {string} newValue |
+ * @param {string} value |
*/ |
- domStorageItemAdded: function(storageId, key, newValue) |
+ domStorageItemAdded: function(storageId, key, value) |
{ |
- this._model._domStorageItemAdded(storageId, key, newValue); |
+ this._model._domStorageItemAdded(storageId, key, value); |
}, |
/** |
* @param {DOMStorageAgent.StorageId} storageId |
* @param {string} key |
* @param {string} oldValue |
- * @param {string} newValue |
+ * @param {string} value |
*/ |
- domStorageItemUpdated: function(storageId, key, oldValue, newValue) |
+ domStorageItemUpdated: function(storageId, key, oldValue, value) |
{ |
- this._model._domStorageItemUpdated(storageId, key, oldValue, newValue); |
+ this._model._domStorageItemUpdated(storageId, key, oldValue, value); |
}, |
} |