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

Side by Side Diff: third_party/WebKit/Source/core/style/ContentData.h

Issue 2751653003: Replace ASSERT and ASSERT_NOT_REACHED in core/style/ (Closed)
Patch Set: Replace ASSERT and ASSERT_NOT_REACHED in core/style/ Created 3 years, 9 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 DEFINE_TYPE_CASTS(typeName##ContentData, ContentData, content, \ 72 DEFINE_TYPE_CASTS(typeName##ContentData, ContentData, content, \
73 content->is##typeName(), content.is##typeName()) 73 content->is##typeName(), content.is##typeName())
74 74
75 class ImageContentData final : public ContentData { 75 class ImageContentData final : public ContentData {
76 friend class ContentData; 76 friend class ContentData;
77 77
78 public: 78 public:
79 const StyleImage* image() const { return m_image.get(); } 79 const StyleImage* image() const { return m_image.get(); }
80 StyleImage* image() { return m_image.get(); } 80 StyleImage* image() { return m_image.get(); }
81 void setImage(StyleImage* image) { 81 void setImage(StyleImage* image) {
82 ASSERT(image); 82 DCHECK(image);
83 m_image = image; 83 m_image = image;
84 } 84 }
85 85
86 bool isImage() const override { return true; } 86 bool isImage() const override { return true; }
87 LayoutObject* createLayoutObject(Document&, ComputedStyle&) const override; 87 LayoutObject* createLayoutObject(Document&, ComputedStyle&) const override;
88 88
89 bool equals(const ContentData& data) const override { 89 bool equals(const ContentData& data) const override {
90 if (!data.isImage()) 90 if (!data.isImage())
91 return false; 91 return false;
92 return *static_cast<const ImageContentData&>(data).image() == *image(); 92 return *static_cast<const ImageContentData&>(data).image() == *image();
93 } 93 }
94 94
95 DECLARE_VIRTUAL_TRACE(); 95 DECLARE_VIRTUAL_TRACE();
96 96
97 private: 97 private:
98 ImageContentData(StyleImage* image) : m_image(image) { ASSERT(m_image); } 98 ImageContentData(StyleImage* image) : m_image(image) { DCHECK(m_image); }
99 99
100 ContentData* cloneInternal() const override { 100 ContentData* cloneInternal() const override {
101 StyleImage* image = const_cast<StyleImage*>(this->image()); 101 StyleImage* image = const_cast<StyleImage*>(this->image());
102 return create(image); 102 return create(image);
103 } 103 }
104 104
105 Member<StyleImage> m_image; 105 Member<StyleImage> m_image;
106 }; 106 };
107 107
108 DEFINE_CONTENT_DATA_TYPE_CASTS(Image); 108 DEFINE_CONTENT_DATA_TYPE_CASTS(Image);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return a.equals(b); 197 return a.equals(b);
198 } 198 }
199 199
200 inline bool operator!=(const ContentData& a, const ContentData& b) { 200 inline bool operator!=(const ContentData& a, const ContentData& b) {
201 return !(a == b); 201 return !(a == b);
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
205 205
206 #endif // ContentData_h 206 #endif // ContentData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/core/style/CounterDirectives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698