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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 continueFunction(key, nullptr, exceptionState); | 159 continueFunction(key, nullptr, exceptionState); |
160 } | 160 } |
161 | 161 |
162 void IDBCursor::continuePrimaryKey(ScriptState* scriptState, const ScriptValue&
keyValue, const ScriptValue& primaryKeyValue, ExceptionState& exceptionState) | 162 void IDBCursor::continuePrimaryKey(ScriptState* scriptState, const ScriptValue&
keyValue, const ScriptValue& primaryKeyValue, ExceptionState& exceptionState) |
163 { | 163 { |
164 IDB_TRACE("IDBCursor::continuePrimaryKey"); | 164 IDB_TRACE("IDBCursor::continuePrimaryKey"); |
165 if (m_source->type() != IDBAny::IDBIndexType) { | 165 if (m_source->type() != IDBAny::IDBIndexType) { |
166 exceptionState.throwDOMException(InvalidAccessError, "The cursor's sourc
e is not an index."); | 166 exceptionState.throwDOMException(InvalidAccessError, "The cursor's sourc
e is not an index."); |
167 return; | 167 return; |
168 } | 168 } |
| 169 if (m_direction != WebIDBCursorDirectionNext && m_direction != WebIDBCursorD
irectionPrev) { |
| 170 exceptionState.throwDOMException(InvalidAccessError, "The cursor's direc
tion is not 'next' or 'prev'."); |
| 171 return; |
| 172 } |
169 | 173 |
170 IDBKey* key = ScriptValue::to<IDBKey*>(scriptState->isolate(), keyValue, exc
eptionState); | 174 IDBKey* key = ScriptValue::to<IDBKey*>(scriptState->isolate(), keyValue, exc
eptionState); |
171 if (exceptionState.hadException()) | 175 if (exceptionState.hadException()) |
172 return; | 176 return; |
173 if (!key->isValid()) { | 177 if (!key->isValid()) { |
174 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro
rMessage); | 178 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro
rMessage); |
175 return; | 179 return; |
176 } | 180 } |
177 | 181 |
178 IDBKey* primaryKey = ScriptValue::to<IDBKey*>(scriptState->isolate(), primar
yKeyValue, exceptionState); | 182 IDBKey* primaryKey = ScriptValue::to<IDBKey*>(scriptState->isolate(), primar
yKeyValue, exceptionState); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 case WebIDBCursorDirectionPrevNoDuplicate: | 393 case WebIDBCursorDirectionPrevNoDuplicate: |
390 return IndexedDBNames::prevunique; | 394 return IndexedDBNames::prevunique; |
391 | 395 |
392 default: | 396 default: |
393 ASSERT_NOT_REACHED(); | 397 ASSERT_NOT_REACHED(); |
394 return IndexedDBNames::next; | 398 return IndexedDBNames::next; |
395 } | 399 } |
396 } | 400 } |
397 | 401 |
398 } // namespace blink | 402 } // namespace blink |
OLD | NEW |