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

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

Issue 2899413003: [DMC #13] Don't create RenderedDocumentMarkers in SpellCheckMarkerListImpl (Closed)
Patch Set: Remove dep Created 3 years, 7 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/SpellCheckMarkerListImpl.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
index fa83de2ab72eb68fc33d7836e8780c2af4fdaa2f..f7aebabe1461cc0f1d3f64bfe81311bbbf576e55 100644
--- a/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
@@ -5,7 +5,6 @@
#include "core/editing/markers/SpellCheckMarkerListImpl.h"
#include "core/editing/markers/DocumentMarkerListEditor.h"
-#include "core/editing/markers/RenderedDocumentMarker.h"
namespace blink {
@@ -14,23 +13,21 @@ bool SpellCheckMarkerListImpl::IsEmpty() const {
}
void SpellCheckMarkerListImpl::Add(DocumentMarker* marker) {
- RenderedDocumentMarker* rendered_marker =
- RenderedDocumentMarker::Create(*marker);
if (markers_.IsEmpty() ||
markers_.back()->EndOffset() < marker->StartOffset()) {
- markers_.push_back(rendered_marker);
+ markers_.push_back(marker);
return;
}
auto first_overlapping = std::lower_bound(
- markers_.begin(), markers_.end(), rendered_marker,
+ markers_.begin(), markers_.end(), marker,
[](const Member<DocumentMarker>& marker_in_list,
const DocumentMarker* marker_to_insert) {
return marker_in_list->EndOffset() < marker_to_insert->StartOffset();
});
size_t index = first_overlapping - markers_.begin();
- markers_.insert(index, rendered_marker);
+ markers_.insert(index, marker);
const auto inserted = markers_.begin() + index;
first_overlapping = inserted + 1;
// TODO(rlanday): optimize this loop so it runs in O(N) time and not O(N^2)
« 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