| 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 18 matching lines...) Expand all Loading... |
| 29 #include "bindings/v8/ScriptValue.h" | 29 #include "bindings/v8/ScriptValue.h" |
| 30 #include "bindings/v8/ScriptWrappable.h" | 30 #include "bindings/v8/ScriptWrappable.h" |
| 31 #include "modules/indexeddb/IDBKey.h" | 31 #include "modules/indexeddb/IDBKey.h" |
| 32 #include "modules/indexeddb/IDBRequest.h" | 32 #include "modules/indexeddb/IDBRequest.h" |
| 33 #include "modules/indexeddb/IndexedDB.h" | 33 #include "modules/indexeddb/IndexedDB.h" |
| 34 #include "public/platform/WebIDBCursor.h" | 34 #include "public/platform/WebIDBCursor.h" |
| 35 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
| 36 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 | 38 |
| 39 namespace blink { |
| 40 |
| 41 class WebBlobInfo; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 39 namespace WebCore { | 45 namespace WebCore { |
| 40 | 46 |
| 41 class ExceptionState; | 47 class ExceptionState; |
| 42 class IDBAny; | 48 class IDBAny; |
| 43 class IDBTransaction; | 49 class IDBTransaction; |
| 44 class ExecutionContext; | 50 class ExecutionContext; |
| 45 class SharedBuffer; | 51 class SharedBuffer; |
| 46 | 52 |
| 47 class IDBCursor : public ScriptWrappable, public WTF::RefCountedBase { | 53 class IDBCursor : public ScriptWrappable, public WTF::RefCountedBase { |
| 48 public: | 54 public: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 71 PassRefPtr<IDBRequest> deleteFunction(ExecutionContext*, ExceptionState&); | 77 PassRefPtr<IDBRequest> deleteFunction(ExecutionContext*, ExceptionState&); |
| 72 | 78 |
| 73 bool isKeyDirty() const { return m_keyDirty; } | 79 bool isKeyDirty() const { return m_keyDirty; } |
| 74 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } | 80 bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } |
| 75 bool isValueDirty() const { return m_valueDirty; } | 81 bool isValueDirty() const { return m_valueDirty; } |
| 76 | 82 |
| 77 void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc
eptionState&); | 83 void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc
eptionState&); |
| 78 void postSuccessHandlerCallback(); | 84 void postSuccessHandlerCallback(); |
| 79 bool isDeleted() const; | 85 bool isDeleted() const; |
| 80 void close(); | 86 void close(); |
| 81 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe
fPtr<SharedBuffer> value); | 87 void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe
fPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >); |
| 82 PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; } | 88 PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; } |
| 83 IDBRequest* request() const { return m_request.get(); } | 89 IDBRequest* request() const { return m_request.get(); } |
| 84 virtual bool isKeyCursor() const { return true; } | 90 virtual bool isKeyCursor() const { return true; } |
| 85 virtual bool isCursorWithValue() const { return false; } | 91 virtual bool isCursorWithValue() const { return false; } |
| 86 | 92 |
| 87 void deref() | 93 void deref() |
| 88 { | 94 { |
| 89 if (derefBase()) | 95 if (derefBase()) |
| 90 delete this; | 96 delete this; |
| 91 else if (hasOneRef()) | 97 else if (hasOneRef()) |
| 92 checkForReferenceCycle(); | 98 checkForReferenceCycle(); |
| 93 } | 99 } |
| 94 | 100 |
| 95 protected: | 101 protected: |
| 96 IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I
DBRequest*, IDBAny* source, IDBTransaction*); | 102 IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I
DBRequest*, IDBAny* source, IDBTransaction*); |
| 97 | 103 |
| 98 private: | 104 private: |
| 99 PassRefPtr<IDBObjectStore> effectiveObjectStore() const; | 105 PassRefPtr<IDBObjectStore> effectiveObjectStore() const; |
| 100 | 106 |
| 101 void checkForReferenceCycle(); | 107 void checkForReferenceCycle(); |
| 108 void handleBlobAcks(); |
| 102 | 109 |
| 103 OwnPtr<blink::WebIDBCursor> m_backend; | 110 OwnPtr<blink::WebIDBCursor> m_backend; |
| 104 RefPtr<IDBRequest> m_request; | 111 RefPtr<IDBRequest> m_request; |
| 105 const blink::WebIDBCursor::Direction m_direction; | 112 const blink::WebIDBCursor::Direction m_direction; |
| 106 RefPtr<IDBAny> m_source; | 113 RefPtr<IDBAny> m_source; |
| 107 RefPtr<IDBTransaction> m_transaction; | 114 RefPtr<IDBTransaction> m_transaction; |
| 108 bool m_gotValue; | 115 bool m_gotValue; |
| 109 bool m_keyDirty; | 116 bool m_keyDirty; |
| 110 bool m_primaryKeyDirty; | 117 bool m_primaryKeyDirty; |
| 111 bool m_valueDirty; | 118 bool m_valueDirty; |
| 112 RefPtr<IDBKey> m_key; | 119 RefPtr<IDBKey> m_key; |
| 113 RefPtr<IDBKey> m_primaryKey; | 120 RefPtr<IDBKey> m_primaryKey; |
| 114 RefPtr<SharedBuffer> m_value; | 121 RefPtr<SharedBuffer> m_value; |
| 122 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; |
| 115 }; | 123 }; |
| 116 | 124 |
| 117 } // namespace WebCore | 125 } // namespace WebCore |
| 118 | 126 |
| 119 #endif // IDBCursor_h | 127 #endif // IDBCursor_h |
| OLD | NEW |