| 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 * responsible of eventually destroying the underlying object (by creating a | 757 * responsible of eventually destroying the underlying object (by creating a |
| 758 * Persistent handle which points to it and Disposing it). In the future, | 758 * Persistent handle which points to it and Disposing it). In the future, |
| 759 * destructing a Persistent will also Dispose it. With this function, the | 759 * destructing a Persistent will also Dispose it. With this function, the |
| 760 * embedder can let the Persistent go out of scope without it getting | 760 * embedder can let the Persistent go out of scope without it getting |
| 761 * disposed. | 761 * disposed. |
| 762 */ | 762 */ |
| 763 V8_INLINE(T* ClearAndLeak()); | 763 V8_INLINE(T* ClearAndLeak()); |
| 764 | 764 |
| 765 #ifndef V8_USE_UNSAFE_HANDLES | 765 #ifndef V8_USE_UNSAFE_HANDLES |
| 766 | 766 |
| 767 #ifndef V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT | |
| 768 | |
| 769 private: | 767 private: |
| 770 #endif | |
| 771 // TODO(dcarney): make unlinkable before cutover | 768 // TODO(dcarney): make unlinkable before cutover |
| 772 V8_INLINE(Persistent(const Persistent& that)) : val_(that.val_) {} | 769 V8_INLINE(Persistent(const Persistent& that)) : val_(that.val_) {} |
| 773 // TODO(dcarney): make unlinkable before cutover | 770 // TODO(dcarney): make unlinkable before cutover |
| 774 V8_INLINE(Persistent& operator=(const Persistent& that)) { // NOLINT | 771 V8_INLINE(Persistent& operator=(const Persistent& that)) { // NOLINT |
| 775 this->val_ = that.val_; | 772 this->val_ = that.val_; |
| 776 return *this; | 773 return *this; |
| 777 } | 774 } |
| 778 | 775 |
| 779 public: | 776 public: |
| 780 #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | 777 #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR |
| 781 | 778 |
| 782 private: | 779 private: |
| 783 #endif | 780 #endif |
| 784 // TODO(dcarney): remove before cutover | 781 // TODO(dcarney): remove before cutover |
| 785 template <class S> V8_INLINE(Persistent(S* that)) : val_(that) { } | 782 template <class S> V8_INLINE(Persistent(S* that)) : val_(that) { } |
| 786 // TODO(dcarney): remove before cutover | 783 // TODO(dcarney): remove before cutover |
| 787 template <class S> V8_INLINE(Persistent(Persistent<S> that)) | 784 template <class S> V8_INLINE(Persistent(Persistent<S> that)) |
| 788 : val_(*that) { | 785 : val_(*that) { |
| 789 TYPE_CHECK(T, S); | 786 TYPE_CHECK(T, S); |
| 790 } | 787 } |
| 791 // TODO(dcarney): remove before cutover | 788 // TODO(dcarney): remove before cutover |
| 792 V8_INLINE(T* operator*() const) { return val_; } | 789 V8_INLINE(T* operator*() const) { return val_; } |
| 793 public: | |
| 794 #ifndef V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW | |
| 795 | 790 |
| 796 private: | 791 private: |
| 797 #endif | |
| 798 // TODO(dcarney): remove before cutover | 792 // TODO(dcarney): remove before cutover |
| 799 V8_INLINE(T* operator->() const) { return val_; } | 793 V8_INLINE(T* operator->() const) { return val_; } |
| 800 public: | 794 public: |
| 801 #endif | 795 #endif |
| 802 | 796 |
| 803 private: | 797 private: |
| 804 template<class F> friend class Handle; | 798 template<class F> friend class Handle; |
| 805 template<class F> friend class Local; | 799 template<class F> friend class Local; |
| 806 friend class ImplementationUtilities; | 800 friend class ImplementationUtilities; |
| 807 friend class ObjectTemplate; | 801 friend class ObjectTemplate; |
| (...skipping 5480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6288 | 6282 |
| 6289 | 6283 |
| 6290 } // namespace v8 | 6284 } // namespace v8 |
| 6291 | 6285 |
| 6292 | 6286 |
| 6293 #undef V8EXPORT | 6287 #undef V8EXPORT |
| 6294 #undef TYPE_CHECK | 6288 #undef TYPE_CHECK |
| 6295 | 6289 |
| 6296 | 6290 |
| 6297 #endif // V8_H_ | 6291 #endif // V8_H_ |
| OLD | NEW |