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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 ? nullptr | 212 ? nullptr |
213 : ScriptValue::To<IDBKey*>(script_state->GetIsolate(), | 213 : ScriptValue::To<IDBKey*>(script_state->GetIsolate(), |
214 key_value, exception_state); | 214 key_value, exception_state); |
215 if (exception_state.HadException()) | 215 if (exception_state.HadException()) |
216 return; | 216 return; |
217 if (key && !key->IsValid()) { | 217 if (key && !key->IsValid()) { |
218 exception_state.ThrowDOMException(kDataError, | 218 exception_state.ThrowDOMException(kDataError, |
219 IDBDatabase::kNotValidKeyErrorMessage); | 219 IDBDatabase::kNotValidKeyErrorMessage); |
220 return; | 220 return; |
221 } | 221 } |
222 continueFunction(key, nullptr, exception_state); | 222 Continue(key, nullptr, exception_state); |
223 } | 223 } |
224 | 224 |
225 void IDBCursor::continuePrimaryKey(ScriptState* script_state, | 225 void IDBCursor::continuePrimaryKey(ScriptState* script_state, |
226 const ScriptValue& key_value, | 226 const ScriptValue& key_value, |
227 const ScriptValue& primary_key_value, | 227 const ScriptValue& primary_key_value, |
228 ExceptionState& exception_state) { | 228 ExceptionState& exception_state) { |
229 IDB_TRACE("IDBCursor::continuePrimaryKey"); | 229 IDB_TRACE("IDBCursor::continuePrimaryKey"); |
230 | 230 |
231 if (transaction_->IsFinished() || transaction_->IsFinishing()) { | 231 if (transaction_->IsFinished() || transaction_->IsFinishing()) { |
232 exception_state.ThrowDOMException( | 232 exception_state.ThrowDOMException( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 IDBKey* primary_key = ScriptValue::To<IDBKey*>( | 279 IDBKey* primary_key = ScriptValue::To<IDBKey*>( |
280 script_state->GetIsolate(), primary_key_value, exception_state); | 280 script_state->GetIsolate(), primary_key_value, exception_state); |
281 if (exception_state.HadException()) | 281 if (exception_state.HadException()) |
282 return; | 282 return; |
283 if (!primary_key->IsValid()) { | 283 if (!primary_key->IsValid()) { |
284 exception_state.ThrowDOMException(kDataError, | 284 exception_state.ThrowDOMException(kDataError, |
285 IDBDatabase::kNotValidKeyErrorMessage); | 285 IDBDatabase::kNotValidKeyErrorMessage); |
286 return; | 286 return; |
287 } | 287 } |
288 | 288 |
289 continueFunction(key, primary_key, exception_state); | 289 Continue(key, primary_key, exception_state); |
290 } | 290 } |
291 | 291 |
292 void IDBCursor::continueFunction(IDBKey* key, | 292 void IDBCursor::Continue(IDBKey* key, |
293 IDBKey* primary_key, | 293 IDBKey* primary_key, |
294 ExceptionState& exception_state) { | 294 ExceptionState& exception_state) { |
295 DCHECK(transaction_->IsActive()); | 295 DCHECK(transaction_->IsActive()); |
296 DCHECK(got_value_); | 296 DCHECK(got_value_); |
297 DCHECK(!IsDeleted()); | 297 DCHECK(!IsDeleted()); |
298 DCHECK(!primary_key || (key && primary_key)); | 298 DCHECK(!primary_key || (key && primary_key)); |
299 | 299 |
300 if (key) { | 300 if (key) { |
301 DCHECK(key_); | 301 DCHECK(key_); |
302 if (direction_ == kWebIDBCursorDirectionNext || | 302 if (direction_ == kWebIDBCursorDirectionNext || |
303 direction_ == kWebIDBCursorDirectionNextNoDuplicate) { | 303 direction_ == kWebIDBCursorDirectionNextNoDuplicate) { |
304 const bool ok = | 304 const bool ok = |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 case kWebIDBCursorDirectionPrevNoDuplicate: | 493 case kWebIDBCursorDirectionPrevNoDuplicate: |
494 return IndexedDBNames::prevunique; | 494 return IndexedDBNames::prevunique; |
495 | 495 |
496 default: | 496 default: |
497 NOTREACHED(); | 497 NOTREACHED(); |
498 return IndexedDBNames::next; | 498 return IndexedDBNames::next; |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 } // namespace blink | 502 } // namespace blink |
OLD | NEW |