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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGEnumeration.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return svgEnumeration; 45 return svgEnumeration;
46 } 46 }
47 47
48 String SVGEnumerationBase::valueAsString() const { 48 String SVGEnumerationBase::valueAsString() const {
49 for (const auto& entry : m_entries) { 49 for (const auto& entry : m_entries) {
50 if (m_value == entry.first) 50 if (m_value == entry.first)
51 return entry.second; 51 return entry.second;
52 } 52 }
53 53
54 ASSERT(m_value < maxInternalEnumValue()); 54 ASSERT(m_value < maxInternalEnumValue());
55 return emptyString(); 55 return emptyString;
56 } 56 }
57 57
58 void SVGEnumerationBase::setValue(unsigned short value) { 58 void SVGEnumerationBase::setValue(unsigned short value) {
59 m_value = value; 59 m_value = value;
60 notifyChange(); 60 notifyChange();
61 } 61 }
62 62
63 SVGParsingError SVGEnumerationBase::setValueAsString(const String& string) { 63 SVGParsingError SVGEnumerationBase::setValueAsString(const String& string) {
64 for (const auto& entry : m_entries) { 64 for (const auto& entry : m_entries) {
65 if (string == entry.second) { 65 if (string == entry.second) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 animationElement->animateDiscreteType<unsigned short>( 98 animationElement->animateDiscreteType<unsigned short>(
99 percentage, fromEnumeration, toEnumeration, m_value); 99 percentage, fromEnumeration, toEnumeration, m_value);
100 } 100 }
101 101
102 float SVGEnumerationBase::calculateDistance(SVGPropertyBase*, SVGElement*) { 102 float SVGEnumerationBase::calculateDistance(SVGPropertyBase*, SVGElement*) {
103 // No paced animations for boolean. 103 // No paced animations for boolean.
104 return -1; 104 return -1;
105 } 105 }
106 106
107 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698