Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: Source/modules/indexeddb/IDBObjectStore.cpp

Issue 1158973007: IndexedDB: Rely on bindings for enum validation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/indexeddb/IDBIndex.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBIndex.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698