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

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

Issue 400633003: DevTools: introduce multitarget model listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/sdk/DOMModel.js ('k') | Source/devtools/front_end/sdk/Database.js » ('j') | 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 removeItem: function(key) 101 removeItem: function(key)
102 { 102 {
103 this._model._agent.removeDOMStorageItem(this.id, key); 103 this._model._agent.removeDOMStorageItem(this.id, key);
104 }, 104 },
105 105
106 __proto__: WebInspector.Object.prototype 106 __proto__: WebInspector.Object.prototype
107 } 107 }
108 108
109 /** 109 /**
110 * @constructor 110 * @constructor
111 * @extends {WebInspector.SDKObject} 111 * @extends {WebInspector.SDKModel}
112 * @param {!WebInspector.Target} target 112 * @param {!WebInspector.Target} target
113 */ 113 */
114 WebInspector.DOMStorageModel = function(target) 114 WebInspector.DOMStorageModel = function(target)
115 { 115 {
116 WebInspector.SDKObject.call(this, target); 116 WebInspector.SDKModel.call(this, WebInspector.DOMStorageModel, target);
117 117
118 /** @type {!Object.<string, !WebInspector.DOMStorage>} */ 118 /** @type {!Object.<string, !WebInspector.DOMStorage>} */
119 this._storages = {}; 119 this._storages = {};
120 target.registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher(th is)); 120 target.registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher(th is));
121 this._agent = target.domstorageAgent(); 121 this._agent = target.domstorageAgent();
122 this._agent.enable(); 122 this._agent.enable();
123 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.SecurityOriginAdded, this._securityOriginAdded, this); 123 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.SecurityOriginAdded, this._securityOriginAdded, this);
124 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); 124 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.SecurityOriginRemoved, this._securityOriginRemoved, this);
125 } 125 }
126 126
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 * @return {!Array.<!WebInspector.DOMStorage>} 250 * @return {!Array.<!WebInspector.DOMStorage>}
251 */ 251 */
252 storages: function() 252 storages: function()
253 { 253 {
254 var result = []; 254 var result = [];
255 for (var id in this._storages) 255 for (var id in this._storages)
256 result.push(this._storages[id]); 256 result.push(this._storages[id]);
257 return result; 257 return result;
258 }, 258 },
259 259
260 __proto__: WebInspector.SDKObject.prototype 260 __proto__: WebInspector.SDKModel.prototype
261 } 261 }
262 262
263 /** 263 /**
264 * @constructor 264 * @constructor
265 * @implements {DOMStorageAgent.Dispatcher} 265 * @implements {DOMStorageAgent.Dispatcher}
266 * @param {!WebInspector.DOMStorageModel} model 266 * @param {!WebInspector.DOMStorageModel} model
267 */ 267 */
268 WebInspector.DOMStorageDispatcher = function(model) 268 WebInspector.DOMStorageDispatcher = function(model)
269 { 269 {
270 this._model = model; 270 this._model = model;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 domStorageItemUpdated: function(storageId, key, oldValue, value) 308 domStorageItemUpdated: function(storageId, key, oldValue, value)
309 { 309 {
310 this._model._domStorageItemUpdated(storageId, key, oldValue, value); 310 this._model._domStorageItemUpdated(storageId, key, oldValue, value);
311 }, 311 },
312 } 312 }
313 313
314 /** 314 /**
315 * @type {!WebInspector.DOMStorageModel} 315 * @type {!WebInspector.DOMStorageModel}
316 */ 316 */
317 WebInspector.domStorageModel; 317 WebInspector.domStorageModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/DOMModel.js ('k') | Source/devtools/front_end/sdk/Database.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698