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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.h

Issue 2401523002: Replace ASSERT family with DCHECK and so on in core/dom/. (Closed)
Patch Set: Created 4 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
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) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. 6 * Copyright (C) 2003-2011, 2013, 2014 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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 return isElementOfType<T>(static_cast<const Node&>(element)); 931 return isElementOfType<T>(static_cast<const Node&>(element));
932 } 932 }
933 template <> 933 template <>
934 inline bool isElementOfType<const Element>(const Element&) { 934 inline bool isElementOfType<const Element>(const Element&) {
935 return true; 935 return true;
936 } 936 }
937 937
938 // Type casting. 938 // Type casting.
939 template <typename T> 939 template <typename T>
940 inline T& toElement(Node& node) { 940 inline T& toElement(Node& node) {
941 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); 941 SECURITY_DCHECK(isElementOfType<const T>(node));
942 return static_cast<T&>(node); 942 return static_cast<T&>(node);
943 } 943 }
944 template <typename T> 944 template <typename T>
945 inline T* toElement(Node* node) { 945 inline T* toElement(Node* node) {
946 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); 946 SECURITY_DCHECK(!node || isElementOfType<const T>(*node));
947 return static_cast<T*>(node); 947 return static_cast<T*>(node);
948 } 948 }
949 template <typename T> 949 template <typename T>
950 inline const T& toElement(const Node& node) { 950 inline const T& toElement(const Node& node) {
951 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); 951 SECURITY_DCHECK(isElementOfType<const T>(node));
952 return static_cast<const T&>(node); 952 return static_cast<const T&>(node);
953 } 953 }
954 template <typename T> 954 template <typename T>
955 inline const T* toElement(const Node* node) { 955 inline const T* toElement(const Node* node) {
956 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); 956 SECURITY_DCHECK(!node || isElementOfType<const T>(*node));
957 return static_cast<const T*>(node); 957 return static_cast<const T*>(node);
958 } 958 }
959 959
960 inline bool isDisabledFormControl(const Node* node) { 960 inline bool isDisabledFormControl(const Node* node) {
961 return node->isElementNode() && toElement(node)->isDisabledFormControl(); 961 return node->isElementNode() && toElement(node)->isDisabledFormControl();
962 } 962 }
963 963
964 inline Element* Node::parentElement() const { 964 inline Element* Node::parentElement() const {
965 ContainerNode* parent = parentNode(); 965 ContainerNode* parent = parentNode();
966 return parent && parent->isElementNode() ? toElement(parent) : nullptr; 966 return parent && parent->isElementNode() ? toElement(parent) : nullptr;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1151 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1152 static T* create(const QualifiedName&, Document&) 1152 static T* create(const QualifiedName&, Document&)
1153 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1153 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1154 T* T::create(const QualifiedName& tagName, Document& document) { \ 1154 T* T::create(const QualifiedName& tagName, Document& document) { \
1155 return new T(tagName, document); \ 1155 return new T(tagName, document); \
1156 } 1156 }
1157 1157
1158 } // namespace blink 1158 } // namespace blink
1159 1159
1160 #endif // Element_h 1160 #endif // Element_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentParser.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698