Commit bde862eb authored by Sundoo Kim's avatar Sundoo Kim Committed by Commit Bot

Replace DISALLOW_COPY_AND_ASSIGN with =delete in blink/../layout/ng

Explicitly remove the copy constructor and assignment operator with
the delete keyword.

Bug: 1010217
Change-Id: I7440c2f934c5556249365a2637cedc2517aa91e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359310Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798696}
parent b65fa214
...@@ -29,6 +29,8 @@ class CustomLayoutChild : public ScriptWrappable { ...@@ -29,6 +29,8 @@ class CustomLayoutChild : public ScriptWrappable {
public: public:
CustomLayoutChild(const CSSLayoutDefinition&, NGLayoutInputNode); CustomLayoutChild(const CSSLayoutDefinition&, NGLayoutInputNode);
CustomLayoutChild(const CustomLayoutChild&) = delete;
CustomLayoutChild& operator=(const CustomLayoutChild&) = delete;
~CustomLayoutChild() override = default; ~CustomLayoutChild() override = default;
// LayoutChild.idl // LayoutChild.idl
...@@ -52,8 +54,6 @@ class CustomLayoutChild : public ScriptWrappable { ...@@ -52,8 +54,6 @@ class CustomLayoutChild : public ScriptWrappable {
NGLayoutInputNode node_; NGLayoutInputNode node_;
Member<PrepopulatedComputedStylePropertyMap> style_map_; Member<PrepopulatedComputedStylePropertyMap> style_map_;
Member<CustomLayoutToken> token_; Member<CustomLayoutToken> token_;
DISALLOW_COPY_AND_ASSIGN(CustomLayoutChild);
}; };
} // namespace blink } // namespace blink
......
...@@ -25,6 +25,8 @@ class CustomLayoutConstraints : public ScriptWrappable { ...@@ -25,6 +25,8 @@ class CustomLayoutConstraints : public ScriptWrappable {
CustomLayoutConstraints(const LogicalSize& border_box_size, CustomLayoutConstraints(const LogicalSize& border_box_size,
SerializedScriptValue* data, SerializedScriptValue* data,
v8::Isolate*); v8::Isolate*);
CustomLayoutConstraints(const CustomLayoutConstraints&) = delete;
CustomLayoutConstraints& operator=(const CustomLayoutConstraints&) = delete;
~CustomLayoutConstraints() override; ~CustomLayoutConstraints() override;
// LayoutConstraints.idl // LayoutConstraints.idl
...@@ -38,8 +40,6 @@ class CustomLayoutConstraints : public ScriptWrappable { ...@@ -38,8 +40,6 @@ class CustomLayoutConstraints : public ScriptWrappable {
double fixed_inline_size_; double fixed_inline_size_;
double fixed_block_size_; double fixed_block_size_;
TraceWrapperV8Reference<v8::Value> layout_worklet_world_v8_data_; TraceWrapperV8Reference<v8::Value> layout_worklet_world_v8_data_;
DISALLOW_COPY_AND_ASSIGN(CustomLayoutConstraints);
}; };
} // namespace blink } // namespace blink
......
...@@ -22,6 +22,8 @@ class CustomLayoutEdges : public ScriptWrappable { ...@@ -22,6 +22,8 @@ class CustomLayoutEdges : public ScriptWrappable {
inline_end_(border_scrollbar_padding.inline_end), inline_end_(border_scrollbar_padding.inline_end),
block_start_(border_scrollbar_padding.block_start), block_start_(border_scrollbar_padding.block_start),
block_end_(border_scrollbar_padding.block_end) {} block_end_(border_scrollbar_padding.block_end) {}
CustomLayoutEdges(const CustomLayoutEdges&) = delete;
CustomLayoutEdges& operator=(const CustomLayoutEdges&) = delete;
// layout_edges.idl // layout_edges.idl
double inlineStart() const { return inline_start_; } double inlineStart() const { return inline_start_; }
...@@ -36,8 +38,6 @@ class CustomLayoutEdges : public ScriptWrappable { ...@@ -36,8 +38,6 @@ class CustomLayoutEdges : public ScriptWrappable {
double inline_end_; double inline_end_;
double block_start_; double block_start_;
double block_end_; double block_end_;
DISALLOW_COPY_AND_ASSIGN(CustomLayoutEdges);
}; };
} // namespace blink } // namespace blink
......
...@@ -41,6 +41,8 @@ class CustomLayoutFragment : public ScriptWrappable { ...@@ -41,6 +41,8 @@ class CustomLayoutFragment : public ScriptWrappable {
const LogicalSize& size, const LogicalSize& size,
const base::Optional<LayoutUnit> baseline, const base::Optional<LayoutUnit> baseline,
v8::Isolate*); v8::Isolate*);
CustomLayoutFragment(const CustomLayoutFragment&) = delete;
CustomLayoutFragment& operator=(const CustomLayoutFragment&) = delete;
~CustomLayoutFragment() override = default; ~CustomLayoutFragment() override = default;
double inlineSize() const { return inline_size_; } double inlineSize() const { return inline_size_; }
...@@ -95,8 +97,6 @@ class CustomLayoutFragment : public ScriptWrappable { ...@@ -95,8 +97,6 @@ class CustomLayoutFragment : public ScriptWrappable {
const base::Optional<double> baseline_; const base::Optional<double> baseline_;
TraceWrapperV8Reference<v8::Value> layout_worklet_world_v8_data_; TraceWrapperV8Reference<v8::Value> layout_worklet_world_v8_data_;
DISALLOW_COPY_AND_ASSIGN(CustomLayoutFragment);
}; };
} // namespace blink } // namespace blink
......
...@@ -34,6 +34,8 @@ class CORE_EXPORT LayoutWorklet : public Worklet, ...@@ -34,6 +34,8 @@ class CORE_EXPORT LayoutWorklet : public Worklet,
static LayoutWorklet* From(LocalDOMWindow&); static LayoutWorklet* From(LocalDOMWindow&);
explicit LayoutWorklet(LocalDOMWindow&); explicit LayoutWorklet(LocalDOMWindow&);
LayoutWorklet(const LayoutWorklet&) = delete;
LayoutWorklet& operator=(const LayoutWorklet&) = delete;
~LayoutWorklet() override; ~LayoutWorklet() override;
typedef HeapHashMap<String, Member<DocumentLayoutDefinition>> typedef HeapHashMap<String, Member<DocumentLayoutDefinition>>
...@@ -60,8 +62,6 @@ class CORE_EXPORT LayoutWorklet : public Worklet, ...@@ -60,8 +62,6 @@ class CORE_EXPORT LayoutWorklet : public Worklet,
DocumentDefinitionMap document_definition_map_; DocumentDefinitionMap document_definition_map_;
Member<PendingLayoutRegistry> pending_layout_registry_; Member<PendingLayoutRegistry> pending_layout_registry_;
DISALLOW_COPY_AND_ASSIGN(LayoutWorklet);
}; };
} // namespace blink } // namespace blink
......
...@@ -19,6 +19,8 @@ class Node; ...@@ -19,6 +19,8 @@ class Node;
class PendingLayoutRegistry : public GarbageCollected<PendingLayoutRegistry> { class PendingLayoutRegistry : public GarbageCollected<PendingLayoutRegistry> {
public: public:
PendingLayoutRegistry() = default; PendingLayoutRegistry() = default;
PendingLayoutRegistry(const PendingLayoutRegistry&) = delete;
PendingLayoutRegistry& operator=(const PendingLayoutRegistry&) = delete;
void NotifyLayoutReady(const AtomicString& name); void NotifyLayoutReady(const AtomicString& name);
void AddPendingLayout(const AtomicString& name, Node*); void AddPendingLayout(const AtomicString& name, Node*);
...@@ -37,8 +39,6 @@ class PendingLayoutRegistry : public GarbageCollected<PendingLayoutRegistry> { ...@@ -37,8 +39,6 @@ class PendingLayoutRegistry : public GarbageCollected<PendingLayoutRegistry> {
using PendingSet = HeapHashSet<WeakMember<Node>>; using PendingSet = HeapHashSet<WeakMember<Node>>;
using PendingLayoutMap = HeapHashMap<AtomicString, Member<PendingSet>>; using PendingLayoutMap = HeapHashMap<AtomicString, Member<PendingSet>>;
PendingLayoutMap pending_layouts_; PendingLayoutMap pending_layouts_;
DISALLOW_COPY_AND_ASSIGN(PendingLayoutRegistry);
}; };
} // namespace blink } // namespace blink
......
...@@ -26,15 +26,15 @@ class EmptyOffsetMappingBuilder { ...@@ -26,15 +26,15 @@ class EmptyOffsetMappingBuilder {
}; };
EmptyOffsetMappingBuilder() = default; EmptyOffsetMappingBuilder() = default;
EmptyOffsetMappingBuilder(const EmptyOffsetMappingBuilder&) = delete;
EmptyOffsetMappingBuilder& operator=(const EmptyOffsetMappingBuilder&) =
delete;
void AppendIdentityMapping(unsigned) {} void AppendIdentityMapping(unsigned) {}
void AppendCollapsedMapping(unsigned) {} void AppendCollapsedMapping(unsigned) {}
void CollapseTrailingSpace(unsigned) {} void CollapseTrailingSpace(unsigned) {}
void Composite(const EmptyOffsetMappingBuilder&) {} void Composite(const EmptyOffsetMappingBuilder&) {}
void Concatenate(const EmptyOffsetMappingBuilder&) {} void Concatenate(const EmptyOffsetMappingBuilder&) {}
void RestoreTrailingCollapsibleSpace(const LayoutText&, unsigned) {} void RestoreTrailingCollapsibleSpace(const LayoutText&, unsigned) {}
private:
DISALLOW_COPY_AND_ASSIGN(EmptyOffsetMappingBuilder);
}; };
} // namespace blink } // namespace blink
......
...@@ -20,6 +20,10 @@ class NGPhysicalFragmentCollectorBase { ...@@ -20,6 +20,10 @@ class NGPhysicalFragmentCollectorBase {
public: public:
virtual Vector<Result> CollectFrom(const NGPhysicalFragment&) = 0; virtual Vector<Result> CollectFrom(const NGPhysicalFragment&) = 0;
NGPhysicalFragmentCollectorBase(const NGPhysicalFragmentCollectorBase&) =
delete;
NGPhysicalFragmentCollectorBase& operator=(
const NGPhysicalFragmentCollectorBase&) = delete;
protected: protected:
explicit NGPhysicalFragmentCollectorBase() = default; explicit NGPhysicalFragmentCollectorBase() = default;
...@@ -89,8 +93,6 @@ class NGPhysicalFragmentCollectorBase { ...@@ -89,8 +93,6 @@ class NGPhysicalFragmentCollectorBase {
PhysicalOffset current_offset_to_root_; PhysicalOffset current_offset_to_root_;
Vector<Result> results_; Vector<Result> results_;
bool should_stop_traversing_ = false; bool should_stop_traversing_ = false;
DISALLOW_COPY_AND_ASSIGN(NGPhysicalFragmentCollectorBase);
}; };
// The visitor emitting all visited fragments. // The visitor emitting all visited fragments.
...@@ -99,6 +101,8 @@ class DescendantCollector final : public NGPhysicalFragmentCollectorBase { ...@@ -99,6 +101,8 @@ class DescendantCollector final : public NGPhysicalFragmentCollectorBase {
public: public:
DescendantCollector() = default; DescendantCollector() = default;
DescendantCollector(const DescendantCollector&) = delete;
DescendantCollector& operator=(const DescendantCollector&) = delete;
Vector<Result> CollectFrom(const NGPhysicalFragment& fragment) final { Vector<Result> CollectFrom(const NGPhysicalFragment& fragment) final {
return CollectExclusivelyFrom(fragment); return CollectExclusivelyFrom(fragment);
...@@ -109,8 +113,6 @@ class DescendantCollector final : public NGPhysicalFragmentCollectorBase { ...@@ -109,8 +113,6 @@ class DescendantCollector final : public NGPhysicalFragmentCollectorBase {
Emit(); Emit();
VisitChildren(); VisitChildren();
} }
DISALLOW_COPY_AND_ASSIGN(DescendantCollector);
}; };
// The visitor emitting fragments generated from the given LayoutInline, // The visitor emitting fragments generated from the given LayoutInline,
...@@ -125,6 +127,8 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase { ...@@ -125,6 +127,8 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase {
explicit LayoutInlineCollector(const LayoutInline& container) { explicit LayoutInlineCollector(const LayoutInline& container) {
CollectInclusiveDescendants(container); CollectInclusiveDescendants(container);
} }
LayoutInlineCollector(const LayoutInlineCollector&) = delete;
LayoutInlineCollector& operator=(const LayoutInlineCollector&) = delete;
Vector<Result> CollectFrom(const NGPhysicalFragment& fragment) final { Vector<Result> CollectFrom(const NGPhysicalFragment& fragment) final {
return CollectExclusivelyFrom(fragment); return CollectExclusivelyFrom(fragment);
...@@ -157,8 +161,6 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase { ...@@ -157,8 +161,6 @@ class LayoutInlineCollector final : public NGPhysicalFragmentCollectorBase {
} }
HashSet<const LayoutObject*> inclusive_descendants_; HashSet<const LayoutObject*> inclusive_descendants_;
DISALLOW_COPY_AND_ASSIGN(LayoutInlineCollector);
}; };
} // namespace } // namespace
......
...@@ -510,6 +510,8 @@ class NGInlineNodeDataEditor final { ...@@ -510,6 +510,8 @@ class NGInlineNodeDataEditor final {
layout_text_(layout_text) { layout_text_(layout_text) {
DCHECK(layout_text_.HasValidInlineItems()); DCHECK(layout_text_.HasValidInlineItems());
} }
NGInlineNodeDataEditor(const NGInlineNodeDataEditor&) = delete;
NGInlineNodeDataEditor& operator=(const NGInlineNodeDataEditor&) = delete;
LayoutBlockFlow* GetLayoutBlockFlow() const { return block_flow_; } LayoutBlockFlow* GetLayoutBlockFlow() const { return block_flow_; }
...@@ -740,8 +742,6 @@ class NGInlineNodeDataEditor final { ...@@ -740,8 +742,6 @@ class NGInlineNodeDataEditor final {
const LayoutText& layout_text_; const LayoutText& layout_text_;
unsigned start_offset_ = 0; unsigned start_offset_ = 0;
unsigned end_offset_ = 0; unsigned end_offset_ = 0;
DISALLOW_COPY_AND_ASSIGN(NGInlineNodeDataEditor);
}; };
// static // static
......
...@@ -40,6 +40,8 @@ class CORE_EXPORT NGLineBoxFragmentBuilder final ...@@ -40,6 +40,8 @@ class CORE_EXPORT NGLineBoxFragmentBuilder final
{writing_direction.GetWritingMode(), TextDirection::kLtr}), {writing_direction.GetWritingMode(), TextDirection::kLtr}),
line_box_type_(NGPhysicalLineBoxFragment::kNormalLineBox), line_box_type_(NGPhysicalLineBoxFragment::kNormalLineBox),
base_direction_(TextDirection::kLtr) {} base_direction_(TextDirection::kLtr) {}
NGLineBoxFragmentBuilder(const NGLineBoxFragmentBuilder&) = delete;
NGLineBoxFragmentBuilder& operator=(const NGLineBoxFragmentBuilder&) = delete;
void Reset(); void Reset();
...@@ -97,8 +99,6 @@ class CORE_EXPORT NGLineBoxFragmentBuilder final ...@@ -97,8 +99,6 @@ class CORE_EXPORT NGLineBoxFragmentBuilder final
friend class NGLayoutResult; friend class NGLayoutResult;
friend class NGPhysicalLineBoxFragment; friend class NGPhysicalLineBoxFragment;
DISALLOW_COPY_AND_ASSIGN(NGLineBoxFragmentBuilder);
}; };
} // namespace blink } // namespace blink
......
...@@ -105,6 +105,8 @@ class CORE_EXPORT NGOffsetMapping { ...@@ -105,6 +105,8 @@ class CORE_EXPORT NGOffsetMapping {
HashMap<Persistent<const Node>, std::pair<unsigned, unsigned>>; HashMap<Persistent<const Node>, std::pair<unsigned, unsigned>>;
NGOffsetMapping(UnitVector&&, RangeMap&&, String); NGOffsetMapping(UnitVector&&, RangeMap&&, String);
NGOffsetMapping(const NGOffsetMapping&) = delete;
NGOffsetMapping& operator=(const NGOffsetMapping&) = delete;
~NGOffsetMapping(); ~NGOffsetMapping();
const UnitVector& GetUnits() const { return units_; } const UnitVector& GetUnits() const { return units_; }
...@@ -238,8 +240,6 @@ class CORE_EXPORT NGOffsetMapping { ...@@ -238,8 +240,6 @@ class CORE_EXPORT NGOffsetMapping {
// The text content string of the inline formatting context. Same string as // The text content string of the inline formatting context. Same string as
// |NGInlineNodeData::text_content_|. // |NGInlineNodeData::text_content_|.
String text_; String text_;
DISALLOW_COPY_AND_ASSIGN(NGOffsetMapping);
}; };
CORE_EXPORT LayoutBlockFlow* NGInlineFormattingContextOf(const Position&); CORE_EXPORT LayoutBlockFlow* NGInlineFormattingContextOf(const Position&);
......
...@@ -62,17 +62,19 @@ class CORE_EXPORT NGOffsetMappingBuilder { ...@@ -62,17 +62,19 @@ class CORE_EXPORT NGOffsetMappingBuilder {
public: public:
SourceNodeScope(NGOffsetMappingBuilder* builder, const LayoutObject* node); SourceNodeScope(NGOffsetMappingBuilder* builder, const LayoutObject* node);
SourceNodeScope(const SourceNodeScope&) = delete;
SourceNodeScope& operator=(const SourceNodeScope&) = delete;
~SourceNodeScope(); ~SourceNodeScope();
private: private:
NGOffsetMappingBuilder* const builder_ = nullptr; NGOffsetMappingBuilder* const builder_ = nullptr;
base::AutoReset<const LayoutObject*> layout_object_auto_reset_; base::AutoReset<const LayoutObject*> layout_object_auto_reset_;
base::AutoReset<unsigned> appended_length_auto_reset_; base::AutoReset<unsigned> appended_length_auto_reset_;
DISALLOW_COPY_AND_ASSIGN(SourceNodeScope);
}; };
NGOffsetMappingBuilder(); NGOffsetMappingBuilder();
NGOffsetMappingBuilder(const NGOffsetMappingBuilder&) = delete;
NGOffsetMappingBuilder& operator=(const NGOffsetMappingBuilder&) = delete;
void ReserveCapacity(unsigned capacity); void ReserveCapacity(unsigned capacity);
...@@ -140,8 +142,6 @@ class CORE_EXPORT NGOffsetMappingBuilder { ...@@ -140,8 +142,6 @@ class CORE_EXPORT NGOffsetMappingBuilder {
String destination_string_; String destination_string_;
friend class SourceNodeScope; friend class SourceNodeScope;
DISALLOW_COPY_AND_ASSIGN(NGOffsetMappingBuilder);
}; };
} // namespace blink } // namespace blink
......
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