Commit 4a460332 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Make DocumentMarkerController::RemoveMarkersInternal() to take const Node&

This patch changes |DocumentMarkerController::RemoveMarkersInternal()| to take
|const Node&| instead of |const Node*| since it always non-null for improving
code health.

This patch is a follow-up of the patch[1].

[1] http://crrev.com/c/1050053 Make TextIterator::CurrentContainer() to return
const Node&.

Change-Id: I246eedf7cc4bb651d50ff0b6d50065e89f2312a3
Reviewed-on: https://chromium-review.googlesource.com/1051137
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557148}
parent dcf0906a
......@@ -232,7 +232,7 @@ void DocumentMarkerController::RemoveMarkers(
int start_offset = marked_text.StartOffsetInCurrentContainer();
int end_offset = marked_text.EndOffsetInCurrentContainer();
RemoveMarkersInternal(&marked_text.CurrentContainer(), start_offset,
RemoveMarkersInternal(marked_text.CurrentContainer(), start_offset,
end_offset - start_offset, marker_types);
}
}
......@@ -342,7 +342,7 @@ void DocumentMarkerController::MoveMarkers(const Node* src_node,
}
void DocumentMarkerController::RemoveMarkersInternal(
const Node* node,
const Node& node,
unsigned start_offset,
int length,
DocumentMarker::MarkerTypes marker_types) {
......@@ -353,7 +353,7 @@ void DocumentMarkerController::RemoveMarkersInternal(
return;
DCHECK(!(markers_.IsEmpty()));
MarkerLists* markers = markers_.at(node);
MarkerLists* const markers = markers_.at(&node);
if (!markers)
return;
......@@ -380,7 +380,7 @@ void DocumentMarkerController::RemoveMarkersInternal(
}
if (empty_lists_count == DocumentMarker::kMarkerTypeIndexesCount) {
markers_.erase(node);
markers_.erase(&node);
if (markers_.IsEmpty()) {
possibly_existing_marker_types_ = 0;
SetContext(nullptr);
......@@ -390,7 +390,7 @@ void DocumentMarkerController::RemoveMarkersInternal(
if (!doc_dirty)
return;
InvalidatePaintForNode(*node);
InvalidatePaintForNode(node);
}
DocumentMarker* DocumentMarkerController::FirstMarkerIntersectingOffsetRange(
......
......@@ -153,7 +153,7 @@ class CORE_EXPORT DocumentMarkerController final
bool PossiblyHasMarkers(DocumentMarker::MarkerTypes);
void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes);
void RemoveMarkersInternal(const Node*,
void RemoveMarkersInternal(const Node&,
unsigned start_offset,
int length,
DocumentMarker::MarkerTypes);
......
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