| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 m_request->setPendingCursor(this); | 173 m_request->setPendingCursor(this); |
| 174 m_gotValue = false; | 174 m_gotValue = false; |
| 175 m_backend->advance(count, m_request, ec); | 175 m_backend->advance(count, m_request, ec); |
| 176 ASSERT(!ec); | 176 ASSERT(!ec); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void IDBCursor::continueFunction(ScriptExecutionContext* context, const ScriptVa
lue& keyValue, ExceptionCode& ec) | 179 void IDBCursor::continueFunction(ScriptExecutionContext* context, const ScriptVa
lue& keyValue, ExceptionCode& ec) |
| 180 { | 180 { |
| 181 DOMRequestState requestState(context); | 181 DOMRequestState requestState(context); |
| 182 RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue); | 182 RefPtr<IDBKey> key = keyValue.isUndefined() ? 0 : scriptValueToIDBKey(&reque
stState, keyValue); |
| 183 continueFunction(key.release(), ec); | 183 continueFunction(key.release(), ec); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void IDBCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec) | 186 void IDBCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCode& ec) |
| 187 { | 187 { |
| 188 ec = 0; | 188 ec = 0; |
| 189 IDB_TRACE("IDBCursor::continue"); | 189 IDB_TRACE("IDBCursor::continue"); |
| 190 if (key && !key->isValid()) { | 190 if (key && !key->isValid()) { |
| 191 ec = IDBDatabaseException::DataError; | 191 ec = IDBDatabaseException::DataError; |
| 192 return; | 192 return; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore() | 291 PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore() |
| 292 { | 292 { |
| 293 if (m_source->type() == IDBAny::IDBObjectStoreType) | 293 if (m_source->type() == IDBAny::IDBObjectStoreType) |
| 294 return m_source->idbObjectStore(); | 294 return m_source->idbObjectStore(); |
| 295 RefPtr<IDBIndex> index = m_source->idbIndex(); | 295 RefPtr<IDBIndex> index = m_source->idbIndex(); |
| 296 return index->objectStore(); | 296 return index->objectStore(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 IndexedDB::CursorDirection IDBCursor::stringToDirection(const String& directionS
tring, ExceptionCode& ec) | 299 IndexedDB::CursorDirection IDBCursor::stringToDirection(const String& directionS
tring, ExceptionCode& ec) |
| 300 { | 300 { |
| 301 if (directionString == IDBCursor::directionNext()) | 301 if (directionString.isNull() || directionString == IDBCursor::directionNext(
)) |
| 302 return IndexedDB::CursorNext; | 302 return IndexedDB::CursorNext; |
| 303 if (directionString == IDBCursor::directionNextUnique()) | 303 if (directionString == IDBCursor::directionNextUnique()) |
| 304 return IndexedDB::CursorNextNoDuplicate; | 304 return IndexedDB::CursorNextNoDuplicate; |
| 305 if (directionString == IDBCursor::directionPrev()) | 305 if (directionString == IDBCursor::directionPrev()) |
| 306 return IndexedDB::CursorPrev; | 306 return IndexedDB::CursorPrev; |
| 307 if (directionString == IDBCursor::directionPrevUnique()) | 307 if (directionString == IDBCursor::directionPrevUnique()) |
| 308 return IndexedDB::CursorPrevNoDuplicate; | 308 return IndexedDB::CursorPrevNoDuplicate; |
| 309 | 309 |
| 310 ec = TypeError; | 310 ec = TypeError; |
| 311 return IndexedDB::CursorNext; | 311 return IndexedDB::CursorNext; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 326 case IndexedDB::CursorPrevNoDuplicate: | 326 case IndexedDB::CursorPrevNoDuplicate: |
| 327 return IDBCursor::directionPrevUnique(); | 327 return IDBCursor::directionPrevUnique(); |
| 328 | 328 |
| 329 default: | 329 default: |
| 330 ASSERT_NOT_REACHED(); | 330 ASSERT_NOT_REACHED(); |
| 331 return IDBCursor::directionNext(); | 331 return IDBCursor::directionNext(); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace WebCore | 335 } // namespace WebCore |
| OLD | NEW |