OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 { | 319 { |
320 ASSERT(event->type() == eventNames().successEvent); | 320 ASSERT(event->type() == eventNames().successEvent); |
321 EventTarget* target = event->target(); | 321 EventTarget* target = event->target(); |
322 IDBRequest* request = static_cast<IDBRequest*>(target); | 322 IDBRequest* request = static_cast<IDBRequest*>(target); |
323 | 323 |
324 RefPtr<IDBAny> cursorAny = request->result(ASSERT_NO_EXCEPTION); | 324 RefPtr<IDBAny> cursorAny = request->result(ASSERT_NO_EXCEPTION); |
325 RefPtr<IDBCursorWithValue> cursor; | 325 RefPtr<IDBCursorWithValue> cursor; |
326 if (cursorAny->type() == IDBAny::IDBCursorWithValueType) | 326 if (cursorAny->type() == IDBAny::IDBCursorWithValueType) |
327 cursor = cursorAny->idbCursorWithValue(); | 327 cursor = cursorAny->idbCursorWithValue(); |
328 | 328 |
329 Vector<int64_t, 1> indexIds; | 329 Vector<int64_t> indexIds; |
330 indexIds.append(m_indexMetadata.id); | 330 indexIds.append(m_indexMetadata.id); |
331 if (cursor) { | 331 if (cursor) { |
332 cursor->continueFunction(static_cast<IDBKey*>(0), ASSERT_NO_EXCEPTIO
N); | 332 cursor->continueFunction(static_cast<IDBKey*>(0), ASSERT_NO_EXCEPTIO
N); |
333 | 333 |
334 RefPtr<IDBKey> primaryKey = cursor->idbPrimaryKey(); | 334 RefPtr<IDBKey> primaryKey = cursor->idbPrimaryKey(); |
335 ScriptValue value = cursor->value(context); | 335 ScriptValue value = cursor->value(context); |
336 | 336 |
337 IDBObjectStore::IndexKeys indexKeys; | 337 IDBObjectStore::IndexKeys indexKeys; |
338 generateIndexKeysForValue(request->requestState(), m_indexMetadata,
value, &indexKeys); | 338 generateIndexKeysForValue(request->requestState(), m_indexMetadata,
value, &indexKeys); |
339 | 339 |
340 Vector<IDBObjectStore::IndexKeys, 1> indexKeysList; | 340 Vector<IDBObjectStore::IndexKeys> indexKeysList; |
341 indexKeysList.append(indexKeys); | 341 indexKeysList.append(indexKeys); |
342 | 342 |
343 m_databaseBackend->setIndexKeys(m_transactionId, m_objectStoreId, pr
imaryKey, indexIds, indexKeysList); | 343 m_databaseBackend->setIndexKeys(m_transactionId, m_objectStoreId, pr
imaryKey, indexIds, indexKeysList); |
344 } else { | 344 } else { |
345 // Now that we are done indexing, tell the backend to go | 345 // Now that we are done indexing, tell the backend to go |
346 // back to processing tasks of type NormalTask. | 346 // back to processing tasks of type NormalTask. |
347 m_databaseBackend->setIndexesReady(m_transactionId, m_objectStoreId,
indexIds); | 347 m_databaseBackend->setIndexesReady(m_transactionId, m_objectStoreId,
indexIds); |
348 m_databaseBackend.clear(); | 348 m_databaseBackend.clear(); |
349 } | 349 } |
350 | 350 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 582 } |
583 return IDBIndexMetadata::InvalidId; | 583 return IDBIndexMetadata::InvalidId; |
584 } | 584 } |
585 | 585 |
586 IDBDatabaseBackendInterface* IDBObjectStore::backendDB() const | 586 IDBDatabaseBackendInterface* IDBObjectStore::backendDB() const |
587 { | 587 { |
588 return m_transaction->backendDB(); | 588 return m_transaction->backendDB(); |
589 } | 589 } |
590 | 590 |
591 } // namespace WebCore | 591 } // namespace WebCore |
OLD | NEW |