summaryrefslogtreecommitdiffstats
path: root/components/enhanced_bookmarks/metadata_accessor.cc
diff options
context:
space:
mode:
authorlpromero <lpromero@chromium.org>2014-10-07 13:07:06 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-07 20:07:57 +0000
commitb752eb1e5bb817172007c185cd60cb14fe81021d (patch)
tree1c69ca0b4b8a1611cf99accd42fb5bd02df2e08d /components/enhanced_bookmarks/metadata_accessor.cc
parent641adc1265ca1c6ebadddcfcc0319246b65eefde (diff)
downloadchromium_src-b752eb1e5bb817172007c185cd60cb14fe81021d.zip
chromium_src-b752eb1e5bb817172007c185cd60cb14fe81021d.tar.gz
chromium_src-b752eb1e5bb817172007c185cd60cb14fe81021d.tar.bz2
Set a RemoteID when one is missing.
This CL accomodates the case were a node has no remote ID but the key for the remote ID is present in its metadata map. BUG=420612 Review URL: https://codereview.chromium.org/636883003 Cr-Commit-Position: refs/heads/master@{#298552}
Diffstat (limited to 'components/enhanced_bookmarks/metadata_accessor.cc')
-rw-r--r--components/enhanced_bookmarks/metadata_accessor.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/components/enhanced_bookmarks/metadata_accessor.cc b/components/enhanced_bookmarks/metadata_accessor.cc
index cfcc9be..e2013b9 100644
--- a/components/enhanced_bookmarks/metadata_accessor.cc
+++ b/components/enhanced_bookmarks/metadata_accessor.cc
@@ -82,10 +82,9 @@ std::string RemoteIdFromBookmark(BookmarkModel* bookmark_model,
return SetRemoteIdOnBookmark(bookmark_model, node);
BookmarkNode::MetaInfoMap::const_iterator it = map->find(kIdDataKey);
- if (it == map->end())
+ if (it == map->end() || it->second.empty())
return SetRemoteIdOnBookmark(bookmark_model, node);
- DCHECK(it->second.length());
return it->second;
}
@@ -102,7 +101,7 @@ std::string DescriptionFromBookmark(const BookmarkNode* node) {
// First, look for a custom note set by the user.
BookmarkNode::MetaInfoMap::const_iterator it = map->find(kNoteKey);
- if (it != map->end() && it->second != "")
+ if (it != map->end() && !it->second.empty())
return it->second;
// If none are present, return the snippet.