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

Unified Diff: chrome/browser/bookmarks/bookmark_codec.h

Issue 268001: Makes sure bookmark ids are unique on reading from file. If not unique... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | chrome/browser/bookmarks/bookmark_codec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_codec.h
===================================================================
--- chrome/browser/bookmarks/bookmark_codec.h (revision 28175)
+++ chrome/browser/bookmarks/bookmark_codec.h (working copy)
@@ -9,6 +9,7 @@
#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_
#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_
+#include <set>
#include <string>
#include "base/basictypes.h"
@@ -137,9 +138,14 @@
// Whether or not IDs were reassigned by the codec.
bool ids_reassigned_;
- // Whether or not IDs were missing for some bookmark nodes during decoding.
- bool ids_missing_;
+ // Whether or not IDs are valid. This is initially true, but set to false
+ // if an id is missing or not unique.
+ bool ids_valid_;
+ // Contains the id of each of the nodes found in the file. Used to determine
+ // if we have duplicates.
+ std::set<int64> ids_;
+
// MD5 context used to compute MD5 hash of all bookmark data.
MD5Context md5_context_;
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698