| 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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 } | 597 } |
| 598 if (m_transaction->isFinished() || m_transaction->isFinishing()) { | 598 if (m_transaction->isFinished() || m_transaction->isFinishing()) { |
| 599 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionFinishedErrorMessage); | 599 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionFinishedErrorMessage); |
| 600 return nullptr; | 600 return nullptr; |
| 601 } | 601 } |
| 602 if (!m_transaction->isActive()) { | 602 if (!m_transaction->isActive()) { |
| 603 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); | 603 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); |
| 604 return nullptr; | 604 return nullptr; |
| 605 } | 605 } |
| 606 | 606 |
| 607 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri
ng, exceptionState); | 607 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri
ng); |
| 608 if (exceptionState.hadException()) | |
| 609 return nullptr; | |
| 610 | |
| 611 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC
ontext(), range, exceptionState); | 608 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC
ontext(), range, exceptionState); |
| 612 if (exceptionState.hadException()) | 609 if (exceptionState.hadException()) |
| 613 return nullptr; | 610 return nullptr; |
| 614 | 611 |
| 615 if (!backendDB()) { | 612 if (!backendDB()) { |
| 616 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); | 613 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); |
| 617 return nullptr; | 614 return nullptr; |
| 618 } | 615 } |
| 619 | 616 |
| 620 return openCursor(scriptState, keyRange, direction, WebIDBTaskTypeNormal); | 617 return openCursor(scriptState, keyRange, direction, WebIDBTaskTypeNormal); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 638 } | 635 } |
| 639 if (m_transaction->isFinished() || m_transaction->isFinishing()) { | 636 if (m_transaction->isFinished() || m_transaction->isFinishing()) { |
| 640 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionFinishedErrorMessage); | 637 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionFinishedErrorMessage); |
| 641 return nullptr; | 638 return nullptr; |
| 642 } | 639 } |
| 643 if (!m_transaction->isActive()) { | 640 if (!m_transaction->isActive()) { |
| 644 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); | 641 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); |
| 645 return nullptr; | 642 return nullptr; |
| 646 } | 643 } |
| 647 | 644 |
| 648 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri
ng, exceptionState); | 645 WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionStri
ng); |
| 649 if (exceptionState.hadException()) | |
| 650 return nullptr; | |
| 651 | |
| 652 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC
ontext(), range, exceptionState); | 646 IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionC
ontext(), range, exceptionState); |
| 653 if (exceptionState.hadException()) | 647 if (exceptionState.hadException()) |
| 654 return nullptr; | 648 return nullptr; |
| 655 | 649 |
| 656 if (!backendDB()) { | 650 if (!backendDB()) { |
| 657 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); | 651 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); |
| 658 return nullptr; | 652 return nullptr; |
| 659 } | 653 } |
| 660 | 654 |
| 661 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this),
m_transaction.get()); | 655 IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this),
m_transaction.get()); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 } | 707 } |
| 714 return IDBIndexMetadata::InvalidId; | 708 return IDBIndexMetadata::InvalidId; |
| 715 } | 709 } |
| 716 | 710 |
| 717 WebIDBDatabase* IDBObjectStore::backendDB() const | 711 WebIDBDatabase* IDBObjectStore::backendDB() const |
| 718 { | 712 { |
| 719 return m_transaction->backendDB(); | 713 return m_transaction->backendDB(); |
| 720 } | 714 } |
| 721 | 715 |
| 722 } // namespace blink | 716 } // namespace blink |
| OLD | NEW |