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

Side by Side Diff: components/bookmarks/browser/bookmark_codec.h

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: Move to client. Created 3 years, 7 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 COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list>
10 #include <memory> 11 #include <memory>
11 #include <set> 12 #include <set>
12 #include <string> 13 #include <string>
14 #include <vector>
13 15
14 #include "base/macros.h" 16 #include "base/macros.h"
15 #include "base/md5.h" 17 #include "base/md5.h"
16 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
17 #include "components/bookmarks/browser/bookmark_node.h" 19 #include "components/bookmarks/browser/bookmark_node.h"
18 20
19 namespace base { 21 namespace base {
20 class DictionaryValue; 22 class DictionaryValue;
21 class ListValue; 23 class ListValue;
22 class Value; 24 class Value;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 82
81 // Return the sync transaction version of the bookmark model root. 83 // Return the sync transaction version of the bookmark model root.
82 int64_t model_sync_transaction_version() const { 84 int64_t model_sync_transaction_version() const {
83 return model_sync_transaction_version_; 85 return model_sync_transaction_version_;
84 } 86 }
85 87
86 // Returns whether the IDs were reassigned during decoding. Always returns 88 // Returns whether the IDs were reassigned during decoding. Always returns
87 // false after encoding. 89 // false after encoding.
88 bool ids_reassigned() const { return ids_reassigned_; } 90 bool ids_reassigned() const { return ids_reassigned_; }
89 91
92 void set_excluded_meta_info_keys(const std::vector<std::string>& keys) {
sky 2017/05/26 03:07:38 Wouldn't a set be a better data structure here?
sky 2017/05/26 03:07:39 Be consistent: meta_data_keys_.
ssid 2017/05/30 21:39:14 I think meta_info is consistent with DecodeMetaInf
ssid 2017/05/30 21:39:14 set uses around 4 extra pointers for each element
93 excluded_meta_info_keys_ = keys;
94 }
95
90 // Names of the various keys written to the Value. 96 // Names of the various keys written to the Value.
91 static const char kRootsKey[]; 97 static const char kRootsKey[];
92 static const char kRootFolderNameKey[]; 98 static const char kRootFolderNameKey[];
93 static const char kOtherBookmarkFolderNameKey[]; 99 static const char kOtherBookmarkFolderNameKey[];
94 static const char kMobileBookmarkFolderNameKey[]; 100 static const char kMobileBookmarkFolderNameKey[];
95 static const char kVersionKey[]; 101 static const char kVersionKey[];
96 static const char kChecksumKey[]; 102 static const char kChecksumKey[];
97 static const char kIdKey[]; 103 static const char kIdKey[];
98 static const char kTypeKey[]; 104 static const char kTypeKey[];
99 static const char kNameKey[]; 105 static const char kNameKey[];
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 204
199 // Maximum ID assigned when decoding data. 205 // Maximum ID assigned when decoding data.
200 int64_t maximum_id_; 206 int64_t maximum_id_;
201 207
202 // Meta info set on bookmark model root. 208 // Meta info set on bookmark model root.
203 BookmarkNode::MetaInfoMap model_meta_info_map_; 209 BookmarkNode::MetaInfoMap model_meta_info_map_;
204 210
205 // Sync transaction version set on bookmark model root. 211 // Sync transaction version set on bookmark model root.
206 int64_t model_sync_transaction_version_; 212 int64_t model_sync_transaction_version_;
207 213
214 std::vector<std::string> excluded_meta_info_keys_;
215
208 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); 216 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec);
209 }; 217 };
210 218
211 } // namespace bookmarks 219 } // namespace bookmarks
212 220
213 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ 221 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698