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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 return m_rareInheritedData->variables.get(); 1450 return m_rareInheritedData->variables.get();
1451 } 1451 }
1452 1452
1453 void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariable Data> value) 1453 void ComputedStyle::setVariable(const AtomicString& name, PassRefPtr<CSSVariable Data> value)
1454 { 1454 {
1455 RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variabl es; 1455 RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variabl es;
1456 if (!variables) 1456 if (!variables)
1457 variables = StyleVariableData::create(); 1457 variables = StyleVariableData::create();
1458 else if (!variables->hasOneRef()) 1458 else if (!variables->hasOneRef())
1459 variables = variables->copy(); 1459 variables = variables->copy();
1460 variables->setVariable(name, value); 1460 variables->setVariable(name, std::move(value));
1461 } 1461 }
1462 1462
1463 void ComputedStyle::removeVariable(const AtomicString& name) 1463 void ComputedStyle::removeVariable(const AtomicString& name)
1464 { 1464 {
1465 RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variabl es; 1465 RefPtr<StyleVariableData>& variables = m_rareInheritedData.access()->variabl es;
1466 if (!variables) 1466 if (!variables)
1467 return; 1467 return;
1468 if (!variables->hasOneRef()) 1468 if (!variables->hasOneRef())
1469 variables = variables->copy(); 1469 variables = variables->copy();
1470 variables->removeVariable(name); 1470 variables->removeVariable(name);
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 if (value < 0) 2045 if (value < 0)
2046 fvalue -= 0.5f; 2046 fvalue -= 0.5f;
2047 else 2047 else
2048 fvalue += 0.5f; 2048 fvalue += 0.5f;
2049 } 2049 }
2050 2050
2051 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2051 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2052 } 2052 }
2053 2053
2054 } // namespace blink 2054 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ShapeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698