| Index: third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h b/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7560feaf4c228e4801baa3d51282cb5b18d58187
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef EditingMarkerList_h
|
| +#define EditingMarkerList_h
|
| +
|
| +#include "core/editing/markers/DocumentMarkerList.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class DocumentMarker;
|
| +
|
| +// EditingMarkerList is a subclass of DocumentMarkerList that takes advantage of
|
| +// the fact that its markers are sorted if they are inserted in a sorted order,
|
| +// but also supports efficiently inserting markers in non-sorted order.
|
| +// TODO(rlanday): Currently if markers are inserted in non-sorted order, this
|
| +// class just leaves them non-sorted until the list is cleared; is it ever
|
| +// advantageous to pre-emptively sort the list?
|
| +class CORE_EXPORT EditingMarkerList : public DocumentMarkerList {
|
| + public:
|
| + EditingMarkerList();
|
| +
|
| + // DocumentMarkerList implementations
|
| + bool isEditingMarkerList() const final;
|
| +
|
| + void add(DocumentMarker*) override;
|
| + void clear() final;
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + protected:
|
| + // TODO(rlanday): determine if/when we should sort the marker list to improve
|
| + // performance
|
| + bool markerListIsSorted() const final;
|
| +
|
| + bool m_markersAreSorted;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(EditingMarkerList);
|
| +};
|
| +
|
| +DEFINE_TYPE_CASTS(EditingMarkerList,
|
| + DocumentMarkerList,
|
| + list,
|
| + list->isEditingMarkerList(),
|
| + list.isEditingMarkerList());
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // EditingMarkerList_h
|
|
|