Commit 13dffc22 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Inline static Create() factory functions from renderer/core/layout

This CL removes Create() factory functions in
//third_party/blink/renderer/core/layout only when it
meets the policy of removing Create() so that we support
only one of Create() methods or public constructors in a class.
Then, this CL makes all callers use MakeGarbageCollected<Foo>
instead.

This CL removes below Create() functions,
  - CustomScrollbar::CreateCustomScrollbar

Bug: 939691
Change-Id: I8d36d02e45569591cf40aaa90b8206090b704b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1971032Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#725434}
parent 25805566
...@@ -36,14 +36,6 @@ ...@@ -36,14 +36,6 @@
namespace blink { namespace blink {
Scrollbar* CustomScrollbar::CreateCustomScrollbar(
ScrollableArea* scrollable_area,
ScrollbarOrientation orientation,
Element* style_source) {
return MakeGarbageCollected<CustomScrollbar>(scrollable_area, orientation,
style_source);
}
CustomScrollbar::CustomScrollbar(ScrollableArea* scrollable_area, CustomScrollbar::CustomScrollbar(ScrollableArea* scrollable_area,
ScrollbarOrientation orientation, ScrollbarOrientation orientation,
Element* style_source) Element* style_source)
......
...@@ -45,10 +45,6 @@ class LayoutObject; ...@@ -45,10 +45,6 @@ class LayoutObject;
// LayoutCustomScrollbarPart. // LayoutCustomScrollbarPart.
class CustomScrollbar final : public Scrollbar { class CustomScrollbar final : public Scrollbar {
public: public:
static Scrollbar* CreateCustomScrollbar(ScrollableArea*,
ScrollbarOrientation,
Element*);
CustomScrollbar(ScrollableArea*, ScrollbarOrientation, Element*); CustomScrollbar(ScrollableArea*, ScrollbarOrientation, Element*);
~CustomScrollbar() override; ~CustomScrollbar() override;
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
#include "third_party/blink/renderer/core/scroll/smooth_scroll_sequencer.h" #include "third_party/blink/renderer/core/scroll/smooth_scroll_sequencer.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h" #include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h" #include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
namespace blink { namespace blink {
...@@ -2575,7 +2576,7 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar( ...@@ -2575,7 +2576,7 @@ Scrollbar* PaintLayerScrollableArea::ScrollbarManager::CreateScrollbar(
style_source.StyleRef().HasPseudoElementStyle(kPseudoIdScrollbar); style_source.StyleRef().HasPseudoElementStyle(kPseudoIdScrollbar);
if (has_custom_scrollbar_style) { if (has_custom_scrollbar_style) {
DCHECK(style_source.GetNode() && style_source.GetNode()->IsElementNode()); DCHECK(style_source.GetNode() && style_source.GetNode()->IsElementNode());
scrollbar = CustomScrollbar::CreateCustomScrollbar( scrollbar = MakeGarbageCollected<CustomScrollbar>(
ScrollableArea(), orientation, To<Element>(style_source.GetNode())); ScrollableArea(), orientation, To<Element>(style_source.GetNode()));
} else { } else {
ScrollbarControlSize scrollbar_size = kRegularScrollbar; ScrollbarControlSize scrollbar_size = kRegularScrollbar;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment