| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 m_error = DOMError::create(IDBDatabaseException::getErrorName(error->idbCode
())); | 268 m_error = DOMError::create(IDBDatabaseException::getErrorName(error->idbCode
())); |
| 269 m_pendingCursor.clear(); | 269 m_pendingCursor.clear(); |
| 270 enqueueEvent(Event::create(eventNames().errorEvent, true, true)); | 270 enqueueEvent(Event::create(eventNames().errorEvent, true, true)); |
| 271 } | 271 } |
| 272 | 272 |
| 273 static PassRefPtr<Event> createSuccessEvent() | 273 static PassRefPtr<Event> createSuccessEvent() |
| 274 { | 274 { |
| 275 return Event::create(eventNames().successEvent, false, false); | 275 return Event::create(eventNames().successEvent, false, false); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void IDBRequest::onSuccess(PassRefPtr<DOMStringList> domStringList) | 278 void IDBRequest::onSuccess(const Vector<String>& stringList) |
| 279 { | 279 { |
| 280 IDB_TRACE("IDBRequest::onSuccess(DOMStringList)"); | 280 IDB_TRACE("IDBRequest::onSuccess(StringList)"); |
| 281 if (!shouldEnqueueEvent()) | 281 if (!shouldEnqueueEvent()) |
| 282 return; | 282 return; |
| 283 | 283 |
| 284 m_result = IDBAny::create(domStringList); | 284 RefPtr<DOMStringList> domStringList = DOMStringList::create(); |
| 285 for (size_t i = 0; i < stringList.size(); ++i) |
| 286 domStringList->append(stringList[i]); |
| 287 m_result = IDBAny::create(domStringList.release()); |
| 285 enqueueEvent(createSuccessEvent()); | 288 enqueueEvent(createSuccessEvent()); |
| 286 } | 289 } |
| 287 | 290 |
| 288 void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend, PassRe
fPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> buffer
) | 291 void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend, PassRe
fPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> buffer
) |
| 289 { | 292 { |
| 290 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)"); | 293 IDB_TRACE("IDBRequest::onSuccess(IDBCursor)"); |
| 291 if (!shouldEnqueueEvent()) | 294 if (!shouldEnqueueEvent()) |
| 292 return; | 295 return; |
| 293 | 296 |
| 294 DOMRequestState::Scope scope(m_requestState); | 297 DOMRequestState::Scope scope(m_requestState); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 { | 567 { |
| 565 return &m_eventTargetData; | 568 return &m_eventTargetData; |
| 566 } | 569 } |
| 567 | 570 |
| 568 EventTargetData* IDBRequest::ensureEventTargetData() | 571 EventTargetData* IDBRequest::ensureEventTargetData() |
| 569 { | 572 { |
| 570 return &m_eventTargetData; | 573 return &m_eventTargetData; |
| 571 } | 574 } |
| 572 | 575 |
| 573 } // namespace WebCore | 576 } // namespace WebCore |
| OLD | NEW |