Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp

Issue 2956453002: Clean up DocumentMarkerController::MarkersFor() (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
index a9309fae840172d93c5b50057c0fa4918ed1b977..32ef9a8cbc1664e5ca4bebcb4b74bb690faae968 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -383,14 +383,16 @@ DocumentMarkerVector DocumentMarkerController::MarkersFor(
Node* node,
DocumentMarker::MarkerTypes marker_types) {
DocumentMarkerVector result;
+ if (!PossiblyHasMarkers(marker_types))
+ return result;
MarkerLists* markers = markers_.at(node);
if (!markers)
return result;
- for (DocumentMarker::MarkerType type : DocumentMarker::AllMarkers()) {
+ for (DocumentMarker::MarkerType type : marker_types) {
DocumentMarkerList* const list = ListForType(markers, type);
- if (!list || list->IsEmpty() || !marker_types.Contains(type))
+ if (!list || list->IsEmpty())
continue;
result.AppendVector(list->GetMarkers());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698