| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.TargetAwareObject} | 33 * @extends {WebInspector.SDKObject} |
| 34 */ | 34 */ |
| 35 WebInspector.IndexedDBModel = function(target) | 35 WebInspector.IndexedDBModel = function(target) |
| 36 { | 36 { |
| 37 WebInspector.TargetAwareObject.call(this, target); | 37 WebInspector.SDKObject.call(this, target); |
| 38 this._agent = target.indexedDBAgent(); | 38 this._agent = target.indexedDBAgent(); |
| 39 this._agent.enable(); | 39 this._agent.enable(); |
| 40 | 40 |
| 41 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.SecurityOriginAdded, this._securityOriginAdded, this); | 41 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.SecurityOriginAdded, this._securityOriginAdded, this); |
| 42 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); | 42 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); |
| 43 | 43 |
| 44 /** @type {!Map.<!WebInspector.IndexedDBModel.DatabaseId, !WebInspector.Inde
xedDBModel.Database>} */ | 44 /** @type {!Map.<!WebInspector.IndexedDBModel.DatabaseId, !WebInspector.Inde
xedDBModel.Database>} */ |
| 45 this._databases = new Map(); | 45 this._databases = new Map(); |
| 46 /** @type {!Object.<string, !Array.<string>>} */ | 46 /** @type {!Object.<string, !Array.<string>>} */ |
| 47 this._databaseNamesBySecurityOrigin = {}; | 47 this._databaseNamesBySecurityOrigin = {}; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 var value = WebInspector.RemoteObject.fromLocalObject(JSON.parse
(dataEntries[i].value)); | 398 var value = WebInspector.RemoteObject.fromLocalObject(JSON.parse
(dataEntries[i].value)); |
| 399 entries.push(new WebInspector.IndexedDBModel.Entry(key, primaryK
ey, value)); | 399 entries.push(new WebInspector.IndexedDBModel.Entry(key, primaryK
ey, value)); |
| 400 } | 400 } |
| 401 callback(entries, hasMore); | 401 callback(entries, hasMore); |
| 402 } | 402 } |
| 403 | 403 |
| 404 var keyRange = WebInspector.IndexedDBModel.keyRangeFromIDBKeyRange(idbKe
yRange); | 404 var keyRange = WebInspector.IndexedDBModel.keyRangeFromIDBKeyRange(idbKe
yRange); |
| 405 this._agent.requestData(databaseId.securityOrigin, databaseName, objectS
toreName, indexName, skipCount, pageSize, keyRange ? keyRange : undefined, inner
Callback.bind(this)); | 405 this._agent.requestData(databaseId.securityOrigin, databaseName, objectS
toreName, indexName, skipCount, pageSize, keyRange ? keyRange : undefined, inner
Callback.bind(this)); |
| 406 }, | 406 }, |
| 407 | 407 |
| 408 __proto__: WebInspector.TargetAwareObject.prototype | 408 __proto__: WebInspector.SDKObject.prototype |
| 409 } | 409 } |
| 410 | 410 |
| 411 /** | 411 /** |
| 412 * @constructor | 412 * @constructor |
| 413 * @param {!WebInspector.RemoteObject} key | 413 * @param {!WebInspector.RemoteObject} key |
| 414 * @param {!WebInspector.RemoteObject} primaryKey | 414 * @param {!WebInspector.RemoteObject} primaryKey |
| 415 * @param {!WebInspector.RemoteObject} value | 415 * @param {!WebInspector.RemoteObject} value |
| 416 */ | 416 */ |
| 417 WebInspector.IndexedDBModel.Entry = function(key, primaryKey, value) | 417 WebInspector.IndexedDBModel.Entry = function(key, primaryKey, value) |
| 418 { | 418 { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 WebInspector.IndexedDBModel.Index.prototype = { | 498 WebInspector.IndexedDBModel.Index.prototype = { |
| 499 /** | 499 /** |
| 500 * @type {string} | 500 * @type {string} |
| 501 */ | 501 */ |
| 502 get keyPathString() | 502 get keyPathString() |
| 503 { | 503 { |
| 504 return WebInspector.IndexedDBModel.keyPathStringFromIDBKeyPath(this.keyP
ath); | 504 return WebInspector.IndexedDBModel.keyPathStringFromIDBKeyPath(this.keyP
ath); |
| 505 } | 505 } |
| 506 } | 506 } |
| OLD | NEW |