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

Side by Side Diff: third_party/WebKit/Source/core/layout/api/LayoutTextItem.h

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 unified diff | Download patch
OLDNEW
1 1
2 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Copyright 2016 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #ifndef LayoutTextItem_h 6 #ifndef LayoutTextItem_h
7 #define LayoutTextItem_h 7 #define LayoutTextItem_h
8 8
9 #include "core/layout/LayoutText.h" 9 #include "core/layout/LayoutText.h"
10 #include "core/layout/api/LayoutItem.h" 10 #include "core/layout/api/LayoutItem.h"
(...skipping 14 matching lines...) Expand all
25 { 25 {
26 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isText()); 26 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isText());
27 } 27 }
28 28
29 explicit LayoutTextItem(std::nullptr_t) : LayoutItem(nullptr) { } 29 explicit LayoutTextItem(std::nullptr_t) : LayoutItem(nullptr) { }
30 30
31 LayoutTextItem() { } 31 LayoutTextItem() { }
32 32
33 void setStyle(PassRefPtr<ComputedStyle> style) 33 void setStyle(PassRefPtr<ComputedStyle> style)
34 { 34 {
35 toText()->setStyle(style); 35 toText()->setStyle(std::move(style));
36 } 36 }
37 37
38 void setText(PassRefPtr<StringImpl> text, bool force = false) 38 void setText(PassRefPtr<StringImpl> text, bool force = false)
39 { 39 {
40 toText()->setText(text, force); 40 toText()->setText(std::move(text), force);
41 } 41 }
42 42
43 bool isTextFragment() const 43 bool isTextFragment() const
44 { 44 {
45 return toText()->isTextFragment(); 45 return toText()->isTextFragment();
46 } 46 }
47 47
48 void dirtyLineBoxes() 48 void dirtyLineBoxes()
49 { 49 {
50 toText()->dirtyLineBoxes(); 50 toText()->dirtyLineBoxes();
51 } 51 }
52 52
53 private: 53 private:
54 LayoutText* toText() { return toLayoutText(layoutObject()); } 54 LayoutText* toText() { return toLayoutText(layoutObject()); }
55 const LayoutText* toText() const { return toLayoutText(layoutObject()); } 55 const LayoutText* toText() const { return toLayoutText(layoutObject()); }
56 }; 56 };
57 57
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // LayoutTextItem_h 60 #endif // LayoutTextItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698