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