| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 switch (m_cursorType) { | 261 switch (m_cursorType) { |
| 262 case IndexedDB::CursorKeyOnly: | 262 case IndexedDB::CursorKeyOnly: |
| 263 cursor = IDBCursor::create(std::move(backend), m_cursorDirection, this,
m_source.get(), m_transaction.get()); | 263 cursor = IDBCursor::create(std::move(backend), m_cursorDirection, this,
m_source.get(), m_transaction.get()); |
| 264 break; | 264 break; |
| 265 case IndexedDB::CursorKeyAndValue: | 265 case IndexedDB::CursorKeyAndValue: |
| 266 cursor = IDBCursorWithValue::create(std::move(backend), m_cursorDirectio
n, this, m_source.get(), m_transaction.get()); | 266 cursor = IDBCursorWithValue::create(std::move(backend), m_cursorDirectio
n, this, m_source.get(), m_transaction.get()); |
| 267 break; | 267 break; |
| 268 default: | 268 default: |
| 269 ASSERT_NOT_REACHED(); | 269 ASSERT_NOT_REACHED(); |
| 270 } | 270 } |
| 271 setResultCursor(cursor, key, primaryKey, value); | 271 setResultCursor(cursor, key, primaryKey, std::move(value)); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void IDBRequest::onSuccess(IDBKey* idbKey) | 274 void IDBRequest::onSuccess(IDBKey* idbKey) |
| 275 { | 275 { |
| 276 IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); | 276 IDB_TRACE("IDBRequest::onSuccess(IDBKey)"); |
| 277 if (!shouldEnqueueEvent()) | 277 if (!shouldEnqueueEvent()) |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 if (idbKey && idbKey->isValid()) | 280 if (idbKey && idbKey->isValid()) |
| 281 onSuccessInternal(IDBAny::create(idbKey)); | 281 onSuccessInternal(IDBAny::create(idbKey)); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 m_resultDirty = true; | 363 m_resultDirty = true; |
| 364 } | 364 } |
| 365 | 365 |
| 366 void IDBRequest::onSuccess(IDBKey* key, IDBKey* primaryKey, PassRefPtr<IDBValue>
value) | 366 void IDBRequest::onSuccess(IDBKey* key, IDBKey* primaryKey, PassRefPtr<IDBValue>
value) |
| 367 { | 367 { |
| 368 IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)"); | 368 IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)"); |
| 369 if (!shouldEnqueueEvent()) | 369 if (!shouldEnqueueEvent()) |
| 370 return; | 370 return; |
| 371 | 371 |
| 372 ASSERT(m_pendingCursor); | 372 ASSERT(m_pendingCursor); |
| 373 setResultCursor(m_pendingCursor.release(), key, primaryKey, value); | 373 setResultCursor(m_pendingCursor.release(), key, primaryKey, std::move(value)
); |
| 374 } | 374 } |
| 375 | 375 |
| 376 bool IDBRequest::hasPendingActivity() const | 376 bool IDBRequest::hasPendingActivity() const |
| 377 { | 377 { |
| 378 // FIXME: In an ideal world, we should return true as long as anyone has a o
r can | 378 // FIXME: In an ideal world, we should return true as long as anyone has a o
r can |
| 379 // get a handle to us and we have event listeners. This is order to h
andle | 379 // get a handle to us and we have event listeners. This is order to h
andle |
| 380 // user generated events properly. | 380 // user generated events properly. |
| 381 return m_hasPendingActivity && !m_contextStopped; | 381 return m_hasPendingActivity && !m_contextStopped; |
| 382 } | 382 } |
| 383 | 383 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 535 |
| 536 void IDBRequest::dequeueEvent(Event* event) | 536 void IDBRequest::dequeueEvent(Event* event) |
| 537 { | 537 { |
| 538 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 538 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 539 if (m_enqueuedEvents[i].get() == event) | 539 if (m_enqueuedEvents[i].get() == event) |
| 540 m_enqueuedEvents.remove(i); | 540 m_enqueuedEvents.remove(i); |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace blink | 544 } // namespace blink |
| OLD | NEW |