| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 , m_objectStoreId(objectStoreId) | 334 , m_objectStoreId(objectStoreId) |
| 335 , m_indexId(indexId) | 335 , m_indexId(indexId) |
| 336 { | 336 { |
| 337 } | 337 } |
| 338 | 338 |
| 339 virtual bool callback(const IDBBackingStore::ObjectStoreRecordIdentifier* re
cordIdentifier, const String& value) | 339 virtual bool callback(const IDBBackingStore::ObjectStoreRecordIdentifier* re
cordIdentifier, const String& value) |
| 340 { | 340 { |
| 341 RefPtr<SerializedScriptValue> objectValue = SerializedScriptValue::creat
eFromWire(value); | 341 RefPtr<SerializedScriptValue> objectValue = SerializedScriptValue::creat
eFromWire(value); |
| 342 RefPtr<IDBKey> indexKey = fetchKeyFromKeyPath(objectValue.get(), m_index
KeyPath); | 342 RefPtr<IDBKey> indexKey = fetchKeyFromKeyPath(objectValue.get(), m_index
KeyPath); |
| 343 | 343 |
| 344 if (!indexKey) |
| 345 return true; |
| 344 if (!m_backingStore.putIndexDataForRecord(m_databaseId, m_objectStoreId,
m_indexId, *indexKey, recordIdentifier)) | 346 if (!m_backingStore.putIndexDataForRecord(m_databaseId, m_objectStoreId,
m_indexId, *indexKey, recordIdentifier)) |
| 345 return false; | 347 return false; |
| 346 | 348 |
| 347 return true; | 349 return true; |
| 348 } | 350 } |
| 349 | 351 |
| 350 private: | 352 private: |
| 351 IDBBackingStore& m_backingStore; | 353 IDBBackingStore& m_backingStore; |
| 352 const String& m_indexKeyPath; | 354 const String& m_indexKeyPath; |
| 353 int64_t m_databaseId; | 355 int64_t m_databaseId; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 return IDBKey::createNumber(m_autoIncrementNumber++); | 508 return IDBKey::createNumber(m_autoIncrementNumber++); |
| 507 | 509 |
| 508 m_autoIncrementNumber = static_cast<int>(m_backingStore->nextAutoIncrementNu
mber(m_databaseId, id())); | 510 m_autoIncrementNumber = static_cast<int>(m_backingStore->nextAutoIncrementNu
mber(m_databaseId, id())); |
| 509 return IDBKey::createNumber(m_autoIncrementNumber++); | 511 return IDBKey::createNumber(m_autoIncrementNumber++); |
| 510 } | 512 } |
| 511 | 513 |
| 512 | 514 |
| 513 } // namespace WebCore | 515 } // namespace WebCore |
| 514 | 516 |
| 515 #endif | 517 #endif |
| OLD | NEW |