| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 WebPrivatePtr<Node> m_private; | 132 WebPrivatePtr<Node> m_private; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 #define DECLARE_WEB_NODE_TYPE_CASTS(type) \ | 135 #define DECLARE_WEB_NODE_TYPE_CASTS(type) \ |
| 136 template <> \ | 136 template <> \ |
| 137 BLINK_EXPORT type WebNode::to<type>(); \ | 137 BLINK_EXPORT type WebNode::to<type>(); \ |
| 138 template <> \ | 138 template <> \ |
| 139 BLINK_EXPORT const type WebNode::toConst<type>() const; | 139 BLINK_EXPORT const type WebNode::toConst<type>() const; |
| 140 | 140 |
| 141 #if BLINK_IMPLEMENTATION | 141 #if BLINK_IMPLEMENTATION |
| 142 #define DEFINE_WEB_NODE_TYPE_CASTS(type, predicate) \ | 142 #define DEFINE_WEB_NODE_TYPE_CASTS(type, predicate) \ |
| 143 template <> \ | 143 template <> \ |
| 144 type WebNode::to<type>() { \ | 144 type WebNode::to<type>() { \ |
| 145 ASSERT_WITH_SECURITY_IMPLICATION(isNull() || (predicate)); \ | 145 SECURITY_DCHECK(isNull() || (predicate)); \ |
| 146 type result; \ | 146 type result; \ |
| 147 result.WebNode::assign(*this); \ | 147 result.WebNode::assign(*this); \ |
| 148 return result; \ | 148 return result; \ |
| 149 } \ | 149 } \ |
| 150 template <> \ | 150 template <> \ |
| 151 const type WebNode::toConst<type>() const { \ | 151 const type WebNode::toConst<type>() const { \ |
| 152 ASSERT_WITH_SECURITY_IMPLICATION(isNull() || (predicate)); \ | 152 SECURITY_DCHECK(isNull() || (predicate)); \ |
| 153 type result; \ | 153 type result; \ |
| 154 result.WebNode::assign(*this); \ | 154 result.WebNode::assign(*this); \ |
| 155 return result; \ | 155 return result; \ |
| 156 } | 156 } |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 inline bool operator==(const WebNode& a, const WebNode& b) { | 159 inline bool operator==(const WebNode& a, const WebNode& b) { |
| 160 return a.equals(b); | 160 return a.equals(b); |
| 161 } | 161 } |
| 162 | 162 |
| 163 inline bool operator!=(const WebNode& a, const WebNode& b) { | 163 inline bool operator!=(const WebNode& a, const WebNode& b) { |
| 164 return !(a == b); | 164 return !(a == b); |
| 165 } | 165 } |
| 166 | 166 |
| 167 inline bool operator<(const WebNode& a, const WebNode& b) { | 167 inline bool operator<(const WebNode& a, const WebNode& b) { |
| 168 return a.lessThan(b); | 168 return a.lessThan(b); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| 172 | 172 |
| 173 #endif | 173 #endif |
| OLD | NEW |