Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: content/browser/indexed_db/indexed_db_value.h

Issue 197753011: Add IndexedDBValue wrapper class to group blob info with bits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a bit of extra blob_info stuff that leaked in. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Use of this source code is governed by a BSD-style license that can be
cmumford 2014/03/14 00:36:16 Are you missing the first line of the copyright ba
ericu 2014/03/14 01:17:23 Done.
2 // found in the LICENSE file.
3
4 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
5 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
6
7 #include <vector>
8 #include "content/browser/indexed_db/indexed_db_blob_info.h"
9
10 namespace content {
11
12 struct IndexedDBValue {
13 IndexedDBValue() {}
14 IndexedDBValue(const std::string& input_bits,
15 const std::vector<IndexedDBBlobInfo>& input_blob_info)
16 : bits(input_bits), blob_info(input_blob_info) {
17 DCHECK(!input_blob_info.size() || input_bits.size());
18 }
19
20 void swap(IndexedDBValue& value) {
21 bits.swap(value.bits);
22 blob_info.swap(value.blob_info);
23 }
24
25 bool empty() const { return bits.empty(); }
26 void clear() {
27 bits.clear();
28 blob_info.clear();
29 }
30
31 size_t SizeEstimate() const {
32 return bits.size() + blob_info.size() * sizeof(IndexedDBBlobInfo);
33 }
34
35 std::string bits;
36 std::vector<IndexedDBBlobInfo> blob_info;
37 };
38
39 } // namespace content
40
41 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_VALUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698