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

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

Issue 1303983002: IndexedDB: Treat count of 0 as unbounded for getAll() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 IDBRequest* IDBObjectStore::getAll(ScriptState* scriptState, const ScriptValue& keyRange, ExceptionState& exceptionState) 121 IDBRequest* IDBObjectStore::getAll(ScriptState* scriptState, const ScriptValue& keyRange, ExceptionState& exceptionState)
122 { 122 {
123 return getAll(scriptState, keyRange, std::numeric_limits<uint32_t>::max(), e xceptionState); 123 return getAll(scriptState, keyRange, std::numeric_limits<uint32_t>::max(), e xceptionState);
124 } 124 }
125 125
126 IDBRequest* IDBObjectStore::getAll(ScriptState* scriptState, const ScriptValue& keyRange, unsigned long maxCount, ExceptionState& exceptionState) 126 IDBRequest* IDBObjectStore::getAll(ScriptState* scriptState, const ScriptValue& keyRange, unsigned long maxCount, ExceptionState& exceptionState)
127 { 127 {
128 IDB_TRACE("IDBObjectStore::getAll"); 128 IDB_TRACE("IDBObjectStore::getAll");
129 if (!maxCount) { 129 if (!maxCount)
130 exceptionState.throwTypeError(IDBDatabase::notValidMaxCountErrorMessage) ; 130 maxCount = std::numeric_limits<uint32_t>::max();
cmumford 2015/08/21 17:32:40 Since you're deleting all references to notValidMa
jsbell 2015/08/21 17:48:32 Done.
131 return nullptr; 131
132 }
133 if (isDeleted()) { 132 if (isDeleted()) {
134 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage); 133 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage);
135 return nullptr; 134 return nullptr;
136 } 135 }
137 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 136 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
138 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 137 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
139 return nullptr; 138 return nullptr;
140 } 139 }
141 if (!m_transaction->isActive()) { 140 if (!m_transaction->isActive()) {
142 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 141 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
(...skipping 13 matching lines...) Expand all
156 } 155 }
157 156
158 IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptVal ue& keyRange, ExceptionState& exceptionState) 157 IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptVal ue& keyRange, ExceptionState& exceptionState)
159 { 158 {
160 return getAllKeys(scriptState, keyRange, std::numeric_limits<uint32_t>::max( ), exceptionState); 159 return getAllKeys(scriptState, keyRange, std::numeric_limits<uint32_t>::max( ), exceptionState);
161 } 160 }
162 161
163 IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptVal ue& keyRange, unsigned long maxCount, ExceptionState& exceptionState) 162 IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptVal ue& keyRange, unsigned long maxCount, ExceptionState& exceptionState)
164 { 163 {
165 IDB_TRACE("IDBObjectStore::getAll"); 164 IDB_TRACE("IDBObjectStore::getAll");
166 if (!maxCount) { 165 if (!maxCount)
167 exceptionState.throwTypeError(IDBDatabase::notValidMaxCountErrorMessage) ; 166 maxCount = std::numeric_limits<uint32_t>::max();
168 return 0; 167
169 }
170 if (isDeleted()) { 168 if (isDeleted()) {
171 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage); 169 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage);
172 return 0; 170 return 0;
173 } 171 }
174 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 172 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
175 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage); 173 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionFinishedErrorMessage);
176 return 0; 174 return 0;
177 } 175 }
178 if (!m_transaction->isActive()) { 176 if (!m_transaction->isActive()) {
179 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 177 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 748 }
751 return IDBIndexMetadata::InvalidId; 749 return IDBIndexMetadata::InvalidId;
752 } 750 }
753 751
754 WebIDBDatabase* IDBObjectStore::backendDB() const 752 WebIDBDatabase* IDBObjectStore::backendDB() const
755 { 753 {
756 return m_transaction->backendDB(); 754 return m_transaction->backendDB();
757 } 755 }
758 756
759 } // namespace blink 757 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698