| 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 #if ENABLE(OILPAN) | 53 #if ENABLE(OILPAN) | 
| 48 typedef GarbageCollectedFinalized<IDBCursor> IDBCursorBase; | 54 typedef GarbageCollectedFinalized<IDBCursor> IDBCursorBase; | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 79     PassRefPtrWillBeRawPtr<IDBRequest> deleteFunction(ExecutionContext*, Excepti
     onState&); | 85     PassRefPtrWillBeRawPtr<IDBRequest> deleteFunction(ExecutionContext*, Excepti
     onState&); | 
| 80 | 86 | 
| 81     bool isKeyDirty() const { return m_keyDirty; } | 87     bool isKeyDirty() const { return m_keyDirty; } | 
| 82     bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } | 88     bool isPrimaryKeyDirty() const { return m_primaryKeyDirty; } | 
| 83     bool isValueDirty() const { return m_valueDirty; } | 89     bool isValueDirty() const { return m_valueDirty; } | 
| 84 | 90 | 
| 85     void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc
     eptionState&); | 91     void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Exc
     eptionState&); | 
| 86     void postSuccessHandlerCallback(); | 92     void postSuccessHandlerCallback(); | 
| 87     bool isDeleted() const; | 93     bool isDeleted() const; | 
| 88     void close(); | 94     void close(); | 
| 89     void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe
     fPtr<SharedBuffer> value); | 95     void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRe
     fPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >); | 
| 90     PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; } | 96     PassRefPtr<IDBKey> idbPrimaryKey() const { return m_primaryKey; } | 
| 91     IDBRequest* request() const { return m_request.get(); } | 97     IDBRequest* request() const { return m_request.get(); } | 
| 92     virtual bool isKeyCursor() const { return true; } | 98     virtual bool isKeyCursor() const { return true; } | 
| 93     virtual bool isCursorWithValue() const { return false; } | 99     virtual bool isCursorWithValue() const { return false; } | 
| 94 | 100 | 
| 95 #if !ENABLE(OILPAN) | 101 #if !ENABLE(OILPAN) | 
| 96     void deref() | 102     void deref() | 
| 97     { | 103     { | 
| 98         if (derefBase()) | 104         if (derefBase()) | 
| 99             delete this; | 105             delete this; | 
| 100         else if (hasOneRef()) | 106         else if (hasOneRef()) | 
| 101             checkForReferenceCycle(); | 107             checkForReferenceCycle(); | 
| 102     } | 108     } | 
| 103 #endif | 109 #endif | 
| 104 | 110 | 
| 105 protected: | 111 protected: | 
| 106     IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I
     DBRequest*, IDBAny* source, IDBTransaction*); | 112     IDBCursor(PassOwnPtr<blink::WebIDBCursor>, blink::WebIDBCursor::Direction, I
     DBRequest*, IDBAny* source, IDBTransaction*); | 
| 107 | 113 | 
| 108 private: | 114 private: | 
| 109     PassRefPtr<IDBObjectStore> effectiveObjectStore() const; | 115     PassRefPtr<IDBObjectStore> effectiveObjectStore() const; | 
|  | 116     void handleBlobAcks(); | 
| 110 | 117 | 
| 111 #if !ENABLE(OILPAN) | 118 #if !ENABLE(OILPAN) | 
| 112     void checkForReferenceCycle(); | 119     void checkForReferenceCycle(); | 
| 113 #endif | 120 #endif | 
| 114 | 121 | 
| 115     OwnPtr<blink::WebIDBCursor> m_backend; | 122     OwnPtr<blink::WebIDBCursor> m_backend; | 
| 116     RefPtrWillBeMember<IDBRequest> m_request; | 123     RefPtrWillBeMember<IDBRequest> m_request; | 
| 117     const blink::WebIDBCursor::Direction m_direction; | 124     const blink::WebIDBCursor::Direction m_direction; | 
| 118     RefPtrWillBeMember<IDBAny> m_source; | 125     RefPtrWillBeMember<IDBAny> m_source; | 
| 119     RefPtr<IDBTransaction> m_transaction; | 126     RefPtr<IDBTransaction> m_transaction; | 
| 120     bool m_gotValue; | 127     bool m_gotValue; | 
| 121     bool m_keyDirty; | 128     bool m_keyDirty; | 
| 122     bool m_primaryKeyDirty; | 129     bool m_primaryKeyDirty; | 
| 123     bool m_valueDirty; | 130     bool m_valueDirty; | 
| 124     RefPtr<IDBKey> m_key; | 131     RefPtr<IDBKey> m_key; | 
| 125     RefPtr<IDBKey> m_primaryKey; | 132     RefPtr<IDBKey> m_primaryKey; | 
| 126     RefPtr<SharedBuffer> m_value; | 133     RefPtr<SharedBuffer> m_value; | 
|  | 134     OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; | 
| 127 }; | 135 }; | 
| 128 | 136 | 
| 129 } // namespace WebCore | 137 } // namespace WebCore | 
| 130 | 138 | 
| 131 #endif // IDBCursor_h | 139 #endif // IDBCursor_h | 
| OLD | NEW | 
|---|