#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
#include <stddef.h>
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "content/browser/indexed_db/indexed_db_external_object.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/base/big_buffer.h"
namespace content::indexed_db {
struct CONTENT_EXPORT IndexedDBValue {
IndexedDBValue();
~IndexedDBValue();
IndexedDBValue(IndexedDBValue&& other);
IndexedDBValue& operator=(IndexedDBValue&& other);
IndexedDBValue(const IndexedDBValue& other) = delete;
IndexedDBValue& operator=(const IndexedDBValue& other) = delete;
IndexedDBValue Clone() const;
IndexedDBValue(const std::string& input_bits,
const std::vector<IndexedDBExternalObject>& external_objects);
bool empty() const { return bits.size() == 0U; }
void clear() {
bits = mojo_base::BigBuffer();
external_objects.clear();
}
size_t SizeEstimate() const {
return bits.size() +
external_objects.size() * sizeof(IndexedDBExternalObject);
}
mojo_base::BigBuffer bits;
std::vector<IndexedDBExternalObject> external_objects;
};
}
#endif