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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 if (m_transaction->isReadOnly()) { | 116 if (m_transaction->isReadOnly()) { |
117 exceptionState.throwDOMException(ReadOnlyError, "The record may not be u
pdated inside a read-only transaction."); | 117 exceptionState.throwDOMException(ReadOnlyError, "The record may not be u
pdated inside a read-only transaction."); |
118 return 0; | 118 return 0; |
119 } | 119 } |
120 | 120 |
121 IDBObjectStore* objectStore = effectiveObjectStore(); | 121 IDBObjectStore* objectStore = effectiveObjectStore(); |
122 return objectStore->put(scriptState, WebIDBPutModeCursorUpdate, IDBAny::crea
te(this), value, m_primaryKey, exceptionState); | 122 return objectStore->put(scriptState, WebIDBPutModeCursorUpdate, IDBAny::crea
te(this), value, m_primaryKey, exceptionState); |
123 } | 123 } |
124 | 124 |
125 void IDBCursor::advance(unsigned long count, ExceptionState& exceptionState) | 125 void IDBCursor::advance(unsigned count, ExceptionState& exceptionState) |
126 { | 126 { |
127 IDB_TRACE("IDBCursor::advance"); | 127 IDB_TRACE("IDBCursor::advance"); |
128 if (!count) { | 128 if (!count) { |
129 exceptionState.throwTypeError("A count argument with value 0 (zero) was
supplied, must be greater than 0."); | 129 exceptionState.throwTypeError("A count argument with value 0 (zero) was
supplied, must be greater than 0."); |
130 return; | 130 return; |
131 } | 131 } |
132 if (!m_gotValue) { | 132 if (!m_gotValue) { |
133 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValue
ErrorMessage); | 133 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValue
ErrorMessage); |
134 return; | 134 return; |
135 } | 135 } |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 case WebIDBCursorDirectionPrevNoDuplicate: | 393 case WebIDBCursorDirectionPrevNoDuplicate: |
394 return IndexedDBNames::prevunique; | 394 return IndexedDBNames::prevunique; |
395 | 395 |
396 default: | 396 default: |
397 ASSERT_NOT_REACHED(); | 397 ASSERT_NOT_REACHED(); |
398 return IndexedDBNames::next; | 398 return IndexedDBNames::next; |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 } // namespace blink | 402 } // namespace blink |
OLD | NEW |