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

Unified Diff: chrome/browser/history/starred_url_database.cc

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trying to set .json eol-style Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/history_types.h ('k') | chrome/browser/sync/engine/download_updates_command.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/starred_url_database.cc
diff --git a/chrome/browser/history/starred_url_database.cc b/chrome/browser/history/starred_url_database.cc
index 5336e07180f628468d3047c02493c3aa170a98fd..0fdf3b1173669867d31ce4a186c5a17064a35559 100644
--- a/chrome/browser/history/starred_url_database.cc
+++ b/chrome/browser/history/starred_url_database.cc
@@ -24,7 +24,9 @@
// id Unique identifier (primary key) for the entry.
// type Type of entry, if 0 this corresponds to a URL, 1 for
// a system folder, 2 for a user created folder, 3 for
-// other.
+// other. Note that 4 (synced) will never appear in the
+// database because it was added after this storage was
+// deprecated.
// url_id ID of the url, only valid if type == 0
// group_id ID of the folder, only valid if type != 0. This id comes
// from the UI and is NOT the same as id.
@@ -545,6 +547,12 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) {
entry.type = history::StarredEntry::OTHER;
BookmarkNode other_node(0, GURL());
other_node.Reset(entry);
+ // NOTE(yfriedman): We don't do anything with the synced star node because it
+ // won't ever exist in the starred node DB. We only need to create it to pass
+ // to "encode".
+ entry.type = history::StarredEntry::SYNCED;
+ BookmarkNode synced_node(0, GURL());
+ synced_node.Reset(entry);
std::map<history::UIStarID, history::StarID> folder_id_to_id_map;
typedef std::map<history::StarID, BookmarkNode*> IDToNodeMap;
@@ -579,6 +587,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) {
i != entries.end(); ++i) {
if (!i->parent_folder_id) {
DCHECK(i->type == history::StarredEntry::BOOKMARK_BAR ||
+ i->type == history::StarredEntry::SYNCED ||
i->type == history::StarredEntry::OTHER);
// Only entries with no parent should be the bookmark bar and other
// bookmarks folders.
@@ -616,7 +625,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) {
// Save to file.
BookmarkCodec encoder;
scoped_ptr<Value> encoded_bookmarks(
- encoder.Encode(&bookmark_bar_node, &other_node));
+ encoder.Encode(&bookmark_bar_node, &other_node, &synced_node));
std::string content;
base::JSONWriter::Write(encoded_bookmarks.get(), true, &content);
« no previous file with comments | « chrome/browser/history/history_types.h ('k') | chrome/browser/sync/engine/download_updates_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698