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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 { | 412 { |
413 if (error) { | 413 if (error) { |
414 console.error("IndexedDBAgent error: " + error); | 414 console.error("IndexedDBAgent error: " + error); |
415 return; | 415 return; |
416 } | 416 } |
417 | 417 |
418 if (!this._databaseNamesBySecurityOrigin[databaseId.securityOrigin]) | 418 if (!this._databaseNamesBySecurityOrigin[databaseId.securityOrigin]) |
419 return; | 419 return; |
420 var entries = []; | 420 var entries = []; |
421 for (var i = 0; i < dataEntries.length; ++i) { | 421 for (var i = 0; i < dataEntries.length; ++i) { |
422 var key = WebInspector.RemoteObject.fromLocalObject(JSON.parse(d
ataEntries[i].key)); | 422 var key = this.target().runtimeModel.createRemoteObject(dataEntr
ies[i].key); |
423 var primaryKey = WebInspector.RemoteObject.fromLocalObject(JSON.
parse(dataEntries[i].primaryKey)); | 423 var primaryKey = this.target().runtimeModel.createRemoteObject(d
ataEntries[i].primaryKey); |
424 var value = WebInspector.RemoteObject.fromLocalObject(JSON.parse
(dataEntries[i].value)); | 424 var value = this.target().runtimeModel.createRemoteObject(dataEn
tries[i].value); |
425 entries.push(new WebInspector.IndexedDBModel.Entry(key, primaryK
ey, value)); | 425 entries.push(new WebInspector.IndexedDBModel.Entry(key, primaryK
ey, value)); |
426 } | 426 } |
427 callback(entries, hasMore); | 427 callback(entries, hasMore); |
428 } | 428 } |
429 | 429 |
430 var keyRange = WebInspector.IndexedDBModel.keyRangeFromIDBKeyRange(idbKe
yRange); | 430 var keyRange = WebInspector.IndexedDBModel.keyRangeFromIDBKeyRange(idbKe
yRange); |
431 this._agent.requestData(databaseId.securityOrigin, databaseName, objectS
toreName, indexName, skipCount, pageSize, keyRange ? keyRange : undefined, inner
Callback.bind(this)); | 431 this._agent.requestData(databaseId.securityOrigin, databaseName, objectS
toreName, indexName, skipCount, pageSize, keyRange ? keyRange : undefined, inner
Callback.bind(this)); |
432 }, | 432 }, |
433 | 433 |
434 __proto__: WebInspector.SDKModel.prototype | 434 __proto__: WebInspector.SDKModel.prototype |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 * @param {!WebInspector.Target} target | 533 * @param {!WebInspector.Target} target |
534 * @return {?WebInspector.IndexedDBModel} | 534 * @return {?WebInspector.IndexedDBModel} |
535 */ | 535 */ |
536 WebInspector.IndexedDBModel.fromTarget = function(target) | 536 WebInspector.IndexedDBModel.fromTarget = function(target) |
537 { | 537 { |
538 var model = /** @type {?WebInspector.IndexedDBModel} */ (target.model(WebIns
pector.IndexedDBModel)); | 538 var model = /** @type {?WebInspector.IndexedDBModel} */ (target.model(WebIns
pector.IndexedDBModel)); |
539 if (!model) | 539 if (!model) |
540 model = new WebInspector.IndexedDBModel(target); | 540 model = new WebInspector.IndexedDBModel(target); |
541 return model; | 541 return model; |
542 } | 542 } |
OLD | NEW |