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

Unified Diff: Source/core/rendering/style/ContentData.h

Issue 404343002: Introduce DEFINE_CONTENT_DATA_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/ContentData.h
diff --git a/Source/core/rendering/style/ContentData.h b/Source/core/rendering/style/ContentData.h
index 1bf4bf6ef317a6783b6314065af8f5437e81bc70..531091fe06681c8cbbaec8fe1b6bbdfb7ffc913b 100644
--- a/Source/core/rendering/style/ContentData.h
+++ b/Source/core/rendering/style/ContentData.h
@@ -66,6 +66,9 @@ private:
OwnPtr<ContentData> m_next;
};
+#define DEFINE_CONTENT_DATA_TYPE_CASTS(typeName) \
+ DEFINE_TYPE_CASTS(typeName##ContentData, ContentData, content, content->is##typeName(), content.is##typeName())
+
class ImageContentData FINAL : public ContentData {
friend class ContentData;
public:
@@ -98,6 +101,8 @@ private:
RefPtr<StyleImage> m_image;
};
+DEFINE_CONTENT_DATA_TYPE_CASTS(Image);
+
class TextContentData FINAL : public ContentData {
friend class ContentData;
public:
@@ -125,6 +130,8 @@ private:
String m_text;
};
+DEFINE_CONTENT_DATA_TYPE_CASTS(Text);
+
class CounterContentData FINAL : public ContentData {
friend class ContentData;
public:
@@ -156,6 +163,8 @@ private:
OwnPtr<CounterContent> m_counter;
};
+DEFINE_CONTENT_DATA_TYPE_CASTS(Counter);
+
class QuoteContentData FINAL : public ContentData {
friend class ContentData;
public:
@@ -183,6 +192,8 @@ private:
QuoteType m_quote;
};
+DEFINE_CONTENT_DATA_TYPE_CASTS(Quote);
+
inline bool operator==(const ContentData& a, const ContentData& b)
{
return a.equals(b);
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698