| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 #define EnsurePtrConvertibleArgDecl(From, To) \ | 296 #define EnsurePtrConvertibleArgDecl(From, To) \ |
| 297 typename WTF::EnableIf<WTF::IsPointerConvertible<From, To>::Value, bool>::Ty
pe = true | 297 typename WTF::EnableIf<WTF::IsPointerConvertible<From, To>::Value, bool>::Ty
pe = true |
| 298 #define EnsurePtrConvertibleArgDefn(From, To) \ | 298 #define EnsurePtrConvertibleArgDefn(From, To) \ |
| 299 typename WTF::EnableIf<WTF::IsPointerConvertible<From, To>::Value, bool>::Ty
pe | 299 typename WTF::EnableIf<WTF::IsPointerConvertible<From, To>::Value, bool>::Ty
pe |
| 300 | 300 |
| 301 } // namespace WTF | 301 } // namespace WTF |
| 302 | 302 |
| 303 namespace blink { | 303 namespace blink { |
| 304 | 304 |
| 305 class JSONValue; | |
| 306 class Visitor; | 305 class Visitor; |
| 307 | 306 |
| 308 } // namespace blink | 307 } // namespace blink |
| 309 | 308 |
| 310 namespace WTF { | 309 namespace WTF { |
| 311 | 310 |
| 312 // FIXME: Disable pointer conversion checking against JSONValue. | |
| 313 // The current CodeGeneratorInspector.py generates code which upcasts to JSO
NValue from undefined types. | |
| 314 template<typename From> class IsPointerConvertible<From, blink::JSONValue> { | |
| 315 public: | |
| 316 enum { | |
| 317 Value = true | |
| 318 }; | |
| 319 }; | |
| 320 | |
| 321 template<typename T> | 311 template<typename T> |
| 322 class NeedsTracing { | 312 class NeedsTracing { |
| 323 typedef char YesType; | 313 typedef char YesType; |
| 324 typedef struct NoType { | 314 typedef struct NoType { |
| 325 char padding[8]; | 315 char padding[8]; |
| 326 } NoType; | 316 } NoType; |
| 327 | 317 |
| 328 // Note that this also checks if a superclass of V has a trace method. | 318 // Note that this also checks if a superclass of V has a trace method. |
| 329 template<typename V> static YesType checkHasTraceMethod(V* v, blink::Visitor
* p = 0, typename EnableIf<IsSameType<decltype(v->trace(p)), void>::value>::Type
* g = 0); | 319 template<typename V> static YesType checkHasTraceMethod(V* v, blink::Visitor
* p = 0, typename EnableIf<IsSameType<decltype(v->trace(p)), void>::value>::Type
* g = 0); |
| 330 template<typename V> static NoType checkHasTraceMethod(...); | 320 template<typename V> static NoType checkHasTraceMethod(...); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 344 }; | 334 }; |
| 345 | 335 |
| 346 template<typename T, typename U> | 336 template<typename T, typename U> |
| 347 struct NeedsTracing<std::pair<T, U>> { | 337 struct NeedsTracing<std::pair<T, U>> { |
| 348 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; | 338 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; |
| 349 }; | 339 }; |
| 350 | 340 |
| 351 } // namespace WTF | 341 } // namespace WTF |
| 352 | 342 |
| 353 #endif // TypeTraits_h | 343 #endif // TypeTraits_h |
| OLD | NEW |