summaryrefslogtreecommitdiff
path: root/chromium/components/sync_bookmarks/bookmark_model_type_processor.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/components/sync_bookmarks/bookmark_model_type_processor.cc
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/sync_bookmarks/bookmark_model_type_processor.cc')
-rw-r--r--chromium/components/sync_bookmarks/bookmark_model_type_processor.cc32
1 files changed, 14 insertions, 18 deletions
diff --git a/chromium/components/sync_bookmarks/bookmark_model_type_processor.cc b/chromium/components/sync_bookmarks/bookmark_model_type_processor.cc
index 7f6fc6ed59e..4ffd5e42e74 100644
--- a/chromium/components/sync_bookmarks/bookmark_model_type_processor.cc
+++ b/chromium/components/sync_bookmarks/bookmark_model_type_processor.cc
@@ -37,6 +37,7 @@
#include "components/sync_bookmarks/bookmark_specifics_conversions.h"
#include "components/sync_bookmarks/parent_guid_preprocessing.h"
#include "components/sync_bookmarks/switches.h"
+#include "components/sync_bookmarks/synced_bookmark_tracker_entity.h"
#include "components/undo/bookmark_undo_utils.h"
namespace sync_bookmarks {
@@ -155,7 +156,7 @@ void BookmarkModelTypeProcessor::OnCommitCompleted(
// |error_response_list| is ignored, because all errors are treated as
// transient and the processor with eventually retry.
for (const syncer::CommitResponseData& response : committed_response_list) {
- const SyncedBookmarkTracker::Entity* entity =
+ const SyncedBookmarkTrackerEntity* entity =
bookmark_tracker_->GetEntityForClientTagHash(response.client_tag_hash);
if (!entity) {
DLOG(WARNING) << "Received a commit response for an unknown entity.";
@@ -191,12 +192,6 @@ void BookmarkModelTypeProcessor::OnUpdateReceived(
return;
}
- // Before applying incremental updates, run a quirk to mitigate some data
- // corruption issue introduced by crbug.com/1231450.
- for (syncer::UpdateResponseData& update : updates) {
- MaybeFixGuidInSpecificsDueToPastBug(*bookmark_tracker_, &update.entity);
- }
-
// Incremental updates.
ScopedRemoteUpdateBookmarks update_bookmarks(
bookmark_model_, bookmark_undo_service_, bookmark_model_observer_.get());
@@ -480,18 +475,18 @@ void BookmarkModelTypeProcessor::GetAllNodesForDebugging(
auto all_nodes = std::make_unique<base::ListValue>();
// Create a permanent folder since sync server no longer create root folders,
// and USS won't migrate root folders from directory, we create root folders.
- auto root_node = std::make_unique<base::DictionaryValue>();
+ base::Value::Dict root_node;
// Function isTypeRootNode in sync_node_browser.js use PARENT_ID and
// UNIQUE_SERVER_TAG to check if the node is root node. isChildOf in
// sync_node_browser.js uses modelType to check if root node is parent of real
// data node. NON_UNIQUE_NAME will be the name of node to display.
- root_node->SetString("ID", "BOOKMARKS_ROOT");
- root_node->SetString("PARENT_ID", "r");
- root_node->SetString("UNIQUE_SERVER_TAG", "Bookmarks");
- root_node->SetBoolean("IS_DIR", true);
- root_node->SetString("modelType", "Bookmarks");
- root_node->SetString("NON_UNIQUE_NAME", "Bookmarks");
- all_nodes->Append(std::move(root_node));
+ root_node.Set("ID", "BOOKMARKS_ROOT");
+ root_node.Set("PARENT_ID", "r");
+ root_node.Set("UNIQUE_SERVER_TAG", "Bookmarks");
+ root_node.Set("IS_DIR", true);
+ root_node.Set("modelType", "Bookmarks");
+ root_node.Set("NON_UNIQUE_NAME", "Bookmarks");
+ all_nodes->Append(base::Value(std::move(root_node)));
const bookmarks::BookmarkNode* model_root_node = bookmark_model_->root_node();
int i = 0;
@@ -505,7 +500,7 @@ void BookmarkModelTypeProcessor::AppendNodeAndChildrenForDebugging(
const bookmarks::BookmarkNode* node,
int index,
base::ListValue* all_nodes) const {
- const SyncedBookmarkTracker::Entity* entity =
+ const SyncedBookmarkTrackerEntity* entity =
bookmark_tracker_->GetEntityForBookmarkNode(node);
// Include only tracked nodes. Newly added nodes are tracked even before being
// sent to the server. Managed bookmarks (that are installed by a policy)
@@ -535,7 +530,7 @@ void BookmarkModelTypeProcessor::AppendNodeAndChildrenForDebugging(
data.legacy_parent_id = "";
} else {
const bookmarks::BookmarkNode* parent = node->parent();
- const SyncedBookmarkTracker::Entity* parent_entity =
+ const SyncedBookmarkTrackerEntity* parent_entity =
bookmark_tracker_->GetEntityForBookmarkNode(parent);
DCHECK(parent_entity);
data.legacy_parent_id = parent_entity->metadata()->server_id();
@@ -563,7 +558,8 @@ void BookmarkModelTypeProcessor::AppendNodeAndChildrenForDebugging(
syncer::EntityMetadataToValue(*metadata)));
data_dictionary->SetString("modelType", "Bookmarks");
data_dictionary->SetBoolean("IS_DIR", node->is_folder());
- all_nodes->Append(std::move(data_dictionary));
+ all_nodes->Append(
+ base::Value::FromUniquePtrValue(std::move(data_dictionary)));
int i = 0;
for (const auto& child : node->children())