Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: include/v8.h

Issue 2278573002: [api] Disable copy constructors in the public section. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 * description in v8-profiler.h for details. 608 * description in v8-profiler.h for details.
609 */ 609 */
610 V8_INLINE void SetWrapperClassId(uint16_t class_id); 610 V8_INLINE void SetWrapperClassId(uint16_t class_id);
611 611
612 /** 612 /**
613 * Returns the class ID previously assigned to this handle or 0 if no class ID 613 * Returns the class ID previously assigned to this handle or 0 if no class ID
614 * was previously assigned. 614 * was previously assigned.
615 */ 615 */
616 V8_INLINE uint16_t WrapperClassId() const; 616 V8_INLINE uint16_t WrapperClassId() const;
617 617
618 PersistentBase(const PersistentBase& other) = delete; // NOLINT
619 void operator=(const PersistentBase&) = delete;
620
618 private: 621 private:
619 friend class Isolate; 622 friend class Isolate;
620 friend class Utils; 623 friend class Utils;
621 template<class F> friend class Local; 624 template<class F> friend class Local;
622 template<class F1, class F2> friend class Persistent; 625 template<class F1, class F2> friend class Persistent;
623 template <class F> 626 template <class F>
624 friend class Global; 627 friend class Global;
625 template<class F> friend class PersistentBase; 628 template<class F> friend class PersistentBase;
626 template<class F> friend class ReturnValue; 629 template<class F> friend class ReturnValue;
627 template <class F1, class F2, class F3> 630 template <class F1, class F2, class F3>
628 friend class PersistentValueMapBase; 631 friend class PersistentValueMapBase;
629 template<class F1, class F2> friend class PersistentValueVector; 632 template<class F1, class F2> friend class PersistentValueVector;
630 friend class Object; 633 friend class Object;
631 634
632 explicit V8_INLINE PersistentBase(T* val) : val_(val) {} 635 explicit V8_INLINE PersistentBase(T* val) : val_(val) {}
633 PersistentBase(const PersistentBase& other) = delete; // NOLINT
634 void operator=(const PersistentBase&) = delete;
635 V8_INLINE static T* New(Isolate* isolate, T* that); 636 V8_INLINE static T* New(Isolate* isolate, T* that);
636 637
637 T* val_; 638 T* val_;
638 }; 639 };
639 640
640 641
641 /** 642 /**
642 * Default traits for Persistent. This class does not allow 643 * Default traits for Persistent. This class does not allow
643 * use of the copy constructor or assignment operator. 644 * use of the copy constructor or assignment operator.
644 * At present kResetInDestructor is not set, but that will change in a future 645 * At present kResetInDestructor is not set, but that will change in a future
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 /** 829 /**
829 * Pass allows returning uniques from functions, etc. 830 * Pass allows returning uniques from functions, etc.
830 */ 831 */
831 Global Pass() { return static_cast<Global&&>(*this); } // NOLINT 832 Global Pass() { return static_cast<Global&&>(*this); } // NOLINT
832 833
833 /* 834 /*
834 * For compatibility with Chromium's base::Bind (base::Passed). 835 * For compatibility with Chromium's base::Bind (base::Passed).
835 */ 836 */
836 typedef void MoveOnlyTypeForCPP03; 837 typedef void MoveOnlyTypeForCPP03;
837 838
839 Global(const Global&) = delete;
840 void operator=(const Global&) = delete;
841
838 private: 842 private:
839 template <class F> 843 template <class F>
840 friend class ReturnValue; 844 friend class ReturnValue;
841 Global(const Global&) = delete;
842 void operator=(const Global&) = delete;
843 V8_INLINE T* operator*() const { return this->val_; } 845 V8_INLINE T* operator*() const { return this->val_; }
844 }; 846 };
845 847
846 848
847 // UniquePersistent is an alias for Global for historical reason. 849 // UniquePersistent is an alias for Global for historical reason.
848 template <class T> 850 template <class T>
849 using UniquePersistent = Global<T>; 851 using UniquePersistent = Global<T>;
850 852
851 853
852 /** 854 /**
(...skipping 8133 matching lines...) Expand 10 before | Expand all | Expand 10 after
8986 */ 8988 */
8987 8989
8988 8990
8989 } // namespace v8 8991 } // namespace v8
8990 8992
8991 8993
8992 #undef TYPE_CHECK 8994 #undef TYPE_CHECK
8993 8995
8994 8996
8995 #endif // INCLUDE_V8_H_ 8997 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698