| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 { | 46 { |
| 47 return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, IDBDatabase
BackendInterface::NormalTask, transaction, objectStoreId)); | 47 return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, IDBDatabase
BackendInterface::NormalTask, transaction, objectStoreId)); |
| 48 } | 48 } |
| 49 static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBBackingStore::C
ursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::Ta
skType taskType, IDBTransactionBackendImpl* transaction, int64_t objectStoreId) | 49 static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBBackingStore::C
ursor> cursor, IndexedDB::CursorType cursorType, IDBDatabaseBackendInterface::Ta
skType taskType, IDBTransactionBackendImpl* transaction, int64_t objectStoreId) |
| 50 { | 50 { |
| 51 return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, taskType, t
ransaction, objectStoreId)); | 51 return adoptRef(new IDBCursorBackendImpl(cursor, cursorType, taskType, t
ransaction, objectStoreId)); |
| 52 } | 52 } |
| 53 virtual ~IDBCursorBackendImpl(); | 53 virtual ~IDBCursorBackendImpl(); |
| 54 | 54 |
| 55 // IDBCursorBackendInterface | 55 // IDBCursorBackendInterface |
| 56 virtual void advance(unsigned long, PassRefPtr<IDBCallbacks>); | 56 virtual void advance(unsigned long, IDBCallbacks*); |
| 57 virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>); | 57 virtual void continueFunction(PassRefPtr<IDBKey>, IDBCallbacks*); |
| 58 virtual void deleteFunction(PassRefPtr<IDBCallbacks>); | 58 virtual void deleteFunction(IDBCallbacks*); |
| 59 virtual void prefetchContinue(int numberToFetch, PassRefPtr<IDBCallbacks>); | 59 virtual void prefetchContinue(int numberToFetch, IDBCallbacks*); |
| 60 virtual void prefetchReset(int usedPrefetches, int unusedPrefetches); | 60 virtual void prefetchReset(int usedPrefetches, int unusedPrefetches); |
| 61 virtual void postSuccessHandlerCallback() { } | 61 virtual void postSuccessHandlerCallback() { } |
| 62 | 62 |
| 63 PassRefPtr<IDBKey> key() const { return m_cursor->key(); } | 63 PassRefPtr<IDBKey> key() const { return m_cursor->key(); } |
| 64 PassRefPtr<IDBKey> primaryKey() const { return m_cursor->primaryKey(); } | 64 PassRefPtr<IDBKey> primaryKey() const { return m_cursor->primaryKey(); } |
| 65 PassRefPtr<SharedBuffer> value() const { return (m_cursorType == IndexedDB::
CursorKeyOnly) ? 0 : m_cursor->value(); } | 65 PassRefPtr<SharedBuffer> value() const { return (m_cursorType == IndexedDB::
CursorKeyOnly) ? 0 : m_cursor->value(); } |
| 66 void close(); | 66 void close(); |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor>, IndexedDB::CursorT
ype, IDBDatabaseBackendInterface::TaskType, IDBTransactionBackendImpl*, int64_t
objectStoreId); | 69 IDBCursorBackendImpl(PassRefPtr<IDBBackingStore::Cursor>, IndexedDB::CursorT
ype, IDBDatabaseBackendInterface::TaskType, IDBTransactionBackendImpl*, int64_t
objectStoreId); |
| 70 | 70 |
| 71 class CursorIterationOperation; | 71 class CursorIterationOperation; |
| 72 class CursorAdvanceOperation; | 72 class CursorAdvanceOperation; |
| 73 class CursorPrefetchIterationOperation; | 73 class CursorPrefetchIterationOperation; |
| 74 | 74 |
| 75 IDBDatabaseBackendInterface::TaskType m_taskType; | 75 IDBDatabaseBackendInterface::TaskType m_taskType; |
| 76 IndexedDB::CursorType m_cursorType; | 76 IndexedDB::CursorType m_cursorType; |
| 77 const RefPtr<IDBDatabaseBackendImpl> m_database; | 77 const Persistent<IDBDatabaseBackendImpl> m_database; |
| 78 const RefPtr<IDBTransactionBackendImpl> m_transaction; | 78 const RefPtr<IDBTransactionBackendImpl> m_transaction; |
| 79 const int64_t m_objectStoreId; | 79 const int64_t m_objectStoreId; |
| 80 | 80 |
| 81 RefPtr<IDBBackingStore::Cursor> m_cursor; // Must be destroyed before m_tran
saction. | 81 RefPtr<IDBBackingStore::Cursor> m_cursor; // Must be destroyed before m_tran
saction. |
| 82 RefPtr<IDBBackingStore::Cursor> m_savedCursor; // Must be destroyed before m
_transaction. | 82 RefPtr<IDBBackingStore::Cursor> m_savedCursor; // Must be destroyed before m
_transaction. |
| 83 | 83 |
| 84 bool m_closed; | 84 bool m_closed; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace WebCore | 87 } // namespace WebCore |
| 88 | 88 |
| 89 #endif // IDBCursorBackendImpl_h | 89 #endif // IDBCursorBackendImpl_h |
| OLD | NEW |