summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h')
-rw-r--r--chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h69
1 files changed, 34 insertions, 35 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h b/chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
index 0fd14e89d7a..6c8725db35c 100644
--- a/chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
+++ b/chromium/third_party/WebKit/Source/modules/indexeddb/IDBCursor.h
@@ -32,87 +32,86 @@
#include "modules/indexeddb/IDBRequest.h"
#include "modules/indexeddb/IndexedDB.h"
#include "public/platform/WebIDBCursor.h"
+#include "public/platform/WebIDBTypes.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
+namespace blink {
+
+class WebBlobInfo;
+
+} // namespace blink
+
namespace WebCore {
-class DOMRequestState;
class ExceptionState;
class IDBAny;
class IDBTransaction;
class ExecutionContext;
class SharedBuffer;
-class IDBCursor : public ScriptWrappable, public WTF::RefCountedBase {
+class IDBCursor : public GarbageCollectedFinalized<IDBCursor>, public ScriptWrappable {
public:
static const AtomicString& directionNext();
static const AtomicString& directionNextUnique();
static const AtomicString& directionPrev();
static const AtomicString& directionPrevUnique();
- static IndexedDB::CursorDirection stringToDirection(const String& modeString, ExceptionState&);
+ static blink::WebIDBCursorDirection stringToDirection(const String& modeString, ExceptionState&);
static const AtomicString& directionToString(unsigned short mode);
- static PassRefPtr<IDBCursor> create(PassOwnPtr<blink::WebIDBCursor>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
+ static IDBCursor* create(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
virtual ~IDBCursor();
+ void trace(Visitor*);
+ void contextWillBeDestroyed() { m_backend.clear(); }
// Implement the IDL
const String& direction() const { return directionToString(m_direction); }
- ScriptValue key(ExecutionContext*);
- ScriptValue primaryKey(ExecutionContext*);
- ScriptValue value(ExecutionContext*);
- ScriptValue source(ExecutionContext*) const;
+ ScriptValue key(ScriptState*);
+ ScriptValue primaryKey(ScriptState*);
+ ScriptValue value(ScriptState*);
+ ScriptValue source(ScriptState*) const;
- PassRefPtr<IDBRequest> update(ScriptState*, ScriptValue&, ExceptionState&);
+ IDBRequest* update(ScriptState*, ScriptValue&, ExceptionState&);
void advance(unsigned long, ExceptionState&);
- void continueFunction(ExecutionContext*, const ScriptValue& key, ExceptionState&);
- void continuePrimaryKey(ExecutionContext*, const ScriptValue& key, const ScriptValue& primaryKey, ExceptionState&);
- PassRefPtr<IDBRequest> deleteFunction(ExecutionContext*, ExceptionState&);
+ void continueFunction(ScriptState*, const ScriptValue& key, ExceptionState&);
+ void continuePrimaryKey(ScriptState*, const ScriptValue& key, const ScriptValue& primaryKey, ExceptionState&);
+ IDBRequest* deleteFunction(ScriptState*, ExceptionState&);
bool isKeyDirty() const { return m_keyDirty; }
bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; }
bool isValueDirty() const { return m_valueDirty; }
- void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, ExceptionState&);
+ void continueFunction(IDBKey*, IDBKey* primaryKey, ExceptionState&);
void postSuccessHandlerCallback();
+ bool isDeleted() const;
void close();
- void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value);
- PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; }
+ void setValueReady(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >);
+ IDBKey* idbPrimaryKey() const { return m_primaryKey; }
IDBRequest* request() const { return m_request.get(); }
virtual bool isKeyCursor() const { return true; }
virtual bool isCursorWithValue() const { return false; }
- void deref()
- {
- if (derefBase())
- delete this;
- else if (hasOneRef())
- checkForReferenceCycle();
- }
-
protected:
- IDBCursor(PassOwnPtr<blink::WebIDBCursor>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
+ IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
private:
- PassRefPtr<IDBObjectStore> effectiveObjectStore() const;
-
- void checkForReferenceCycle();
- bool isDeleted() const;
+ IDBObjectStore* effectiveObjectStore() const;
+ void handleBlobAcks();
OwnPtr<blink::WebIDBCursor> m_backend;
- RefPtr<IDBRequest> m_request;
- const IndexedDB::CursorDirection m_direction;
- RefPtr<IDBAny> m_source;
- RefPtr<IDBTransaction> m_transaction;
+ Member<IDBRequest> m_request;
+ const blink::WebIDBCursorDirection m_direction;
+ Member<IDBAny> m_source;
+ Member<IDBTransaction> m_transaction;
bool m_gotValue;
bool m_keyDirty;
bool m_primaryKeyDirty;
bool m_valueDirty;
- RefPtr<IDBKey> m_key;
- RefPtr<IDBKey> m_primaryKey;
+ Member<IDBKey> m_key;
+ Member<IDBKey> m_primaryKey;
RefPtr<SharedBuffer> m_value;
+ OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo;
};
} // namespace WebCore