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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageGeneratorValue.cpp

Issue 2359553003: Replaced PassRefPtr copies with moves. (Closed)
Patch Set: Created 4 years, 2 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 (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Don't generate an image for empty sizes. 108 // Don't generate an image for empty sizes.
109 if (size.isEmpty()) 109 if (size.isEmpty())
110 return nullptr; 110 return nullptr;
111 111
112 // Look up the image in our cache. 112 // Look up the image in our cache.
113 return m_images.get(size); 113 return m_images.get(size);
114 } 114 }
115 115
116 void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> ima ge) 116 void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> ima ge)
117 { 117 {
118 m_images.add(size, image); 118 m_images.add(size, std::move(image));
119 } 119 }
120 120
121 PassRefPtr<Image> CSSImageGeneratorValue::image(const LayoutObject& layoutObject , const IntSize& size, float zoom) 121 PassRefPtr<Image> CSSImageGeneratorValue::image(const LayoutObject& layoutObject , const IntSize& size, float zoom)
122 { 122 {
123 switch (getClassType()) { 123 switch (getClassType()) {
124 case CrossfadeClass: 124 case CrossfadeClass:
125 return toCSSCrossfadeValue(this)->image(layoutObject, size); 125 return toCSSCrossfadeValue(this)->image(layoutObject, size);
126 case LinearGradientClass: 126 case LinearGradientClass:
127 return toCSSLinearGradientValue(this)->image(layoutObject, size); 127 return toCSSLinearGradientValue(this)->image(layoutObject, size);
128 case PaintClass: 128 case PaintClass:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 break; 217 break;
218 case RadialGradientClass: 218 case RadialGradientClass:
219 toCSSRadialGradientValue(this)->loadSubimages(document); 219 toCSSRadialGradientValue(this)->loadSubimages(document);
220 break; 220 break;
221 default: 221 default:
222 ASSERT_NOT_REACHED(); 222 ASSERT_NOT_REACHED();
223 } 223 }
224 } 224 }
225 225
226 } // namespace blink 226 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698