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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 * @param {!SDK.Target} target 133 * @param {!SDK.Target} target
134 */ 134 */
135 constructor(target) { 135 constructor(target) {
136 super(target); 136 super(target);
137 137
138 this._databases = []; 138 this._databases = [];
139 this._agent = target.databaseAgent(); 139 this._agent = target.databaseAgent();
140 this.target().registerDatabaseDispatcher(new Resources.DatabaseDispatcher(th is)); 140 this.target().registerDatabaseDispatcher(new Resources.DatabaseDispatcher(th is));
141 } 141 }
142 142
143 /**
144 * @param {!SDK.Target} target
145 * @return {!Resources.DatabaseModel}
146 */
147 static fromTarget(target) {
148 return /** @type {!Resources.DatabaseModel} */ (target.model(Resources.Datab aseModel));
149 }
150
151 enable() { 143 enable() {
152 if (this._enabled) 144 if (this._enabled)
153 return; 145 return;
154 this._agent.enable(); 146 this._agent.enable();
155 this._enabled = true; 147 this._enabled = true;
156 } 148 }
157 149
158 disable() { 150 disable() {
159 if (!this._enabled) 151 if (!this._enabled)
160 return; 152 return;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 * @override 199 * @override
208 * @param {!Protocol.Database.Database} payload 200 * @param {!Protocol.Database.Database} payload
209 */ 201 */
210 addDatabase(payload) { 202 addDatabase(payload) {
211 this._model._addDatabase( 203 this._model._addDatabase(
212 new Resources.Database(this._model, payload.id, payload.domain, payload. name, payload.version)); 204 new Resources.Database(this._model, payload.id, payload.domain, payload. name, payload.version));
213 } 205 }
214 }; 206 };
215 207
216 Resources.DatabaseModel._symbol = Symbol('DatabaseModel'); 208 Resources.DatabaseModel._symbol = Symbol('DatabaseModel');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698