| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 { | 329 { |
| 330 m_primaryKeyDirty = false; | 330 m_primaryKeyDirty = false; |
| 331 return ScriptValue::from(scriptState, m_primaryKey); | 331 return ScriptValue::from(scriptState, m_primaryKey); |
| 332 } | 332 } |
| 333 | 333 |
| 334 ScriptValue IDBCursor::value(ScriptState* scriptState) | 334 ScriptValue IDBCursor::value(ScriptState* scriptState) |
| 335 { | 335 { |
| 336 ASSERT(isCursorWithValue()); | 336 ASSERT(isCursorWithValue()); |
| 337 | 337 |
| 338 IDBObjectStore* objectStore = effectiveObjectStore(); | 338 IDBObjectStore* objectStore = effectiveObjectStore(); |
| 339 const IDBObjectStoreMetadata& metadata = objectStore->metadata(); | |
| 340 IDBAny* value; | 339 IDBAny* value; |
| 341 if (!m_value) { | 340 if (!m_value) { |
| 342 value = IDBAny::createUndefined(); | 341 value = IDBAny::createUndefined(); |
| 343 } else if (metadata.autoIncrement && !metadata.keyPath.isNull()) { | 342 } else if (objectStore->autoIncrement() && !objectStore->idbKeyPath().isNull
()) { |
| 344 RefPtr<IDBValue> idbValue = IDBValue::create(m_value.get(), m_primaryKey
, metadata.keyPath); | 343 RefPtr<IDBValue> idbValue = IDBValue::create(m_value.get(), m_primaryKey
, objectStore->idbKeyPath()); |
| 345 #if ENABLE(ASSERT) | 344 #if ENABLE(ASSERT) |
| 346 assertPrimaryKeyValidOrInjectable(scriptState, idbValue.get()); | 345 assertPrimaryKeyValidOrInjectable(scriptState, idbValue.get()); |
| 347 #endif | 346 #endif |
| 348 value = IDBAny::create(idbValue.release()); | 347 value = IDBAny::create(idbValue.release()); |
| 349 } else { | 348 } else { |
| 350 value = IDBAny::create(m_value); | 349 value = IDBAny::create(m_value); |
| 351 } | 350 } |
| 352 | 351 |
| 353 m_valueDirty = false; | 352 m_valueDirty = false; |
| 354 ScriptValue scriptValue = ScriptValue::from(scriptState, value); | 353 ScriptValue scriptValue = ScriptValue::from(scriptState, value); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 case WebIDBCursorDirectionPrevNoDuplicate: | 419 case WebIDBCursorDirectionPrevNoDuplicate: |
| 421 return IndexedDBNames::prevunique; | 420 return IndexedDBNames::prevunique; |
| 422 | 421 |
| 423 default: | 422 default: |
| 424 ASSERT_NOT_REACHED(); | 423 ASSERT_NOT_REACHED(); |
| 425 return IndexedDBNames::next; | 424 return IndexedDBNames::next; |
| 426 } | 425 } |
| 427 } | 426 } |
| 428 | 427 |
| 429 } // namespace blink | 428 } // namespace blink |
| OLD | NEW |