OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 } | 376 } |
377 | 377 |
378 template<typename T> struct ConvertableToTraceFormatTraits { | 378 template<typename T> struct ConvertableToTraceFormatTraits { |
379 static const bool isConvertable = false; | 379 static const bool isConvertable = false; |
380 static PassRefPtr<ConvertableToTraceFormat> moveFromIfConvertable(const T&) | 380 static PassRefPtr<ConvertableToTraceFormat> moveFromIfConvertable(const T&) |
381 { | 381 { |
382 return nullptr; | 382 return nullptr; |
383 } | 383 } |
384 }; | 384 }; |
385 | 385 |
386 template<typename T> struct ConvertableToTraceFormatTraits<PassRefPtr<T>> { | 386 template<typename T> struct ConvertableToTraceFormatTraits<PassRefPtr<T>> { |
Nico
2015/12/09 15:09:39
"Convertable", sigh.
| |
387 static const bool isConvertable = WTF::IsSubclass<T, TraceEvent::Convertable ToTraceFormat>::value; | 387 static const bool isConvertable = std::is_convertible<T*, TraceEvent::Conver tableToTraceFormat*>::value; |
388 static PassRefPtr<ConvertableToTraceFormat> moveFromIfConvertable(const Pass RefPtr<T>& convertableToTraceFormat) | 388 static PassRefPtr<ConvertableToTraceFormat> moveFromIfConvertable(const Pass RefPtr<T>& convertableToTraceFormat) |
389 { | 389 { |
390 return convertableToTraceFormat; | 390 return convertableToTraceFormat; |
391 } | 391 } |
392 }; | 392 }; |
393 | 393 |
394 template<typename T> bool isConvertableToTraceFormat(const T&) | 394 template<typename T> bool isConvertableToTraceFormat(const T&) |
395 { | 395 { |
396 return ConvertableToTraceFormatTraits<T>::isConvertable; | 396 return ConvertableToTraceFormatTraits<T>::isConvertable; |
397 } | 397 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 const char* m_categoryGroup; | 611 const char* m_categoryGroup; |
612 const char* m_name; | 612 const char* m_name; |
613 IDType m_id; | 613 IDType m_id; |
614 }; | 614 }; |
615 | 615 |
616 } // namespace TraceEvent | 616 } // namespace TraceEvent |
617 | 617 |
618 } // namespace blink | 618 } // namespace blink |
619 | 619 |
620 #endif | 620 #endif |
OLD | NEW |