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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2282413002: Replaced PassRefPtr copies with moves in Source/core. (Closed)
Patch Set: rebased Created 4 years, 3 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/LayoutText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp
index a6d33292f4d42ba5d7b67eaa06d11309ddbcdacb..316e7b86ffc69818cf0e122639f219710f16b36a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -148,7 +148,7 @@ LayoutText::LayoutText(Node* node, PassRefPtr<StringImpl> str)
, m_maxWidth(-1)
, m_firstLineMinWidth(0)
, m_lastLineLineMinWidth(0)
- , m_text(str)
+ , m_text(std::move(str))
, m_firstTextBox(nullptr)
, m_lastTextBox(nullptr)
{
@@ -1345,7 +1345,7 @@ void LayoutText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset,
}
m_linesDirty = dirtiedLines;
- setText(text, force || dirtiedLines);
+ setText(std::move(text), force || dirtiedLines);
}
void LayoutText::transformText()
@@ -1407,7 +1407,7 @@ void applyTextTransform(const ComputedStyle* style, String& text, UChar previous
void LayoutText::setTextInternal(PassRefPtr<StringImpl> text)
{
ASSERT(text);
- m_text = text;
+ m_text = std::move(text);
if (style()) {
applyTextTransform(style(), m_text, previousCharacter());
@@ -1463,7 +1463,7 @@ void LayoutText::setText(PassRefPtr<StringImpl> text, bool force)
if (!force && equal(m_text.impl(), text.get()))
return;
- setTextInternal(text);
+ setTextInternal(std::move(text));
// If preferredLogicalWidthsDirty() of an orphan child is true, LayoutObjectChildList::
// insertChildNode() fails to set true to owner. To avoid that, we call
// setNeedsLayoutAndPrefWidthsRecalc() only if this LayoutText has parent.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTextCombine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698