Commit a5338f8b authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix use-after-move in //components/sync_bookmarks/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: Ib5ea3151f87a385b27b37cb5944c981a124b9dac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2383017Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803472}
parent 8b9992b2
......@@ -290,14 +290,18 @@ void BookmarkModelTypeProcessor::ModelReadyToSync(
sync_pb::BookmarkModelMetadata model_metadata;
model_metadata.ParseFromString(metadata_str);
const bool initial_sync_done =
model_metadata.model_type_state().initial_sync_done();
const bool bookmarks_metadata_empty =
model_metadata.bookmarks_metadata().empty();
bookmark_tracker_ = SyncedBookmarkTracker::CreateFromBookmarkModelAndMetadata(
model, std::move(model_metadata));
if (bookmark_tracker_) {
bookmark_tracker_->CheckAllNodesTracked(bookmark_model_);
StartTrackingMetadata();
} else if (!model_metadata.model_type_state().initial_sync_done() &&
!model_metadata.bookmarks_metadata().empty()) {
} else if (!initial_sync_done && !bookmarks_metadata_empty) {
DLOG(ERROR)
<< "Persisted Metadata not empty while initial sync is not done.";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment