Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 587 if (!that.IsEmpty()) T::Cast(*that); | 587 if (!that.IsEmpty()) T::Cast(*that); |
| 588 #endif | 588 #endif |
| 589 return reinterpret_cast<Persistent<T>&>(that); | 589 return reinterpret_cast<Persistent<T>&>(that); |
| 590 } | 590 } |
| 591 | 591 |
| 592 template <class S> V8_INLINE(Persistent<S>& As()) { // NOLINT | 592 template <class S> V8_INLINE(Persistent<S>& As()) { // NOLINT |
| 593 return Persistent<S>::Cast(*this); | 593 return Persistent<S>::Cast(*this); |
| 594 } | 594 } |
| 595 #endif | 595 #endif |
| 596 | 596 |
| 597 template <class S> V8_INLINE( | |
| 598 static Persistent<T>& Upcast(Persistent<S>& that)) { // NOLINT | |
|
Sven Panne
2013/06/05 07:08:49
How does this relate to Persistent::Cast? It looks
| |
| 599 TYPE_CHECK(T, S); | |
| 600 return reinterpret_cast<Persistent<T>&>(that); | |
| 601 } | |
| 602 | |
| 597 V8_DEPRECATED(static Persistent<T> New(Handle<T> that)); | 603 V8_DEPRECATED(static Persistent<T> New(Handle<T> that)); |
| 598 | 604 |
| 599 /** | 605 /** |
| 600 * Creates a new persistent handle for an existing local or persistent handle. | 606 * Creates a new persistent handle for an existing local or persistent handle. |
| 601 */ | 607 */ |
| 602 // TODO(dcarney): remove before cutover | 608 // TODO(dcarney): remove before cutover |
| 603 V8_INLINE(static Persistent<T> New(Isolate* isolate, Handle<T> that)); | 609 V8_INLINE(static Persistent<T> New(Isolate* isolate, Handle<T> that)); |
| 604 #ifndef V8_USE_UNSAFE_HANDLES | 610 #ifndef V8_USE_UNSAFE_HANDLES |
| 605 // TODO(dcarney): remove before cutover | 611 // TODO(dcarney): remove before cutover |
| 606 V8_INLINE(static Persistent<T> New(Isolate* isolate, Persistent<T> that)); | 612 V8_INLINE(static Persistent<T> New(Isolate* isolate, Persistent<T> that)); |
| (...skipping 5669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6276 | 6282 |
| 6277 | 6283 |
| 6278 } // namespace v8 | 6284 } // namespace v8 |
| 6279 | 6285 |
| 6280 | 6286 |
| 6281 #undef V8EXPORT | 6287 #undef V8EXPORT |
| 6282 #undef TYPE_CHECK | 6288 #undef TYPE_CHECK |
| 6283 | 6289 |
| 6284 | 6290 |
| 6285 #endif // V8_H_ | 6291 #endif // V8_H_ |
| OLD | NEW |