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

Side by Side Diff: Source/core/rendering/RenderImage.h

Issue 33983003: Introduce DEFINE_RENDER_OBJECT_TYPE_CASTS to replace manual toRenderFoo, and use it (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/rendering/RenderIFrame.h ('k') | Source/core/rendering/RenderInline.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 String m_altText; 113 String m_altText;
114 OwnPtr<RenderImageResource> m_imageResource; 114 OwnPtr<RenderImageResource> m_imageResource;
115 bool m_needsToSetSizeForAltText; 115 bool m_needsToSetSizeForAltText;
116 bool m_didIncrementVisuallyNonEmptyPixelCount; 116 bool m_didIncrementVisuallyNonEmptyPixelCount;
117 bool m_isGeneratedContent; 117 bool m_isGeneratedContent;
118 float m_imageDevicePixelRatio; 118 float m_imageDevicePixelRatio;
119 119
120 friend class RenderImageScaleObserver; 120 friend class RenderImageScaleObserver;
121 }; 121 };
122 122
123 inline RenderImage* toRenderImage(RenderObject* object) 123 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderImage, isRenderImage());
124 {
125 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage());
126 return static_cast<RenderImage*>(object);
127 }
128
129 inline const RenderImage* toRenderImage(const RenderObject* object)
130 {
131 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage());
132 return static_cast<const RenderImage*>(object);
133 }
134
135 // This will catch anyone doing an unnecessary cast.
136 void toRenderImage(const RenderImage*);
137 124
138 } // namespace WebCore 125 } // namespace WebCore
139 126
140 #endif // RenderImage_h 127 #endif // RenderImage_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderIFrame.h ('k') | Source/core/rendering/RenderInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698