| 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 21 matching lines...) Expand all Loading... |
| 32 #include "bindings/v8/ExceptionState.h" | 32 #include "bindings/v8/ExceptionState.h" |
| 33 #include "bindings/v8/ExceptionStatePlaceholder.h" | 33 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 34 #include "bindings/v8/IDBBindingUtilities.h" | 34 #include "bindings/v8/IDBBindingUtilities.h" |
| 35 #include "core/dom/ExecutionContext.h" | 35 #include "core/dom/ExecutionContext.h" |
| 36 #include "core/events/EventQueue.h" | 36 #include "core/events/EventQueue.h" |
| 37 #include "modules/indexeddb/IDBCursorWithValue.h" | 37 #include "modules/indexeddb/IDBCursorWithValue.h" |
| 38 #include "modules/indexeddb/IDBDatabase.h" | 38 #include "modules/indexeddb/IDBDatabase.h" |
| 39 #include "modules/indexeddb/IDBEventDispatcher.h" | 39 #include "modules/indexeddb/IDBEventDispatcher.h" |
| 40 #include "modules/indexeddb/IDBTracing.h" | 40 #include "modules/indexeddb/IDBTracing.h" |
| 41 #include "platform/SharedBuffer.h" | 41 #include "platform/SharedBuffer.h" |
| 42 #include "public/platform/WebBlobInfo.h" |
| 42 | 43 |
| 43 using blink::WebIDBCursor; | 44 using blink::WebIDBCursor; |
| 44 | 45 |
| 45 namespace WebCore { | 46 namespace WebCore { |
| 46 | 47 |
| 47 PassRefPtrWillBeRawPtr<IDBRequest> IDBRequest::create(ExecutionContext* context,
PassRefPtrWillBeRawPtr<IDBAny> source, IDBTransaction* transaction) | 48 PassRefPtrWillBeRawPtr<IDBRequest> IDBRequest::create(ExecutionContext* context,
PassRefPtrWillBeRawPtr<IDBAny> source, IDBTransaction* transaction) |
| 48 { | 49 { |
| 49 RefPtrWillBeRawPtr<IDBRequest> request(adoptRefWillBeRefCountedGarbageCollec
ted(new IDBRequest(context, source, transaction))); | 50 RefPtrWillBeRawPtr<IDBRequest> request(adoptRefWillBeRefCountedGarbageCollec
ted(new IDBRequest(context, source, transaction))); |
| 50 request->suspendIfNeeded(); | 51 request->suspendIfNeeded(); |
| 51 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames
) are not associated with transactions. | 52 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames
) are not associated with transactions. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 , m_didFireUpgradeNeededEvent(false) | 70 , m_didFireUpgradeNeededEvent(false) |
| 70 , m_preventPropagation(false) | 71 , m_preventPropagation(false) |
| 71 , m_resultDirty(true) | 72 , m_resultDirty(true) |
| 72 { | 73 { |
| 73 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
| 74 } | 75 } |
| 75 | 76 |
| 76 IDBRequest::~IDBRequest() | 77 IDBRequest::~IDBRequest() |
| 77 { | 78 { |
| 78 ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionConte
xt()); | 79 ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionConte
xt()); |
| 80 handleBlobAcks(); |
| 79 } | 81 } |
| 80 | 82 |
| 81 void IDBRequest::trace(Visitor* visitor) | 83 void IDBRequest::trace(Visitor* visitor) |
| 82 { | 84 { |
| 83 visitor->trace(m_source); | 85 visitor->trace(m_source); |
| 84 visitor->trace(m_result); | 86 visitor->trace(m_result); |
| 85 visitor->trace(m_error); | 87 visitor->trace(m_error); |
| 86 visitor->trace(m_enqueuedEvents); | 88 visitor->trace(m_enqueuedEvents); |
| 87 visitor->trace(m_pendingCursor); | 89 visitor->trace(m_pendingCursor); |
| 88 } | 90 } |
| 89 | 91 |
| 90 ScriptValue IDBRequest::result(ExceptionState& exceptionState) | 92 ScriptValue IDBRequest::result(ExceptionState& exceptionState) |
| 91 { | 93 { |
| 92 if (m_readyState != DONE) { | 94 if (m_readyState != DONE) { |
| 93 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); | 95 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); |
| 94 return ScriptValue(); | 96 return ScriptValue(); |
| 95 } | 97 } |
| 96 if (m_contextStopped || !executionContext()) | 98 if (m_contextStopped || !executionContext()) |
| 97 return ScriptValue(); | 99 return ScriptValue(); |
| 98 m_resultDirty = false; | 100 m_resultDirty = false; |
| 99 return idbAnyToScriptValue(m_scriptState.get(), m_result); | 101 ScriptValue value = idbAnyToScriptValue(m_scriptState.get(), m_result); |
| 102 handleBlobAcks(); |
| 103 return value; |
| 100 } | 104 } |
| 101 | 105 |
| 102 PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionStat
e) const | 106 PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionStat
e) const |
| 103 { | 107 { |
| 104 if (m_readyState != DONE) { | 108 if (m_readyState != DONE) { |
| 105 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); | 109 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); |
| 106 return nullptr; | 110 return nullptr; |
| 107 } | 111 } |
| 108 return m_error; | 112 return m_error; |
| 109 } | 113 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 { | 185 { |
| 182 if (!m_result) | 186 if (!m_result) |
| 183 return 0; | 187 return 0; |
| 184 if (m_result->type() == IDBAny::IDBCursorType) | 188 if (m_result->type() == IDBAny::IDBCursorType) |
| 185 return m_result->idbCursor(); | 189 return m_result->idbCursor(); |
| 186 if (m_result->type() == IDBAny::IDBCursorWithValueType) | 190 if (m_result->type() == IDBAny::IDBCursorWithValueType) |
| 187 return m_result->idbCursorWithValue(); | 191 return m_result->idbCursorWithValue(); |
| 188 return 0; | 192 return 0; |
| 189 } | 193 } |
| 190 | 194 |
| 191 void IDBRequest::setResultCursor(PassRefPtrWillBeRawPtr<IDBCursor> cursor, PassR
efPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value
) | 195 void IDBRequest::setResultCursor(PassRefPtrWillBeRawPtr<IDBCursor> cursor, PassR
efPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value
, PassOwnPtr<Vector<blink::WebBlobInfo> > blobInfo) |
| 192 { | 196 { |
| 193 ASSERT(m_readyState == PENDING); | 197 ASSERT(m_readyState == PENDING); |
| 194 m_cursorKey = key; | 198 m_cursorKey = key; |
| 195 m_cursorPrimaryKey = primaryKey; | 199 m_cursorPrimaryKey = primaryKey; |
| 196 m_cursorValue = value; | 200 m_cursorValue = value; |
| 201 ASSERT(!m_blobInfo.get()); |
| 202 m_blobInfo = blobInfo; |
| 197 | 203 |
| 198 onSuccessInternal(IDBAny::create(cursor)); | 204 onSuccessInternal(IDBAny::create(cursor)); |
| 199 } | 205 } |
| 200 | 206 |
| 201 #if !ENABLE(OILPAN) | 207 #if !ENABLE(OILPAN) |
| 202 void IDBRequest::checkForReferenceCycle() | 208 void IDBRequest::checkForReferenceCycle() |
| 203 { | 209 { |
| 204 // If this request and its cursor have the only references | 210 // If this request and its cursor have the only references |
| 205 // to each other, then explicitly break the cycle. | 211 // to each other, then explicitly break the cycle. |
| 206 IDBCursor* cursor = getResultCursor(); | 212 IDBCursor* cursor = getResultCursor(); |
| 207 if (!cursor || cursor->request() != this) | 213 if (!cursor || cursor->request() != this) |
| 208 return; | 214 return; |
| 209 | 215 |
| 210 if (!hasOneRef() || !cursor->hasOneRef()) | 216 if (!hasOneRef() || !cursor->hasOneRef()) |
| 211 return; | 217 return; |
| 212 | 218 |
| 213 m_result.clear(); | 219 m_result.clear(); |
| 214 } | 220 } |
| 215 #endif | 221 #endif |
| 216 | 222 |
| 223 void IDBRequest::handleBlobAcks() |
| 224 { |
| 225 if (m_blobInfo.get() && m_blobInfo->size()) { |
| 226 m_transaction->db()->ackReceivedBlobs(m_blobInfo.get()); |
| 227 m_blobInfo.clear(); |
| 228 } |
| 229 } |
| 230 |
| 217 bool IDBRequest::shouldEnqueueEvent() const | 231 bool IDBRequest::shouldEnqueueEvent() const |
| 218 { | 232 { |
| 219 if (m_contextStopped || !executionContext()) | 233 if (m_contextStopped || !executionContext()) |
| 220 return false; | 234 return false; |
| 221 ASSERT(m_readyState == PENDING || m_readyState == DONE); | 235 ASSERT(m_readyState == PENDING || m_readyState == DONE); |
| 222 if (m_requestAborted) | 236 if (m_requestAborted) |
| 223 return false; | 237 return false; |
| 224 ASSERT(m_readyState == PENDING); | 238 ASSERT(m_readyState == PENDING); |
| 225 ASSERT(!m_error && !m_result); | 239 ASSERT(!m_error && !m_result); |
| 226 return true; | 240 return true; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 242 IDB_TRACE("IDBRequest::onSuccess(StringList)"); | 256 IDB_TRACE("IDBRequest::onSuccess(StringList)"); |
| 243 if (!shouldEnqueueEvent()) | 257 if (!shouldEnqueueEvent()) |
| 244 return; | 258 return; |
| 245 | 259 |
| 246 RefPtr<DOMStringList> domStringList = DOMStringList::create(); | 260 RefPtr<DOMStringList> domStringList = DOMStringList::create(); |
| 247 for (size_t i = 0; i < stringList.size(); ++i) | 261 for (size_t i = 0; i < stringList.size(); ++i) |
| 248 domStringList->append(stringList[i]); | 262 domStringList->append(stringList[i]); |
| 249 onSuccessInternal(IDBAny::create(domStringList.release())); | 263 onSuccessInternal(IDBAny::create(domStringList.release())); |
| 250 } | 264 } |
| 251 | 265 |
| 252 void IDBRequest::onSuccess(PassOwnPtr<blink::WebIDBCursor> backend, PassRefPtr<I
DBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value) | 266 void IDBRequest::onSuccess(PassOwnPtr<blink::WebIDBCursor> backend, PassRefPtr<I
DBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value, PassO
wnPtr<Vector<blink::WebBlobInfo> > blobInfo) |
| 253 { | 267 { |
| 254 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)"); | 268 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)"); |
| 255 if (!shouldEnqueueEvent()) | 269 if (!shouldEnqueueEvent()) |
| 256 return; | 270 return; |
| 257 | 271 |
| 258 ASSERT(!m_pendingCursor); | 272 ASSERT(!m_pendingCursor); |
| 259 RefPtrWillBeRawPtr<IDBCursor> cursor = nullptr; | 273 RefPtrWillBeRawPtr<IDBCursor> cursor = nullptr; |
| 260 switch (m_cursorType) { | 274 switch (m_cursorType) { |
| 261 case IndexedDB::CursorKeyOnly: | 275 case IndexedDB::CursorKeyOnly: |
| 262 cursor = IDBCursor::create(backend, m_cursorDirection, this, m_source.ge
t(), m_transaction.get()); | 276 cursor = IDBCursor::create(backend, m_cursorDirection, this, m_source.ge
t(), m_transaction.get()); |
| 263 break; | 277 break; |
| 264 case IndexedDB::CursorKeyAndValue: | 278 case IndexedDB::CursorKeyAndValue: |
| 265 cursor = IDBCursorWithValue::create(backend, m_cursorDirection, this, m_
source.get(), m_transaction.get()); | 279 cursor = IDBCursorWithValue::create(backend, m_cursorDirection, this, m_
source.get(), m_transaction.get()); |
| 266 break; | 280 break; |
| 267 default: | 281 default: |
| 268 ASSERT_NOT_REACHED(); | 282 ASSERT_NOT_REACHED(); |
| 269 } | 283 } |
| 270 setResultCursor(cursor, key, primaryKey, value); | 284 setResultCursor(cursor, key, primaryKey, value, blobInfo); |
| 271 } | 285 } |
| 272 | 286 |
| 273 void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey) | 287 void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey) |
| 274 { | 288 { |
| 275 IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); | 289 IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); |
| 276 if (!shouldEnqueueEvent()) | 290 if (!shouldEnqueueEvent()) |
| 277 return; | 291 return; |
| 278 | 292 |
| 279 if (idbKey && idbKey->isValid()) | 293 if (idbKey && idbKey->isValid()) |
| 280 onSuccessInternal(IDBAny::create(idbKey)); | 294 onSuccessInternal(IDBAny::create(idbKey)); |
| 281 else | 295 else |
| 282 onSuccessInternal(IDBAny::createUndefined()); | 296 onSuccessInternal(IDBAny::createUndefined()); |
| 283 } | 297 } |
| 284 | 298 |
| 285 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer) | 299 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassOwnPtr<Vect
or<blink::WebBlobInfo> > blobInfo) |
| 286 { | 300 { |
| 287 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer)"); | 301 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer)"); |
| 288 if (!shouldEnqueueEvent()) | 302 if (!shouldEnqueueEvent()) |
| 289 return; | 303 return; |
| 290 | 304 |
| 291 if (m_pendingCursor) { | 305 if (m_pendingCursor) { |
| 292 // Value should be null, signifying the end of the cursor's range. | 306 // Value should be null, signifying the end of the cursor's range. |
| 293 ASSERT(!valueBuffer.get()); | 307 ASSERT(!valueBuffer.get()); |
| 308 ASSERT(!blobInfo->size()); |
| 294 m_pendingCursor->close(); | 309 m_pendingCursor->close(); |
| 295 m_pendingCursor.clear(); | 310 m_pendingCursor.clear(); |
| 296 } | 311 } |
| 297 | 312 |
| 298 onSuccessInternal(IDBAny::create(valueBuffer)); | 313 ASSERT(!m_blobInfo.get()); |
| 314 m_blobInfo = blobInfo; |
| 315 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get())); |
| 299 } | 316 } |
| 300 | 317 |
| 301 #ifndef NDEBUG | 318 #ifndef NDEBUG |
| 302 static PassRefPtr<IDBObjectStore> effectiveObjectStore(PassRefPtrWillBeRawPtr<ID
BAny> source) | 319 static PassRefPtr<IDBObjectStore> effectiveObjectStore(PassRefPtrWillBeRawPtr<ID
BAny> source) |
| 303 { | 320 { |
| 304 if (source->type() == IDBAny::IDBObjectStoreType) | 321 if (source->type() == IDBAny::IDBObjectStoreType) |
| 305 return source->idbObjectStore(); | 322 return source->idbObjectStore(); |
| 306 if (source->type() == IDBAny::IDBIndexType) | 323 if (source->type() == IDBAny::IDBIndexType) |
| 307 return source->idbIndex()->objectStore(); | 324 return source->idbIndex()->objectStore(); |
| 308 | 325 |
| 309 ASSERT_NOT_REACHED(); | 326 ASSERT_NOT_REACHED(); |
| 310 return nullptr; | 327 return nullptr; |
| 311 } | 328 } |
| 312 #endif | 329 #endif |
| 313 | 330 |
| 314 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassRefPtr<I
DBKey> prpPrimaryKey, const IDBKeyPath& keyPath) | 331 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassOwnPtr<V
ector<blink::WebBlobInfo> > blobInfo, PassRefPtr<IDBKey> prpPrimaryKey, const ID
BKeyPath& keyPath) |
| 315 { | 332 { |
| 316 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); | 333 IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)"); |
| 317 if (!shouldEnqueueEvent()) | 334 if (!shouldEnqueueEvent()) |
| 318 return; | 335 return; |
| 319 | 336 |
| 320 #ifndef NDEBUG | 337 #ifndef NDEBUG |
| 321 ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); | 338 ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath); |
| 322 #endif | 339 #endif |
| 323 | 340 |
| 324 RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; | 341 RefPtr<SharedBuffer> valueBuffer = prpValueBuffer; |
| 325 RefPtr<IDBKey> primaryKey = prpPrimaryKey; | 342 RefPtr<IDBKey> primaryKey = prpPrimaryKey; |
| 343 ASSERT(!m_blobInfo.get()); |
| 344 m_blobInfo = blobInfo; |
| 326 | 345 |
| 327 #ifndef NDEBUG | 346 #ifndef NDEBUG |
| 328 assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, primaryK
ey, keyPath); | 347 assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, m_blobIn
fo.get(), primaryKey, keyPath); |
| 329 #endif | 348 #endif |
| 330 | 349 |
| 331 onSuccessInternal(IDBAny::create(valueBuffer, primaryKey, keyPath)); | 350 onSuccessInternal(IDBAny::create(valueBuffer, m_blobInfo.get(), primaryKey,
keyPath)); |
| 332 } | 351 } |
| 333 | 352 |
| 334 void IDBRequest::onSuccess(int64_t value) | 353 void IDBRequest::onSuccess(int64_t value) |
| 335 { | 354 { |
| 336 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); | 355 IDB_TRACE("IDBRequest::onSuccess(int64_t)"); |
| 337 if (!shouldEnqueueEvent()) | 356 if (!shouldEnqueueEvent()) |
| 338 return; | 357 return; |
| 339 onSuccessInternal(IDBAny::create(value)); | 358 onSuccessInternal(IDBAny::create(value)); |
| 340 } | 359 } |
| 341 | 360 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 354 setResult(result); | 373 setResult(result); |
| 355 enqueueEvent(Event::create(EventTypeNames::success)); | 374 enqueueEvent(Event::create(EventTypeNames::success)); |
| 356 } | 375 } |
| 357 | 376 |
| 358 void IDBRequest::setResult(PassRefPtrWillBeRawPtr<IDBAny> result) | 377 void IDBRequest::setResult(PassRefPtrWillBeRawPtr<IDBAny> result) |
| 359 { | 378 { |
| 360 m_result = result; | 379 m_result = result; |
| 361 m_resultDirty = true; | 380 m_resultDirty = true; |
| 362 } | 381 } |
| 363 | 382 |
| 364 void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey
, PassRefPtr<SharedBuffer> value) | 383 void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey
, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> > blobIn
fo) |
| 365 { | 384 { |
| 366 IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)"); | 385 IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)"); |
| 367 if (!shouldEnqueueEvent()) | 386 if (!shouldEnqueueEvent()) |
| 368 return; | 387 return; |
| 369 | 388 |
| 370 ASSERT(m_pendingCursor); | 389 ASSERT(m_pendingCursor); |
| 371 setResultCursor(m_pendingCursor.release(), key, primaryKey, value); | 390 setResultCursor(m_pendingCursor.release(), key, primaryKey, value, blobInfo)
; |
| 372 } | 391 } |
| 373 | 392 |
| 374 bool IDBRequest::hasPendingActivity() const | 393 bool IDBRequest::hasPendingActivity() const |
| 375 { | 394 { |
| 376 // FIXME: In an ideal world, we should return true as long as anyone has a o
r can | 395 // FIXME: In an ideal world, we should return true as long as anyone has a o
r can |
| 377 // get a handle to us and we have event listeners. This is order to h
andle | 396 // get a handle to us and we have event listeners. This is order to h
andle |
| 378 // user generated events properly. | 397 // user generated events properly. |
| 379 return m_hasPendingActivity && !m_contextStopped; | 398 return m_hasPendingActivity && !m_contextStopped; |
| 380 } | 399 } |
| 381 | 400 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // this object to actually hold a reference to the database (to ensure | 459 // this object to actually hold a reference to the database (to ensure |
| 441 // it stays alive). | 460 // it stays alive). |
| 442 targets.append(m_transaction->db()); | 461 targets.append(m_transaction->db()); |
| 443 } | 462 } |
| 444 | 463 |
| 445 // Cursor properties should not be updated until the success event is being
dispatched. | 464 // Cursor properties should not be updated until the success event is being
dispatched. |
| 446 RefPtrWillBeRawPtr<IDBCursor> cursorToNotify = nullptr; | 465 RefPtrWillBeRawPtr<IDBCursor> cursorToNotify = nullptr; |
| 447 if (event->type() == EventTypeNames::success) { | 466 if (event->type() == EventTypeNames::success) { |
| 448 cursorToNotify = getResultCursor(); | 467 cursorToNotify = getResultCursor(); |
| 449 if (cursorToNotify) | 468 if (cursorToNotify) |
| 450 cursorToNotify->setValueReady(m_cursorKey.release(), m_cursorPrimary
Key.release(), m_cursorValue.release()); | 469 cursorToNotify->setValueReady(m_cursorKey.release(), m_cursorPrimary
Key.release(), m_cursorValue.release(), m_blobInfo.release()); |
| 451 } | 470 } |
| 452 | 471 |
| 453 if (event->type() == EventTypeNames::upgradeneeded) { | 472 if (event->type() == EventTypeNames::upgradeneeded) { |
| 454 ASSERT(!m_didFireUpgradeNeededEvent); | 473 ASSERT(!m_didFireUpgradeNeededEvent); |
| 455 m_didFireUpgradeNeededEvent = true; | 474 m_didFireUpgradeNeededEvent = true; |
| 456 } | 475 } |
| 457 | 476 |
| 458 // FIXME: When we allow custom event dispatching, this will probably need to
change. | 477 // FIXME: When we allow custom event dispatching, this will probably need to
change. |
| 459 ASSERT_WITH_MESSAGE(event->type() == EventTypeNames::success || event->type(
) == EventTypeNames::error || event->type() == EventTypeNames::blocked || event-
>type() == EventTypeNames::upgradeneeded, "event type was %s", event->type().utf
8().data()); | 478 ASSERT_WITH_MESSAGE(event->type() == EventTypeNames::success || event->type(
) == EventTypeNames::error || event->type() == EventTypeNames::blocked || event-
>type() == EventTypeNames::upgradeneeded, "event type was %s", event->type().utf
8().data()); |
| 460 const bool setTransactionActive = m_transaction && (event->type() == EventTy
peNames::success || event->type() == EventTypeNames::upgradeneeded || (event->ty
pe() == EventTypeNames::error && !m_requestAborted)); | 479 const bool setTransactionActive = m_transaction && (event->type() == EventTy
peNames::success || event->type() == EventTypeNames::upgradeneeded || (event->ty
pe() == EventTypeNames::error && !m_requestAborted)); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 554 |
| 536 void IDBRequest::dequeueEvent(Event* event) | 555 void IDBRequest::dequeueEvent(Event* event) |
| 537 { | 556 { |
| 538 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 557 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 539 if (m_enqueuedEvents[i].get() == event) | 558 if (m_enqueuedEvents[i].get() == event) |
| 540 m_enqueuedEvents.remove(i); | 559 m_enqueuedEvents.remove(i); |
| 541 } | 560 } |
| 542 } | 561 } |
| 543 | 562 |
| 544 } // namespace WebCore | 563 } // namespace WebCore |
| OLD | NEW |