OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "content/browser/indexed_db/indexed_db_blob_info.h" | 12 #include "content/browser/indexed_db/indexed_db_blob_info.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 struct CONTENT_EXPORT IndexedDBValue { | 17 struct CONTENT_EXPORT IndexedDBValue { |
18 IndexedDBValue(); | 18 IndexedDBValue(); |
19 IndexedDBValue(const std::string& input_bits, | 19 IndexedDBValue(const std::string& input_bits, |
20 const std::vector<IndexedDBBlobInfo>& input_blob_info); | 20 const std::vector<IndexedDBBlobInfo>& input_blob_info); |
| 21 IndexedDBValue(const IndexedDBValue& other); |
21 ~IndexedDBValue(); | 22 ~IndexedDBValue(); |
| 23 IndexedDBValue& operator=(const IndexedDBValue& other); |
22 | 24 |
23 void swap(IndexedDBValue& value) { | 25 void swap(IndexedDBValue& value) { |
24 bits.swap(value.bits); | 26 bits.swap(value.bits); |
25 blob_info.swap(value.blob_info); | 27 blob_info.swap(value.blob_info); |
26 } | 28 } |
27 | 29 |
28 bool empty() const { return bits.empty(); } | 30 bool empty() const { return bits.empty(); } |
29 void clear() { | 31 void clear() { |
30 bits.clear(); | 32 bits.clear(); |
31 blob_info.clear(); | 33 blob_info.clear(); |
32 } | 34 } |
33 | 35 |
34 size_t SizeEstimate() const { | 36 size_t SizeEstimate() const { |
35 return bits.size() + blob_info.size() * sizeof(IndexedDBBlobInfo); | 37 return bits.size() + blob_info.size() * sizeof(IndexedDBBlobInfo); |
36 } | 38 } |
37 | 39 |
38 std::string bits; | 40 std::string bits; |
39 std::vector<IndexedDBBlobInfo> blob_info; | 41 std::vector<IndexedDBBlobInfo> blob_info; |
40 }; | 42 }; |
41 | 43 |
42 } // namespace content | 44 } // namespace content |
43 | 45 |
44 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ | 46 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_ |
OLD | NEW |