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

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

Issue 933823002: Avoid large inlined automatic methods in IndexedDB code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more CONTENT_EXPORT Created 5 years, 10 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
OLDNEW
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_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_metadata.cc ('k') | content/browser/indexed_db/indexed_db_value.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698