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

Side by Side Diff: Source/core/svg/SVGPaint.h

Issue 27183005: Use DEFINE_CSS_VALUE_TYPE_CASTS() for SVGColor, SVGPaint, and TextCloneCSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/svg/SVGColor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmial.com> 4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmial.com>
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 private: 111 private:
112 SVGPaint(const SVGPaintType&, const String& uri = String()); 112 SVGPaint(const SVGPaintType&, const String& uri = String());
113 SVGPaint(const SVGPaint& cloneFrom); 113 SVGPaint(const SVGPaint& cloneFrom);
114 114
115 SVGPaintType m_paintType; 115 SVGPaintType m_paintType;
116 String m_uri; 116 String m_uri;
117 }; 117 };
118 118
119 // This will catch anyone doing an unnecessary cast. 119 DEFINE_CSS_VALUE_TYPE_CASTS(SVGPaint, isSVGPaint());
120 SVGPaint* toSVGPaint(const SVGColor*);
121
122 inline SVGPaint* toSVGPaint(CSSValue* value)
123 {
124 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGPaint());
125 return static_cast<SVGPaint*>(value);
126 }
127
128 inline const SVGPaint* toSVGPaint(const CSSValue* value)
129 {
130 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isSVGPaint());
131 return static_cast<const SVGPaint*>(value);
132 }
133 120
134 } // namespace WebCore 121 } // namespace WebCore
135 122
136 #endif // SVGPaint_h 123 #endif // SVGPaint_h
OLDNEW
« no previous file with comments | « Source/core/svg/SVGColor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698