diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp b/chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp index 956bd2258e0..f19bcc1f7b6 100644 --- a/chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp +++ b/chromium/third_party/WebKit/Source/modules/indexeddb/IDBAny.cpp @@ -34,19 +34,19 @@ namespace WebCore { -PassRefPtr<IDBAny> IDBAny::createUndefined() +IDBAny* IDBAny::createUndefined() { - return adoptRef(new IDBAny(UndefinedType)); + return new IDBAny(UndefinedType); } -PassRefPtr<IDBAny> IDBAny::createNull() +IDBAny* IDBAny::createNull() { - return adoptRef(new IDBAny(NullType)); + return new IDBAny(NullType); } -PassRefPtr<IDBAny> IDBAny::createString(const String& value) +IDBAny* IDBAny::createString(const String& value) { - return adoptRef(new IDBAny(value)); + return new IDBAny(value); } IDBAny::IDBAny(Type type) @@ -60,6 +60,12 @@ IDBAny::~IDBAny() { } +void IDBAny::contextWillBeDestroyed() +{ + if (m_idbCursor) + m_idbCursor->contextWillBeDestroyed(); +} + DOMStringList* IDBAny::domStringList() const { ASSERT(m_type == DOMStringListType); @@ -122,6 +128,12 @@ SharedBuffer* IDBAny::buffer() const return m_buffer.get(); } +const Vector<blink::WebBlobInfo>* IDBAny::blobInfo() const +{ + ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType); + return m_blobInfo; +} + const String& IDBAny::string() const { ASSERT(m_type == StringType); @@ -134,65 +146,67 @@ int64_t IDBAny::integer() const return m_integer; } -IDBAny::IDBAny(PassRefPtr<DOMStringList> value) +IDBAny::IDBAny(PassRefPtrWillBeRawPtr<DOMStringList> value) : m_type(DOMStringListType) , m_domStringList(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBCursor> value) +IDBAny::IDBAny(IDBCursor* value) : m_type(value->isCursorWithValue() ? IDBCursorWithValueType : IDBCursorType) , m_idbCursor(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBDatabase> value) +IDBAny::IDBAny(IDBDatabase* value) : m_type(IDBDatabaseType) , m_idbDatabase(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBIndex> value) +IDBAny::IDBAny(IDBIndex* value) : m_type(IDBIndexType) , m_idbIndex(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBTransaction> value) +IDBAny::IDBAny(IDBTransaction* value) : m_type(IDBTransactionType) , m_idbTransaction(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBObjectStore> value) +IDBAny::IDBAny(IDBObjectStore* value) : m_type(IDBObjectStoreType) , m_idbObjectStore(value) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<SharedBuffer> value) +IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, const Vector<blink::WebBlobInfo>* blobInfo) : m_type(BufferType) , m_buffer(value) + , m_blobInfo(blobInfo) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath) +IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, const Vector<blink::WebBlobInfo>* blobInfo, IDBKey* key, const IDBKeyPath& keyPath) : m_type(BufferKeyAndKeyPathType) , m_idbKey(key) , m_idbKeyPath(keyPath) , m_buffer(value) + , m_blobInfo(blobInfo) , m_integer(0) { } -IDBAny::IDBAny(PassRefPtr<IDBKey> key) +IDBAny::IDBAny(IDBKey* key) : m_type(KeyType) , m_idbKey(key) , m_integer(0) @@ -219,4 +233,15 @@ IDBAny::IDBAny(int64_t value) { } +void IDBAny::trace(Visitor* visitor) +{ + visitor->trace(m_domStringList); + visitor->trace(m_idbCursor); + visitor->trace(m_idbDatabase); + visitor->trace(m_idbIndex); + visitor->trace(m_idbObjectStore); + visitor->trace(m_idbTransaction); + visitor->trace(m_idbKey); +} + } // namespace WebCore |