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

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

Issue 2782773002: [DevTools] Remove SDKModels' fromTarget methods (Closed)
Patch Set: addressed review comments Created 3 years, 8 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) 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 /** 106 /**
107 * @unrestricted 107 * @unrestricted
108 */ 108 */
109 Resources.DOMStorageModel = class extends SDK.SDKModel { 109 Resources.DOMStorageModel = class extends SDK.SDKModel {
110 /** 110 /**
111 * @param {!SDK.Target} target 111 * @param {!SDK.Target} target
112 */ 112 */
113 constructor(target) { 113 constructor(target) {
114 super(target); 114 super(target);
115 115
116 this._securityOriginManager = SDK.SecurityOriginManager.fromTarget(target); 116 this._securityOriginManager = target.model(SDK.SecurityOriginManager);
117 /** @type {!Object.<string, !Resources.DOMStorage>} */ 117 /** @type {!Object.<string, !Resources.DOMStorage>} */
118 this._storages = {}; 118 this._storages = {};
119 this._agent = target.domstorageAgent(); 119 this._agent = target.domstorageAgent();
120 } 120 }
121 121
122 /**
123 * @param {!SDK.Target} target
124 * @return {!Resources.DOMStorageModel}
125 */
126 static fromTarget(target) {
127 return /** @type {!Resources.DOMStorageModel} */ (target.model(Resources.DOM StorageModel));
128 }
129
130 enable() { 122 enable() {
131 if (this._enabled) 123 if (this._enabled)
132 return; 124 return;
133 125
134 this.target().registerDOMStorageDispatcher(new Resources.DOMStorageDispatche r(this)); 126 this.target().registerDOMStorageDispatcher(new Resources.DOMStorageDispatche r(this));
135 this._securityOriginManager.addEventListener( 127 this._securityOriginManager.addEventListener(
136 SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOrig inAdded, this); 128 SDK.SecurityOriginManager.Events.SecurityOriginAdded, this._securityOrig inAdded, this);
137 this._securityOriginManager.addEventListener( 129 this._securityOriginManager.addEventListener(
138 SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOr iginRemoved, this); 130 SDK.SecurityOriginManager.Events.SecurityOriginRemoved, this._securityOr iginRemoved, this);
139 131
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 * @param {string} key 326 * @param {string} key
335 * @param {string} oldValue 327 * @param {string} oldValue
336 * @param {string} value 328 * @param {string} value
337 */ 329 */
338 domStorageItemUpdated(storageId, key, oldValue, value) { 330 domStorageItemUpdated(storageId, key, oldValue, value) {
339 this._model._domStorageItemUpdated(storageId, key, oldValue, value); 331 this._model._domStorageItemUpdated(storageId, key, oldValue, value);
340 } 332 }
341 }; 333 };
342 334
343 Resources.DOMStorageModel._symbol = Symbol('DomStorage'); 335 Resources.DOMStorageModel._symbol = Symbol('DomStorage');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698