| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return m_source->idbIndex()->objectStore(); | 352 return m_source->idbIndex()->objectStore(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 bool IDBCursor::isDeleted() const | 355 bool IDBCursor::isDeleted() const |
| 356 { | 356 { |
| 357 if (m_source->type() == IDBAny::IDBObjectStoreType) | 357 if (m_source->type() == IDBAny::IDBObjectStoreType) |
| 358 return m_source->idbObjectStore()->isDeleted(); | 358 return m_source->idbObjectStore()->isDeleted(); |
| 359 return m_source->idbIndex()->isDeleted(); | 359 return m_source->idbIndex()->isDeleted(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 WebIDBCursorDirection IDBCursor::stringToDirection(const String& directionString
, ExceptionState& exceptionState) | 362 WebIDBCursorDirection IDBCursor::stringToDirection(const String& directionString
) |
| 363 { | 363 { |
| 364 if (directionString == IndexedDBNames::next) | 364 if (directionString == IndexedDBNames::next) |
| 365 return WebIDBCursorDirectionNext; | 365 return WebIDBCursorDirectionNext; |
| 366 if (directionString == IndexedDBNames::nextunique) | 366 if (directionString == IndexedDBNames::nextunique) |
| 367 return WebIDBCursorDirectionNextNoDuplicate; | 367 return WebIDBCursorDirectionNextNoDuplicate; |
| 368 if (directionString == IndexedDBNames::prev) | 368 if (directionString == IndexedDBNames::prev) |
| 369 return WebIDBCursorDirectionPrev; | 369 return WebIDBCursorDirectionPrev; |
| 370 if (directionString == IndexedDBNames::prevunique) | 370 if (directionString == IndexedDBNames::prevunique) |
| 371 return WebIDBCursorDirectionPrevNoDuplicate; | 371 return WebIDBCursorDirectionPrevNoDuplicate; |
| 372 | 372 |
| 373 exceptionState.throwTypeError("The direction provided ('" + directionString
+ "') is not one of 'next', 'nextunique', 'prev', or 'prevunique'."); | 373 ASSERT_NOT_REACHED(); |
| 374 return WebIDBCursorDirectionNext; | 374 return WebIDBCursorDirectionNext; |
| 375 } | 375 } |
| 376 | 376 |
| 377 const String& IDBCursor::direction() const | 377 const String& IDBCursor::direction() const |
| 378 { | 378 { |
| 379 switch (m_direction) { | 379 switch (m_direction) { |
| 380 case WebIDBCursorDirectionNext: | 380 case WebIDBCursorDirectionNext: |
| 381 return IndexedDBNames::next; | 381 return IndexedDBNames::next; |
| 382 | 382 |
| 383 case WebIDBCursorDirectionNextNoDuplicate: | 383 case WebIDBCursorDirectionNextNoDuplicate: |
| 384 return IndexedDBNames::nextunique; | 384 return IndexedDBNames::nextunique; |
| 385 | 385 |
| 386 case WebIDBCursorDirectionPrev: | 386 case WebIDBCursorDirectionPrev: |
| 387 return IndexedDBNames::prev; | 387 return IndexedDBNames::prev; |
| 388 | 388 |
| 389 case WebIDBCursorDirectionPrevNoDuplicate: | 389 case WebIDBCursorDirectionPrevNoDuplicate: |
| 390 return IndexedDBNames::prevunique; | 390 return IndexedDBNames::prevunique; |
| 391 | 391 |
| 392 default: | 392 default: |
| 393 ASSERT_NOT_REACHED(); | 393 ASSERT_NOT_REACHED(); |
| 394 return IndexedDBNames::next; | 394 return IndexedDBNames::next; |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace blink | 398 } // namespace blink |
| OLD | NEW |