| OLD | NEW |
| 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 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 } | 924 } |
| 925 | 925 |
| 926 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. | 926 // Allow equality comparisons of Nodes by reference or pointer, interchangeably. |
| 927 inline bool operator==(const Node& a, const Node& b) { return &a == &b; } | 927 inline bool operator==(const Node& a, const Node& b) { return &a == &b; } |
| 928 inline bool operator==(const Node& a, const Node* b) { return &a == b; } | 928 inline bool operator==(const Node& a, const Node* b) { return &a == b; } |
| 929 inline bool operator==(const Node* a, const Node& b) { return a == &b; } | 929 inline bool operator==(const Node* a, const Node& b) { return a == &b; } |
| 930 inline bool operator!=(const Node& a, const Node& b) { return !(a == b); } | 930 inline bool operator!=(const Node& a, const Node& b) { return !(a == b); } |
| 931 inline bool operator!=(const Node& a, const Node* b) { return !(a == b); } | 931 inline bool operator!=(const Node& a, const Node* b) { return !(a == b); } |
| 932 inline bool operator!=(const Node* a, const Node& b) { return !(a == b); } | 932 inline bool operator!=(const Node* a, const Node& b) { return !(a == b); } |
| 933 | 933 |
| 934 // FIXME: Move to more generic place. | |
| 935 #define DEFINE_TYPE_CASTS(thisType, argumentType, argumentName, pointerPredicate
, referencePredicate) \ | |
| 936 inline thisType* to##thisType(argumentType* argumentName) \ | |
| 937 { \ | |
| 938 ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \ | |
| 939 return static_cast<thisType*>(argumentName); \ | |
| 940 } \ | |
| 941 inline const thisType* to##thisType(const argumentType* argumentName) \ | |
| 942 { \ | |
| 943 ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \ | |
| 944 return static_cast<const thisType*>(argumentName); \ | |
| 945 } \ | |
| 946 inline thisType& to##thisType(argumentType& argumentName) \ | |
| 947 { \ | |
| 948 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | |
| 949 return static_cast<thisType&>(argumentName); \ | |
| 950 } \ | |
| 951 inline const thisType& to##thisType(const argumentType& argumentName) \ | |
| 952 { \ | |
| 953 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | |
| 954 return static_cast<const thisType&>(argumentName); \ | |
| 955 } \ | |
| 956 void to##thisType(const thisType*); \ | |
| 957 void to##thisType(const thisType&) | |
| 958 | |
| 959 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ | 934 #define DEFINE_NODE_TYPE_CASTS(thisType, predicate) \ |
| 960 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) | 935 DEFINE_TYPE_CASTS(thisType, Node, node, node->predicate, node.predicate) |
| 961 | 936 |
| 962 } // namespace WebCore | 937 } // namespace WebCore |
| 963 | 938 |
| 964 #ifndef NDEBUG | 939 #ifndef NDEBUG |
| 965 // Outside the WebCore namespace for ease of invocation from gdb. | 940 // Outside the WebCore namespace for ease of invocation from gdb. |
| 966 void showTree(const WebCore::Node*); | 941 void showTree(const WebCore::Node*); |
| 967 void showNodePath(const WebCore::Node*); | 942 void showNodePath(const WebCore::Node*); |
| 968 #endif | 943 #endif |
| 969 | 944 |
| 970 #endif | 945 #endif |
| OLD | NEW |