Chromium Code Reviews| 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 28 matching lines...) Expand all Loading... | |
| 39 | 39 |
| 40 class DOMRequestState; | 40 class DOMRequestState; |
| 41 class ExceptionState; | 41 class ExceptionState; |
| 42 class IDBAny; | 42 class IDBAny; |
| 43 class IDBCallbacks; | 43 class IDBCallbacks; |
| 44 class IDBCursorBackendInterface; | 44 class IDBCursorBackendInterface; |
| 45 class IDBRequest; | 45 class IDBRequest; |
| 46 class ScriptExecutionContext; | 46 class ScriptExecutionContext; |
| 47 class SharedBuffer; | 47 class SharedBuffer; |
| 48 | 48 |
| 49 class IDBCursor : public ScriptWrappable, public RefCounted<IDBCursor> { | 49 class IDBCursor : public ScriptWrappable, public WTF::RefCountedBase { |
| 50 public: | 50 public: |
| 51 static const AtomicString& directionNext(); | 51 static const AtomicString& directionNext(); |
| 52 static const AtomicString& directionNextUnique(); | 52 static const AtomicString& directionNextUnique(); |
| 53 static const AtomicString& directionPrev(); | 53 static const AtomicString& directionPrev(); |
| 54 static const AtomicString& directionPrevUnique(); | 54 static const AtomicString& directionPrevUnique(); |
| 55 | 55 |
| 56 static IndexedDB::CursorDirection stringToDirection(const String& modeString , ExceptionState&); | 56 static IndexedDB::CursorDirection stringToDirection(const String& modeString , ExceptionState&); |
| 57 static const AtomicString& directionToString(unsigned short mode); | 57 static const AtomicString& directionToString(unsigned short mode); |
| 58 | 58 |
| 59 static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, I ndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); | 59 static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, I ndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 73 | 73 |
| 74 bool isKeyDirty() const { return m_keyDirty; } | 74 bool isKeyDirty() const { return m_keyDirty; } |
| 75 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } | 75 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } |
| 76 bool isValueDirty() const { return m_valueDirty; } | 76 bool isValueDirty() const { return m_valueDirty; } |
| 77 | 77 |
| 78 void continueFunction(PassRefPtr<IDBKey>, ExceptionState&); | 78 void continueFunction(PassRefPtr<IDBKey>, ExceptionState&); |
| 79 void postSuccessHandlerCallback(); | 79 void postSuccessHandlerCallback(); |
| 80 void close(); | 80 void close(); |
| 81 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe fPtr<SharedBuffer> value); | 81 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe fPtr<SharedBuffer> value); |
| 82 PassRefPtr<IDBKey> idbPrimaryKey() { return m_primaryKey; } | 82 PassRefPtr<IDBKey> idbPrimaryKey() { return m_primaryKey; } |
| 83 IDBRequest* request() { return m_request.get(); } | |
| 84 | |
| 85 void deref() | |
|
alecflett
2013/09/06 17:56:35
can/should be OVERRIDE?
jsbell
2013/09/06 18:07:43
Nope, not here. T::deref() is required by the RefP
| |
| 86 { | |
| 87 if (derefBase()) | |
| 88 delete this; | |
| 89 else if (hasOneRef()) | |
| 90 checkForReferenceCycle(); | |
| 91 } | |
| 83 | 92 |
| 84 protected: | 93 protected: |
| 85 IDBCursor(PassRefPtr<IDBCursorBackendInterface>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); | 94 IDBCursor(PassRefPtr<IDBCursorBackendInterface>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*); |
| 86 virtual bool isKeyCursor() const { return true; } | 95 virtual bool isKeyCursor() const { return true; } |
| 87 | 96 |
| 88 private: | 97 private: |
| 89 PassRefPtr<IDBObjectStore> effectiveObjectStore(); | 98 PassRefPtr<IDBObjectStore> effectiveObjectStore(); |
| 90 | 99 |
| 100 void checkForReferenceCycle(); | |
| 91 bool isDeleted() const; | 101 bool isDeleted() const; |
| 92 | 102 |
| 93 RefPtr<IDBCursorBackendInterface> m_backend; | 103 RefPtr<IDBCursorBackendInterface> m_backend; |
| 94 RefPtr<IDBRequest> m_request; | 104 RefPtr<IDBRequest> m_request; |
| 95 const IndexedDB::CursorDirection m_direction; | 105 const IndexedDB::CursorDirection m_direction; |
| 96 RefPtr<IDBAny> m_source; | 106 RefPtr<IDBAny> m_source; |
| 97 RefPtr<IDBTransaction> m_transaction; | 107 RefPtr<IDBTransaction> m_transaction; |
| 98 IDBTransaction::OpenCursorNotifier m_transactionNotifier; | |
| 99 bool m_gotValue; | 108 bool m_gotValue; |
| 100 bool m_keyDirty; | 109 bool m_keyDirty; |
| 101 bool m_primaryKeyDirty; | 110 bool m_primaryKeyDirty; |
| 102 bool m_valueDirty; | 111 bool m_valueDirty; |
| 103 RefPtr<IDBKey> m_key; | 112 RefPtr<IDBKey> m_key; |
| 104 RefPtr<IDBKey> m_primaryKey; | 113 RefPtr<IDBKey> m_primaryKey; |
| 105 RefPtr<SharedBuffer> m_value; | 114 RefPtr<SharedBuffer> m_value; |
| 106 }; | 115 }; |
| 107 | 116 |
| 108 } // namespace WebCore | 117 } // namespace WebCore |
| 109 | 118 |
| 110 #endif // IDBCursor_h | 119 #endif // IDBCursor_h |
| OLD | NEW |