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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ExceptionState& exceptionState) { | 287 ExceptionState& exceptionState) { |
288 DCHECK(m_transaction->isActive()); | 288 DCHECK(m_transaction->isActive()); |
289 DCHECK(m_gotValue); | 289 DCHECK(m_gotValue); |
290 DCHECK(!isDeleted()); | 290 DCHECK(!isDeleted()); |
291 DCHECK(!primaryKey || (key && primaryKey)); | 291 DCHECK(!primaryKey || (key && primaryKey)); |
292 | 292 |
293 if (key) { | 293 if (key) { |
294 DCHECK(m_key); | 294 DCHECK(m_key); |
295 if (m_direction == WebIDBCursorDirectionNext || | 295 if (m_direction == WebIDBCursorDirectionNext || |
296 m_direction == WebIDBCursorDirectionNextNoDuplicate) { | 296 m_direction == WebIDBCursorDirectionNextNoDuplicate) { |
297 const bool ok = | 297 const bool ok = m_key->isLessThan(key) || |
298 m_key->isLessThan(key) || (primaryKey && m_key->isEqual(key) && | 298 (primaryKey && m_key->isEqual(key) && |
299 m_primaryKey->isLessThan(primaryKey)); | 299 m_primaryKey->isLessThan(primaryKey)); |
300 if (!ok) { | 300 if (!ok) { |
301 exceptionState.throwDOMException( | 301 exceptionState.throwDOMException( |
302 DataError, | 302 DataError, |
303 "The parameter is less than or equal to this cursor's position."); | 303 "The parameter is less than or equal to this cursor's position."); |
304 return; | 304 return; |
305 } | 305 } |
306 | 306 |
307 } else { | 307 } else { |
308 const bool ok = key->isLessThan(m_key.get()) || | 308 const bool ok = key->isLessThan(m_key.get()) || |
309 (primaryKey && key->isEqual(m_key.get()) && | 309 (primaryKey && key->isEqual(m_key.get()) && |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 case WebIDBCursorDirectionPrevNoDuplicate: | 484 case WebIDBCursorDirectionPrevNoDuplicate: |
485 return IndexedDBNames::prevunique; | 485 return IndexedDBNames::prevunique; |
486 | 486 |
487 default: | 487 default: |
488 NOTREACHED(); | 488 NOTREACHED(); |
489 return IndexedDBNames::next; | 489 return IndexedDBNames::next; |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 } // namespace blink | 493 } // namespace blink |
OLD | NEW |