| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 m_pendingCursor = cursor; | 179 m_pendingCursor = cursor; |
| 180 setResult(nullptr); | 180 setResult(nullptr); |
| 181 m_readyState = PENDING; | 181 m_readyState = PENDING; |
| 182 m_error.clear(); | 182 m_error.clear(); |
| 183 m_transaction->registerRequest(this); | 183 m_transaction->registerRequest(this); |
| 184 } | 184 } |
| 185 | 185 |
| 186 IDBCursor* IDBRequest::getResultCursor() const | 186 IDBCursor* IDBRequest::getResultCursor() const |
| 187 { | 187 { |
| 188 if (!m_result) | 188 if (!m_result) |
| 189 return 0; | 189 return nullptr; |
| 190 if (m_result->type() == IDBAny::IDBCursorType) | 190 if (m_result->type() == IDBAny::IDBCursorType) |
| 191 return m_result->idbCursor(); | 191 return m_result->idbCursor(); |
| 192 if (m_result->type() == IDBAny::IDBCursorWithValueType) | 192 if (m_result->type() == IDBAny::IDBCursorWithValueType) |
| 193 return m_result->idbCursorWithValue(); | 193 return m_result->idbCursorWithValue(); |
| 194 return 0; | 194 return nullptr; |
| 195 } | 195 } |
| 196 | 196 |
| 197 void IDBRequest::setResultCursor(IDBCursor* cursor, IDBKey* key, IDBKey* primary
Key, PassRefPtr<IDBValue> value) | 197 void IDBRequest::setResultCursor(IDBCursor* cursor, IDBKey* key, IDBKey* primary
Key, PassRefPtr<IDBValue> value) |
| 198 { | 198 { |
| 199 ASSERT(m_readyState == PENDING); | 199 ASSERT(m_readyState == PENDING); |
| 200 m_cursorKey = key; | 200 m_cursorKey = key; |
| 201 m_cursorPrimaryKey = primaryKey; | 201 m_cursorPrimaryKey = primaryKey; |
| 202 m_cursorValue = value; | 202 m_cursorValue = value; |
| 203 ackReceivedBlobs(m_cursorValue.get()); | 203 ackReceivedBlobs(m_cursorValue.get()); |
| 204 | 204 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 #if ENABLE(ASSERT) | 302 #if ENABLE(ASSERT) |
| 303 static IDBObjectStore* effectiveObjectStore(IDBAny* source) | 303 static IDBObjectStore* effectiveObjectStore(IDBAny* source) |
| 304 { | 304 { |
| 305 if (source->type() == IDBAny::IDBObjectStoreType) | 305 if (source->type() == IDBAny::IDBObjectStoreType) |
| 306 return source->idbObjectStore(); | 306 return source->idbObjectStore(); |
| 307 if (source->type() == IDBAny::IDBIndexType) | 307 if (source->type() == IDBAny::IDBIndexType) |
| 308 return source->idbIndex()->objectStore(); | 308 return source->idbIndex()->objectStore(); |
| 309 | 309 |
| 310 ASSERT_NOT_REACHED(); | 310 ASSERT_NOT_REACHED(); |
| 311 return 0; | 311 return nullptr; |
| 312 } | 312 } |
| 313 #endif | 313 #endif |
| 314 | 314 |
| 315 void IDBRequest::onSuccess(PassRefPtr<IDBValue> prpValue) | 315 void IDBRequest::onSuccess(PassRefPtr<IDBValue> prpValue) |
| 316 { | 316 { |
| 317 IDB_TRACE("IDBRequest::onSuccess(IDBValue)"); | 317 IDB_TRACE("IDBRequest::onSuccess(IDBValue)"); |
| 318 if (!shouldEnqueueEvent()) | 318 if (!shouldEnqueueEvent()) |
| 319 return; | 319 return; |
| 320 | 320 |
| 321 RefPtr<IDBValue> value(prpValue); | 321 RefPtr<IDBValue> value(prpValue); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 void IDBRequest::dequeueEvent(Event* event) | 542 void IDBRequest::dequeueEvent(Event* event) |
| 543 { | 543 { |
| 544 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 544 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 545 if (m_enqueuedEvents[i].get() == event) | 545 if (m_enqueuedEvents[i].get() == event) |
| 546 m_enqueuedEvents.remove(i); | 546 m_enqueuedEvents.remove(i); |
| 547 } | 547 } |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace blink | 550 } // namespace blink |
| OLD | NEW |