diff options
author | rfevang <rfevang@chromium.org> | 2014-11-19 10:33:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-19 18:34:49 +0000 |
commit | 634bdebd9bb1fe935e11758eaf2c2f6f0cfe0be7 (patch) | |
tree | 3255ec348bc257f75ab68091c00363947f9db9da /components/enhanced_bookmarks/enhanced_bookmark_model.h | |
parent | 966bcad09e369bcf01047c81ab27426fc7135c00 (diff) | |
download | chromium_src-634bdebd9bb1fe935e11758eaf2c2f6f0cfe0be7.zip chromium_src-634bdebd9bb1fe935e11758eaf2c2f6f0cfe0be7.tar.gz chromium_src-634bdebd9bb1fe935e11758eaf2c2f6f0cfe0be7.tar.bz2 |
Remove children of removed nodes from maps.
When a folder containing children is removed, only the folder node gets
a BookmarkNodeRemoved event, while all its children are also deleted.
This CL makes sure to also remove the child nodes from the various maps
so we won't later crash trying to dereference the now deleted nodes.
BUG=422959
Review URL: https://codereview.chromium.org/734983005
Cr-Commit-Position: refs/heads/master@{#304844}
Diffstat (limited to 'components/enhanced_bookmarks/enhanced_bookmark_model.h')
-rw-r--r-- | components/enhanced_bookmarks/enhanced_bookmark_model.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model.h b/components/enhanced_bookmarks/enhanced_bookmark_model.h index 4196f64..8bfc566 100644 --- a/components/enhanced_bookmarks/enhanced_bookmark_model.h +++ b/components/enhanced_bookmarks/enhanced_bookmark_model.h @@ -165,6 +165,9 @@ class EnhancedBookmarkModel : public KeyedService, // by a (Schedule)ResetDuplicateRemoteIds call when done adding nodes. void AddToIdMap(const BookmarkNode* node); + // Recursively removes a node and all its children from the various maps. + void RemoveNodeFromMaps(const BookmarkNode* node); + // If there are nodes that needs to reset their remote ids, schedules // ResetDuplicateRemoteIds to be run asynchronously. void ScheduleResetDuplicateRemoteIds(); |