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

Side by Side Diff: Source/devtools/front_end/DOMStorage.js

Issue 22396002: function storageForId() should be used in _domStorageItemUpdated instead of DOMStorageModel._storag… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « LayoutTests/inspector/storage-panel-dom-storage-update-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Nokia Inc. All rights reserved. 2 * Copyright (C) 2008 Nokia Inc. All rights reserved.
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 action.redo(); 308 action.redo();
309 } 309 }
310 } 310 }
311 311
312 /** 312 /**
313 * @constructor 313 * @constructor
314 * @extends {WebInspector.Object} 314 * @extends {WebInspector.Object}
315 */ 315 */
316 WebInspector.DOMStorageModel = function() 316 WebInspector.DOMStorageModel = function()
317 { 317 {
318 /** @type {!Object.<string, !WebInspector.DOMStorage>} */
318 this._storages = {}; 319 this._storages = {};
319 InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageDis patcher(this)); 320 InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageDis patcher(this));
320 DOMStorageAgent.enable(); 321 DOMStorageAgent.enable();
321 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this); 322 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this);
322 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); 323 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this);
323 } 324 }
324 325
325 WebInspector.DOMStorageModel.Events = { 326 WebInspector.DOMStorageModel.Events = {
326 DOMStorageAdded: "DOMStorageAdded", 327 DOMStorageAdded: "DOMStorageAdded",
327 DOMStorageRemoved: "DOMStorageRemoved", 328 DOMStorageRemoved: "DOMStorageRemoved",
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 }, 425 },
425 426
426 /** 427 /**
427 * @param {DOMStorageAgent.StorageId} storageId 428 * @param {DOMStorageAgent.StorageId} storageId
428 * @param {string} key 429 * @param {string} key
429 * @param {string} oldValue 430 * @param {string} oldValue
430 * @param {string} newValue 431 * @param {string} newValue
431 */ 432 */
432 _domStorageItemUpdated: function(storageId, key, oldValue, newValue) 433 _domStorageItemUpdated: function(storageId, key, oldValue, newValue)
433 { 434 {
434 var domStorage = this._storages[storageId]; 435 var domStorage = this.storageForId(storageId);
435 var storageData = { 436 var storageData = {
436 storage: domStorage, 437 storage: domStorage,
437 key: key, 438 key: key,
438 oldValue: oldValue, 439 oldValue: oldValue,
439 newValue: newValue 440 newValue: newValue
440 }; 441 };
441 this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMSto rageItemUpdated, storageData); 442 this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMSto rageItemUpdated, storageData);
442 }, 443 },
443 444
444 /** 445 /**
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 domStorageItemUpdated: function(storageId, key, oldValue, newValue) 513 domStorageItemUpdated: function(storageId, key, oldValue, newValue)
513 { 514 {
514 this._model._domStorageItemUpdated(storageId, key, oldValue, newValue); 515 this._model._domStorageItemUpdated(storageId, key, oldValue, newValue);
515 }, 516 },
516 } 517 }
517 518
518 /** 519 /**
519 * @type {WebInspector.DOMStorageModel} 520 * @type {WebInspector.DOMStorageModel}
520 */ 521 */
521 WebInspector.domStorageModel = null; 522 WebInspector.domStorageModel = null;
OLDNEW
« no previous file with comments | « LayoutTests/inspector/storage-panel-dom-storage-update-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698