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

Unified Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 1407883002: Add new experimental IDBObjectStore.getKey(query) API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 032d01d211d929294ba4454a006faa4616b62caa..e466e7ee86b9b0a5d7a8a3973ada7edb62f1afa0 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -883,15 +883,24 @@ void IndexedDBDatabase::GetOperation(
key = &key_range->lower();
} else {
if (index_id == IndexedDBIndexMetadata::kInvalidId) {
- DCHECK_NE(cursor_type, indexed_db::CURSOR_KEY_ONLY);
// ObjectStore Retrieval Operation
- backing_store_cursor = backing_store_->OpenObjectStoreCursor(
- transaction->BackingStoreTransaction(),
- id(),
- object_store_id,
- *key_range,
- blink::WebIDBCursorDirectionNext,
- &s);
+ if (cursor_type == indexed_db::CURSOR_KEY_ONLY) {
+ backing_store_cursor = backing_store_->OpenObjectStoreKeyCursor(
+ transaction->BackingStoreTransaction(),
+ id(),
+ object_store_id,
+ *key_range,
+ blink::WebIDBCursorDirectionNext,
+ &s);
+ } else {
+ backing_store_cursor = backing_store_->OpenObjectStoreCursor(
+ transaction->BackingStoreTransaction(),
+ id(),
+ object_store_id,
+ *key_range,
+ blink::WebIDBCursorDirectionNext,
+ &s);
+ }
} else if (cursor_type == indexed_db::CURSOR_KEY_ONLY) {
// Index Value Retrieval Operation
backing_store_cursor = backing_store_->OpenIndexKeyCursor(
@@ -955,6 +964,11 @@ void IndexedDBDatabase::GetOperation(
return;
}
+ if (cursor_type == indexed_db::CURSOR_KEY_ONLY) {
+ callbacks->OnSuccess(*key);
cmumford 2016/08/29 19:03:22 Indenting is wrong.
+ return;
+ }
+
if (object_store_metadata.auto_increment &&
!object_store_metadata.key_path.IsNull()) {
value.primary_key = *key;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698