| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "components/sync_bookmarks/bookmark_model_associator.h" | 5 #include "components/sync_bookmarks/bookmark_model_associator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // |title|, and |is_folder| flags. | 87 // |title|, and |is_folder| flags. |
| 88 static bool NodeMatches(const BookmarkNode* bookmark_node, | 88 static bool NodeMatches(const BookmarkNode* bookmark_node, |
| 89 const GURL& url, | 89 const GURL& url, |
| 90 const std::string& title, | 90 const std::string& title, |
| 91 bool is_folder); | 91 bool is_folder); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 // Maps bookmark node titles to instances, duplicates allowed. | 94 // Maps bookmark node titles to instances, duplicates allowed. |
| 95 // Titles are converted to the sync internal format before | 95 // Titles are converted to the sync internal format before |
| 96 // being used as keys for the map. | 96 // being used as keys for the map. |
| 97 using BookmarkNodeMap = base::hash_multimap<std::string, const BookmarkNode*>; | 97 using BookmarkNodeMap = std::multimap<std::string, const BookmarkNode*>; |
| 98 using BookmarkNodeRange = | 98 using BookmarkNodeRange = |
| 99 std::pair<BookmarkNodeMap::iterator, BookmarkNodeMap::iterator>; | 99 std::pair<BookmarkNodeMap::iterator, BookmarkNodeMap::iterator>; |
| 100 | 100 |
| 101 // Converts and truncates bookmark titles in the form sync does internally | 101 // Converts and truncates bookmark titles in the form sync does internally |
| 102 // to avoid mismatches due to sync munging titles. | 102 // to avoid mismatches due to sync munging titles. |
| 103 static void ConvertTitleToSyncInternalFormat(const std::string& input, | 103 static void ConvertTitleToSyncInternalFormat(const std::string& input, |
| 104 std::string* output); | 104 std::string* output); |
| 105 | 105 |
| 106 const BookmarkNode* parent_node_; | 106 const BookmarkNode* parent_node_; |
| 107 BookmarkNodeMap child_nodes_; | 107 BookmarkNodeMap child_nodes_; |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 syncer::BOOKMARKS); | 1003 syncer::BOOKMARKS); |
| 1004 } else { | 1004 } else { |
| 1005 context->set_native_model_sync_state(BEHIND); | 1005 context->set_native_model_sync_state(BEHIND); |
| 1006 } | 1006 } |
| 1007 } | 1007 } |
| 1008 } | 1008 } |
| 1009 return syncer::SyncError(); | 1009 return syncer::SyncError(); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 } // namespace sync_bookmarks | 1012 } // namespace sync_bookmarks |
| OLD | NEW |