| 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 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/md5.h" | 12 #include "base/md5.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "components/bookmarks/browser/bookmark_node.h" | 14 #include "components/bookmarks/browser/bookmark_node.h" |
| 15 | 15 |
| 16 class BookmarkModel; | 16 class BookmarkModel; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class ListValue; | 20 class ListValue; |
| 21 class Value; | 21 class Value; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace bookmarks { |
| 25 |
| 24 // BookmarkCodec is responsible for encoding and decoding the BookmarkModel | 26 // BookmarkCodec is responsible for encoding and decoding the BookmarkModel |
| 25 // into JSON values. The encoded values are written to disk via the | 27 // into JSON values. The encoded values are written to disk via the |
| 26 // BookmarkStorage. | 28 // BookmarkStorage. |
| 27 class BookmarkCodec { | 29 class BookmarkCodec { |
| 28 public: | 30 public: |
| 29 // Creates an instance of the codec. During decoding, if the IDs in the file | 31 // Creates an instance of the codec. During decoding, if the IDs in the file |
| 30 // are not unique, we will reassign IDs to make them unique. There are no | 32 // are not unique, we will reassign IDs to make them unique. There are no |
| 31 // guarantees on how the IDs are reassigned or about doing minimal | 33 // guarantees on how the IDs are reassigned or about doing minimal |
| 32 // reassignments to achieve uniqueness. | 34 // reassignments to achieve uniqueness. |
| 33 BookmarkCodec(); | 35 BookmarkCodec(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 199 |
| 198 // Meta info set on bookmark model root. | 200 // Meta info set on bookmark model root. |
| 199 BookmarkNode::MetaInfoMap model_meta_info_map_; | 201 BookmarkNode::MetaInfoMap model_meta_info_map_; |
| 200 | 202 |
| 201 // Sync transaction version set on bookmark model root. | 203 // Sync transaction version set on bookmark model root. |
| 202 int64 model_sync_transaction_version_; | 204 int64 model_sync_transaction_version_; |
| 203 | 205 |
| 204 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); | 206 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); |
| 205 }; | 207 }; |
| 206 | 208 |
| 209 } // namespace bookmarks |
| 210 |
| 207 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ | 211 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_ |
| OLD | NEW |