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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h

Issue 2722763002: [LayoutNG] Switch NGBreakToken to being RefCounted. (Closed)
Patch Set: remove 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_break_token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h b/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h
index 5e318233c0d0698202032d8b2384dc45d4131052..9d3c8b14ddbedf7cf7bb0b3704b51d89f418d7ad 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h
@@ -21,12 +21,18 @@ class CORE_EXPORT NGBlockBreakToken : public NGBreakToken {
//
// The NGBlockBreakToken takes ownership of child_break_tokens, leaving it
// empty for the caller.
- NGBlockBreakToken(NGBlockNode* node,
- LayoutUnit used_block_size,
- HeapVector<Member<NGBreakToken>>& child_break_tokens);
+ static RefPtr<NGBlockBreakToken> create(
+ NGBlockNode* node,
+ LayoutUnit used_block_size,
+ Vector<RefPtr<NGBreakToken>>& child_break_tokens) {
+ return adoptRef(
+ new NGBlockBreakToken(node, used_block_size, child_break_tokens));
+ }
// Creates a break token for a node which cannot produce any more fragments.
- explicit NGBlockBreakToken(NGLayoutInputNode* node);
+ static RefPtr<NGBlockBreakToken> create(NGLayoutInputNode* node) {
+ return adoptRef(new NGBlockBreakToken(node));
+ }
// Represents the amount of block size used in previous fragments.
//
@@ -43,18 +49,19 @@ class CORE_EXPORT NGBlockBreakToken : public NGBreakToken {
// this child).
//
// A child which we haven't visited yet doesn't have a break token here.
- const HeapVector<Member<NGBreakToken>>& ChildBreakTokens() const {
+ const Vector<RefPtr<NGBreakToken>>& ChildBreakTokens() const {
return child_break_tokens_;
}
- DEFINE_INLINE_VIRTUAL_TRACE() {
- NGBreakToken::trace(visitor);
- visitor->trace(child_break_tokens_);
- }
-
private:
+ NGBlockBreakToken(NGBlockNode* node,
+ LayoutUnit used_block_size,
+ Vector<RefPtr<NGBreakToken>>& child_break_tokens);
+
+ explicit NGBlockBreakToken(NGLayoutInputNode* node);
+
LayoutUnit used_block_size_;
- HeapVector<Member<NGBreakToken>> child_break_tokens_;
+ Vector<RefPtr<NGBreakToken>> child_break_tokens_;
};
DEFINE_TYPE_CASTS(NGBlockBreakToken,
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_break_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698