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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Remove declaration for DocumentMarker constructor being removed 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
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
index 58c0a91998fe76596d811025a4c99e10ae123431..1d74d9f2ee4caff9e36dfd8fe3aaa976fd170d72 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -34,52 +34,12 @@
namespace blink {
-DocumentMarkerDetails::~DocumentMarkerDetails() {}
-
-class DocumentMarkerDescription final : public DocumentMarkerDetails {
- public:
- static DocumentMarkerDescription* Create(const String&);
-
- const String& Description() const { return description_; }
- bool IsDescription() const override { return true; }
-
- private:
- explicit DocumentMarkerDescription(const String& description)
- : description_(description) {}
-
- String description_;
-};
-
-DocumentMarkerDescription* DocumentMarkerDescription::Create(
- const String& description) {
- return new DocumentMarkerDescription(description);
-}
-
-inline DocumentMarkerDescription* ToDocumentMarkerDescription(
- DocumentMarkerDetails* details) {
- if (details && details->IsDescription())
- return static_cast<DocumentMarkerDescription*>(details);
- return 0;
-}
+DocumentMarker::~DocumentMarker() {}
yosin_UTC9 2017/05/29 05:13:48 nit: s/{}/ = default;/
DocumentMarker::DocumentMarker(MarkerType type,
unsigned start_offset,
unsigned end_offset)
- : type_(type),
- start_offset_(start_offset),
- end_offset_(end_offset),
- details_(nullptr) {}
-
-DocumentMarker::DocumentMarker(MarkerType type,
- unsigned start_offset,
- unsigned end_offset,
- const String& description)
- : type_(type),
- start_offset_(start_offset),
- end_offset_(end_offset),
- details_(description.IsEmpty()
- ? nullptr
- : DocumentMarkerDescription::Create(description)) {}
+ : type_(type), start_offset_(start_offset), end_offset_(end_offset) {}
yosin_UTC9 2017/05/29 05:13:48 Let's add DCHECK_LT(start_offset_, end_offset_)
Optional<DocumentMarker::MarkerOffsets>
DocumentMarker::ComputeOffsetsAfterShift(unsigned offset,
@@ -132,15 +92,4 @@ void DocumentMarker::ShiftOffsets(int delta) {
end_offset_ += delta;
}
-const String& DocumentMarker::Description() const {
- if (DocumentMarkerDescription* details =
- ToDocumentMarkerDescription(details_.Get()))
- return details->Description();
- return g_empty_string;
-}
-
-DEFINE_TRACE(DocumentMarker) {
- visitor->Trace(details_);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698