OLD | NEW |
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 this._model._agent.executeSQL(this._id, query, callback); | 124 this._model._agent.executeSQL(this._id, query, callback); |
125 } | 125 } |
126 }; | 126 }; |
127 | 127 |
128 /** | 128 /** |
129 * @unrestricted | 129 * @unrestricted |
130 */ | 130 */ |
131 Resources.DatabaseModel = class extends SDK.SDKModel { | 131 Resources.DatabaseModel = class extends SDK.SDKModel { |
132 /** | 132 /** |
133 * @param {!SDK.Target} target | 133 * @param {!SDK.Target} target |
| 134 * @param {!Protocol.Dispatcher} dispatcher |
134 */ | 135 */ |
135 constructor(target) { | 136 constructor(target, dispatcher) { |
136 super(target); | 137 super(target, dispatcher); |
137 | 138 |
138 this._databases = []; | 139 this._databases = []; |
139 this._agent = target.databaseAgent(); | 140 this._agent = dispatcher.databaseAgent(); |
140 this.target().registerDatabaseDispatcher(new Resources.DatabaseDispatcher(th
is)); | 141 dispatcher.registerDatabaseDispatcher(new Resources.DatabaseDispatcher(this)
); |
141 } | 142 } |
142 | 143 |
143 enable() { | 144 enable() { |
144 if (this._enabled) | 145 if (this._enabled) |
145 return; | 146 return; |
146 this._agent.enable(); | 147 this._agent.enable(); |
147 this._enabled = true; | 148 this._enabled = true; |
148 } | 149 } |
149 | 150 |
150 disable() { | 151 disable() { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 * @override | 200 * @override |
200 * @param {!Protocol.Database.Database} payload | 201 * @param {!Protocol.Database.Database} payload |
201 */ | 202 */ |
202 addDatabase(payload) { | 203 addDatabase(payload) { |
203 this._model._addDatabase( | 204 this._model._addDatabase( |
204 new Resources.Database(this._model, payload.id, payload.domain, payload.
name, payload.version)); | 205 new Resources.Database(this._model, payload.id, payload.domain, payload.
name, payload.version)); |
205 } | 206 } |
206 }; | 207 }; |
207 | 208 |
208 Resources.DatabaseModel._symbol = Symbol('DatabaseModel'); | 209 Resources.DatabaseModel._symbol = Symbol('DatabaseModel'); |
OLD | NEW |