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(); | 339 const IDBObjectStoreOwnMetadata& metadata = objectStore->metadata().own; |
jsbell
2016/09/16 18:17:28
It seems wrong for IDBCursor to know so much about
pwnall
2016/09/17 01:34:21
Done.
This looks so clean! :)
| |
340 IDBAny* value; | 340 IDBAny* value; |
341 if (!m_value) { | 341 if (!m_value) { |
342 value = IDBAny::createUndefined(); | 342 value = IDBAny::createUndefined(); |
343 } else if (metadata.autoIncrement && !metadata.keyPath.isNull()) { | 343 } else if (metadata.autoIncrement && !metadata.keyPath.isNull()) { |
344 RefPtr<IDBValue> idbValue = IDBValue::create(m_value.get(), m_primaryKey , metadata.keyPath); | 344 RefPtr<IDBValue> idbValue = IDBValue::create(m_value.get(), m_primaryKey , metadata.keyPath); |
345 #if ENABLE(ASSERT) | 345 #if ENABLE(ASSERT) |
346 assertPrimaryKeyValidOrInjectable(scriptState, idbValue.get()); | 346 assertPrimaryKeyValidOrInjectable(scriptState, idbValue.get()); |
347 #endif | 347 #endif |
348 value = IDBAny::create(idbValue.release()); | 348 value = IDBAny::create(idbValue.release()); |
349 } else { | 349 } else { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 case WebIDBCursorDirectionPrevNoDuplicate: | 420 case WebIDBCursorDirectionPrevNoDuplicate: |
421 return IndexedDBNames::prevunique; | 421 return IndexedDBNames::prevunique; |
422 | 422 |
423 default: | 423 default: |
424 ASSERT_NOT_REACHED(); | 424 ASSERT_NOT_REACHED(); |
425 return IndexedDBNames::next; | 425 return IndexedDBNames::next; |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } // namespace blink | 429 } // namespace blink |
OLD | NEW |