Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc

Issue 2722763002: [LayoutNG] Switch NGBreakToken to being RefCounted. (Closed)
Patch Set: add comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index a755d5ac107dacdcbe1c428a14e894e3a1971784..dcbed4f792bd10c94ea5e01918bdb3d132f9eada 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -306,10 +306,10 @@ bool IsOutOfSpace(const NGConstraintSpace& space, LayoutUnit content_size) {
NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(
NGBlockNode* node,
NGConstraintSpace* constraint_space,
- NGBlockBreakToken* break_token)
+ RefPtr<NGBlockBreakToken> break_token)
: node_(node),
constraint_space_(constraint_space),
- break_token_(break_token),
+ break_token_(std::move(break_token)),
builder_(WTF::wrapUnique(
new NGFragmentBuilder(NGPhysicalFragment::kFragmentBox, node))) {}
@@ -411,7 +411,7 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
builder_->SetWritingMode(constraint_space_->WritingMode());
builder_->SetInlineSize(inline_size).SetBlockSize(block_size);
- NGBlockChildIterator child_iterator(node_->FirstChild(), break_token_);
+ NGBlockChildIterator child_iterator(node_->FirstChild(), break_token_.get());
NGBlockChildIterator::Entry entry = child_iterator.NextChild();
current_child_ = entry.node;
NGBreakToken* child_break_token = entry.token;

Powered by Google App Engine
This is Rietveld 408576698