| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, I
ndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); | 60 static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, I
ndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); |
| 61 virtual ~IDBCursor(); | 61 virtual ~IDBCursor(); |
| 62 | 62 |
| 63 // Implement the IDL | 63 // Implement the IDL |
| 64 const String& direction() const; | 64 const String& direction() const; |
| 65 const ScriptValue& key() const; | 65 const ScriptValue& key() const; |
| 66 const ScriptValue& primaryKey() const; | 66 const ScriptValue& primaryKey() const; |
| 67 const ScriptValue& value() const; | 67 const ScriptValue& value() const; |
| 68 IDBAny* source() const; | 68 IDBAny* source() const; |
| 69 | 69 |
| 70 PassRefPtr<IDBRequest> update(ScriptState*, ScriptValue&, ExceptionCode&); | 70 IDBRequest* update(ScriptState*, ScriptValue&, ExceptionCode&); |
| 71 void advance(unsigned long, ExceptionCode&); | 71 void advance(unsigned long, ExceptionCode&); |
| 72 void continueFunction(ScriptExecutionContext*, const ScriptValue& key, Excep
tionCode&); | 72 void continueFunction(ScriptExecutionContext*, const ScriptValue& key, Excep
tionCode&); |
| 73 PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, ExceptionCode
&); | 73 IDBRequest* deleteFunction(ScriptExecutionContext*, ExceptionCode&); |
| 74 | 74 |
| 75 void continueFunction(PassRefPtr<IDBKey>, ExceptionCode&); | 75 void continueFunction(PassRefPtr<IDBKey>, ExceptionCode&); |
| 76 void postSuccessHandlerCallback(); | 76 void postSuccessHandlerCallback(); |
| 77 void close(); | 77 void close(); |
| 78 void setValueReady(DOMRequestState*, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>
primaryKey, ScriptValue&); | 78 void setValueReady(DOMRequestState*, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>
primaryKey, ScriptValue&); |
| 79 PassRefPtr<IDBKey> idbPrimaryKey() { return m_currentPrimaryKey; } | 79 PassRefPtr<IDBKey> idbPrimaryKey() { return m_currentPrimaryKey; } |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 IDBCursor(PassRefPtr<IDBCursorBackendInterface>, IndexedDB::CursorDirection,
IDBRequest*, IDBAny* source, IDBTransaction*); | 82 IDBCursor(PassRefPtr<IDBCursorBackendInterface>, IndexedDB::CursorDirection,
IDBRequest*, IDBAny* source, IDBTransaction*); |
| 83 virtual bool isKeyCursor() const { return true; } | 83 virtual bool isKeyCursor() const { return true; } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 PassRefPtr<IDBObjectStore> effectiveObjectStore(); | 86 PassRefPtr<IDBObjectStore> effectiveObjectStore(); |
| 87 | 87 |
| 88 bool isDeleted() const; | 88 bool isDeleted() const; |
| 89 | 89 |
| 90 RefPtr<IDBCursorBackendInterface> m_backend; | 90 RefPtr<IDBCursorBackendInterface> m_backend; |
| 91 RefPtr<IDBRequest> m_request; | 91 Persistent<IDBRequest> m_request; |
| 92 const IndexedDB::CursorDirection m_direction; | 92 const IndexedDB::CursorDirection m_direction; |
| 93 RefPtr<IDBAny> m_source; | 93 RefPtr<IDBAny> m_source; |
| 94 RefPtr<IDBTransaction> m_transaction; | 94 RefPtr<IDBTransaction> m_transaction; |
| 95 IDBTransaction::OpenCursorNotifier m_transactionNotifier; | 95 IDBTransaction::OpenCursorNotifier m_transactionNotifier; |
| 96 bool m_gotValue; | 96 bool m_gotValue; |
| 97 // These values are held because m_backend may advance while they | 97 // These values are held because m_backend may advance while they |
| 98 // are still valid for the current success handlers. | 98 // are still valid for the current success handlers. |
| 99 ScriptValue m_currentKeyValue; | 99 ScriptValue m_currentKeyValue; |
| 100 ScriptValue m_currentPrimaryKeyValue; | 100 ScriptValue m_currentPrimaryKeyValue; |
| 101 RefPtr<IDBKey> m_currentKey; | 101 RefPtr<IDBKey> m_currentKey; |
| 102 RefPtr<IDBKey> m_currentPrimaryKey; | 102 RefPtr<IDBKey> m_currentPrimaryKey; |
| 103 ScriptValue m_currentValue; | 103 ScriptValue m_currentValue; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace WebCore | 106 } // namespace WebCore |
| 107 | 107 |
| 108 #endif // IDBCursor_h | 108 #endif // IDBCursor_h |
| OLD | NEW |