OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 * pointing to the same object, and no flags are set. | 808 * pointing to the same object, and no flags are set. |
809 */ | 809 */ |
810 template <class S> | 810 template <class S> |
811 V8_INLINE Global(Isolate* isolate, const PersistentBase<S>& that) | 811 V8_INLINE Global(Isolate* isolate, const PersistentBase<S>& that) |
812 : PersistentBase<T>(PersistentBase<T>::New(isolate, that.val_)) { | 812 : PersistentBase<T>(PersistentBase<T>::New(isolate, that.val_)) { |
813 TYPE_CHECK(T, S); | 813 TYPE_CHECK(T, S); |
814 } | 814 } |
815 /** | 815 /** |
816 * Move constructor. | 816 * Move constructor. |
817 */ | 817 */ |
818 V8_INLINE Global(Global&& other) : PersistentBase<T>(other.val_) { | 818 V8_INLINE Global(Global&& other) : PersistentBase<T>(other.val_) { // NOLINT |
819 other.val_ = nullptr; | 819 other.val_ = nullptr; |
820 } | 820 } |
821 V8_INLINE ~Global() { this->Reset(); } | 821 V8_INLINE ~Global() { this->Reset(); } |
822 /** | 822 /** |
823 * Move via assignment. | 823 * Move via assignment. |
824 */ | 824 */ |
825 template <class S> | 825 template <class S> |
826 V8_INLINE Global& operator=(Global<S>&& rhs) { | 826 V8_INLINE Global& operator=(Global<S>&& rhs) { // NOLINT |
827 TYPE_CHECK(T, S); | 827 TYPE_CHECK(T, S); |
828 if (this != &rhs) { | 828 if (this != &rhs) { |
829 this->Reset(); | 829 this->Reset(); |
830 this->val_ = rhs.val_; | 830 this->val_ = rhs.val_; |
831 rhs.val_ = nullptr; | 831 rhs.val_ = nullptr; |
832 } | 832 } |
833 return *this; | 833 return *this; |
834 } | 834 } |
835 /** | 835 /** |
836 * Pass allows returning uniques from functions, etc. | 836 * Pass allows returning uniques from functions, etc. |
837 */ | 837 */ |
838 Global Pass() { return static_cast<Global&&>(*this); } | 838 Global Pass() { return static_cast<Global&&>(*this); } // NOLINT |
839 | 839 |
840 /* | 840 /* |
841 * For compatibility with Chromium's base::Bind (base::Passed). | 841 * For compatibility with Chromium's base::Bind (base::Passed). |
842 */ | 842 */ |
843 typedef void MoveOnlyTypeForCPP03; | 843 typedef void MoveOnlyTypeForCPP03; |
844 | 844 |
845 private: | 845 private: |
846 template <class F> | 846 template <class F> |
847 friend class ReturnValue; | 847 friend class ReturnValue; |
848 Global(const Global&) = delete; | 848 Global(const Global&) = delete; |
(...skipping 7498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8347 */ | 8347 */ |
8348 | 8348 |
8349 | 8349 |
8350 } // namespace v8 | 8350 } // namespace v8 |
8351 | 8351 |
8352 | 8352 |
8353 #undef TYPE_CHECK | 8353 #undef TYPE_CHECK |
8354 | 8354 |
8355 | 8355 |
8356 #endif // V8_H_ | 8356 #endif // V8_H_ |
OLD | NEW |