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

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

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: remove client interface Created 3 years, 6 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 <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <vector>
13 14
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/md5.h" 16 #include "base/md5.h"
16 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
17 #include "components/bookmarks/browser/bookmark_node.h" 18 #include "components/bookmarks/browser/bookmark_node.h"
18 19
19 namespace base { 20 namespace base {
20 class DictionaryValue; 21 class DictionaryValue;
21 class ListValue; 22 class ListValue;
22 class Value; 23 class Value;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 // Return the sync transaction version of the bookmark model root. 82 // Return the sync transaction version of the bookmark model root.
82 int64_t model_sync_transaction_version() const { 83 int64_t model_sync_transaction_version() const {
83 return model_sync_transaction_version_; 84 return model_sync_transaction_version_;
84 } 85 }
85 86
86 // Returns whether the IDs were reassigned during decoding. Always returns 87 // Returns whether the IDs were reassigned during decoding. Always returns
87 // false after encoding. 88 // false after encoding.
88 bool ids_reassigned() const { return ids_reassigned_; } 89 bool ids_reassigned() const { return ids_reassigned_; }
89 90
91 void set_excluded_meta_info_keys(const std::vector<std::string>& keys) {
92 excluded_meta_info_keys_ = keys;
93 }
94
90 // Names of the various keys written to the Value. 95 // Names of the various keys written to the Value.
91 static const char kRootsKey[]; 96 static const char kRootsKey[];
92 static const char kRootFolderNameKey[]; 97 static const char kRootFolderNameKey[];
93 static const char kOtherBookmarkFolderNameKey[]; 98 static const char kOtherBookmarkFolderNameKey[];
94 static const char kMobileBookmarkFolderNameKey[]; 99 static const char kMobileBookmarkFolderNameKey[];
95 static const char kVersionKey[]; 100 static const char kVersionKey[];
96 static const char kChecksumKey[]; 101 static const char kChecksumKey[];
97 static const char kIdKey[]; 102 static const char kIdKey[];
98 static const char kTypeKey[]; 103 static const char kTypeKey[];
99 static const char kNameKey[]; 104 static const char kNameKey[];
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 203
199 // Maximum ID assigned when decoding data. 204 // Maximum ID assigned when decoding data.
200 int64_t maximum_id_; 205 int64_t maximum_id_;
201 206
202 // Meta info set on bookmark model root. 207 // Meta info set on bookmark model root.
203 BookmarkNode::MetaInfoMap model_meta_info_map_; 208 BookmarkNode::MetaInfoMap model_meta_info_map_;
204 209
205 // Sync transaction version set on bookmark model root. 210 // Sync transaction version set on bookmark model root.
206 int64_t model_sync_transaction_version_; 211 int64_t model_sync_transaction_version_;
207 212
213 std::vector<std::string> excluded_meta_info_keys_;
214
208 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); 215 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec);
209 }; 216 };
210 217
211 } // namespace bookmarks 218 } // namespace bookmarks
212 219
213 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ 220 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698