Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| index e20f2f31072b80190bd0d16f09134fdb303ee0e9..62b2bc875a9fbd4663177623b82926b9da02b8fc 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
| @@ -191,7 +191,7 @@ InputEvent::InputType InputTypeFromCommandType( |
| } |
| } |
| -RangeVector* RangesFromCurrentSelectionOrExtendCaret( |
| +StaticRangeVector* RangesFromCurrentSelectionOrExtendCaret( |
| const LocalFrame& frame, |
| SelectionDirection direction, |
| TextGranularity granularity) { |
| @@ -201,11 +201,12 @@ RangeVector* RangesFromCurrentSelectionOrExtendCaret( |
| if (selectionModifier.selection().isCaret()) |
| selectionModifier.modify(FrameSelection::AlterationExtend, direction, |
| granularity); |
| - RangeVector* ranges = new RangeVector; |
| + StaticRangeVector* ranges = new StaticRangeVector; |
| // We only supports single selections. |
| if (selectionModifier.selection().isNone()) |
| return ranges; |
| - ranges->push_back(firstRangeOf(selectionModifier.selection())); |
| + ranges->push_back( |
|
yosin_UTC9
2017/02/24 06:37:14
nit: s/push_back/emplace_back/
It seems WTF::Vecto
chongz
2017/02/24 21:19:15
It seems that I cannot use |emplace_back()| as the
yosin_UTC9
2017/02/27 10:31:46
I see. Thanks for notice.
|
| + StaticRange::create(firstRangeOf(selectionModifier.selection()))); |
| return ranges; |
| } |
| @@ -2727,7 +2728,7 @@ int Editor::Command::idForHistogram() const { |
| return isSupported() ? static_cast<int>(m_command->commandType) : 0; |
| } |
| -const RangeVector* Editor::Command::getTargetRanges() const { |
| +const StaticRangeVector* Editor::Command::getTargetRanges() const { |
| const Node* target = eventTargetNodeForDocument(m_frame->document()); |
| if (!isSupported() || !m_frame || !target || !hasRichlyEditableStyle(*target)) |
| return nullptr; |