Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_value.h
blob7b2377ad03b8ba0a29847566393abd3dfe147097
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
8 #include <algorithm>
9 #include <string>
10 #include <vector>
12 #include "content/browser/indexed_db/indexed_db_blob_info.h"
13 #include "content/common/content_export.h"
15 namespace content {
17 struct CONTENT_EXPORT IndexedDBValue {
18 IndexedDBValue();
19 IndexedDBValue(const std::string& input_bits,
20 const std::vector<IndexedDBBlobInfo>& input_blob_info);
21 IndexedDBValue(const IndexedDBValue& other);
22 ~IndexedDBValue();
23 IndexedDBValue& operator=(const IndexedDBValue& other);
25 void swap(IndexedDBValue& value) {
26 bits.swap(value.bits);
27 blob_info.swap(value.blob_info);
30 bool empty() const { return bits.empty(); }
31 void clear() {
32 bits.clear();
33 blob_info.clear();
36 size_t SizeEstimate() const {
37 return bits.size() + blob_info.size() * sizeof(IndexedDBBlobInfo);
40 std::string bits;
41 std::vector<IndexedDBBlobInfo> blob_info;
44 } // namespace content
46 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_