diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc b/chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc index 7a03de27916..dfd3de3a063 100644 --- a/chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc +++ b/chromium/third_party/blink/renderer/modules/shapedetection/detected_text.cc @@ -10,15 +10,16 @@ namespace blink { DetectedText* DetectedText::Create() { - HeapVector<Point2D> empty_list; - return new DetectedText(g_empty_string, DOMRectReadOnly::Create(0, 0, 0, 0), - empty_list); + HeapVector<Member<Point2D>> empty_list; + return MakeGarbageCollected<DetectedText>( + g_empty_string, DOMRectReadOnly::Create(0, 0, 0, 0), empty_list); } DetectedText* DetectedText::Create(String raw_value, DOMRectReadOnly* bounding_box, - HeapVector<Point2D> corner_points) { - return new DetectedText(raw_value, bounding_box, corner_points); + HeapVector<Member<Point2D>> corner_points) { + return MakeGarbageCollected<DetectedText>(raw_value, bounding_box, + corner_points); } const String& DetectedText::rawValue() const { @@ -29,13 +30,13 @@ DOMRectReadOnly* DetectedText::boundingBox() const { return bounding_box_.Get(); } -const HeapVector<Point2D>& DetectedText::cornerPoints() const { +const HeapVector<Member<Point2D>>& DetectedText::cornerPoints() const { return corner_points_; } DetectedText::DetectedText(String raw_value, DOMRectReadOnly* bounding_box, - HeapVector<Point2D> corner_points) + HeapVector<Member<Point2D>> corner_points) : raw_value_(raw_value), bounding_box_(bounding_box), corner_points_(corner_points) {} @@ -47,8 +48,8 @@ ScriptValue DetectedText::toJSONForBinding(ScriptState* script_state) const { Vector<ScriptValue> corner_points; for (const auto& corner_point : corner_points_) { V8ObjectBuilder builder(script_state); - builder.AddNumber("x", corner_point.x()); - builder.AddNumber("y", corner_point.y()); + builder.AddNumber("x", corner_point->x()); + builder.AddNumber("y", corner_point->y()); corner_points.push_back(builder.GetScriptValue()); } result.Add("cornerPoints", corner_points); |