// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IDBValue_h #define IDBValue_h #include "modules/ModulesExport.h" #include "modules/indexeddb/IDBKey.h" #include "modules/indexeddb/IDBKeyPath.h" #include "platform/SharedBuffer.h" #include "public/platform/WebVector.h" #include "wtf/OwnPtr.h" #include "wtf/RefPtr.h" namespace blink { class BlobDataHandle; class WebBlobInfo; struct WebIDBValue; class MODULES_EXPORT IDBValue final : public RefCounted { public: static PassRefPtr create(); static PassRefPtr create(const WebIDBValue&); static PassRefPtr create(const IDBValue*, IDBKey*, const IDBKeyPath&); bool isNull() const; Vector getUUIDs() const; const SharedBuffer* data() const; Vector* blobInfo() const { return m_blobInfo.get(); } const IDBKey* primaryKey() const { return m_primaryKey; } const IDBKeyPath& keyPath() const { return m_keyPath; } private: IDBValue(); IDBValue(const WebIDBValue&); IDBValue(PassRefPtr, const WebVector&, IDBKey*, const IDBKeyPath&); IDBValue(const IDBValue*, IDBKey*, const IDBKeyPath&); const RefPtr m_data; const OwnPtr>> m_blobData; const OwnPtr> m_blobInfo; const Persistent m_primaryKey; const IDBKeyPath m_keyPath; }; } // namespace blink #endif