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

Side by Side Diff: include/v8.h

Issue 1647833005: Make handle ctors explicit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: same change but to persistent constructor Created 4 years, 10 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 | « AUTHORS ('k') | 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 friend Local<Primitive> Undefined(Isolate* isolate); 321 friend Local<Primitive> Undefined(Isolate* isolate);
322 friend Local<Primitive> Null(Isolate* isolate); 322 friend Local<Primitive> Null(Isolate* isolate);
323 friend Local<Boolean> True(Isolate* isolate); 323 friend Local<Boolean> True(Isolate* isolate);
324 friend Local<Boolean> False(Isolate* isolate); 324 friend Local<Boolean> False(Isolate* isolate);
325 friend class HandleScope; 325 friend class HandleScope;
326 friend class EscapableHandleScope; 326 friend class EscapableHandleScope;
327 template <class F1, class F2, class F3> 327 template <class F1, class F2, class F3>
328 friend class PersistentValueMapBase; 328 friend class PersistentValueMapBase;
329 template<class F1, class F2> friend class PersistentValueVector; 329 template<class F1, class F2> friend class PersistentValueVector;
330 330
331 template <class S> 331 explicit V8_INLINE Local(T* that) : val_(that) {}
332 V8_INLINE Local(S* that)
333 : val_(that) {}
334 V8_INLINE static Local<T> New(Isolate* isolate, T* that); 332 V8_INLINE static Local<T> New(Isolate* isolate, T* that);
335 T* val_; 333 T* val_;
336 }; 334 };
337 335
338 336
339 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) 337 #if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
340 // Local is an alias for Local for historical reasons. 338 // Local is an alias for Local for historical reasons.
341 template <class T> 339 template <class T>
342 using Handle = Local<T>; 340 using Handle = Local<T>;
343 #endif 341 #endif
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 return Persistent<S>::Cast(*this); 777 return Persistent<S>::Cast(*this);
780 } 778 }
781 779
782 private: 780 private:
783 friend class Isolate; 781 friend class Isolate;
784 friend class Utils; 782 friend class Utils;
785 template<class F> friend class Local; 783 template<class F> friend class Local;
786 template<class F1, class F2> friend class Persistent; 784 template<class F1, class F2> friend class Persistent;
787 template<class F> friend class ReturnValue; 785 template<class F> friend class ReturnValue;
788 786
789 template <class S> V8_INLINE Persistent(S* that) : PersistentBase<T>(that) { } 787 explicit V8_INLINE Persistent(T* that) : PersistentBase<T>(that) {}
790 V8_INLINE T* operator*() const { return this->val_; } 788 V8_INLINE T* operator*() const { return this->val_; }
791 template<class S, class M2> 789 template<class S, class M2>
792 V8_INLINE void Copy(const Persistent<S, M2>& that); 790 V8_INLINE void Copy(const Persistent<S, M2>& that);
793 }; 791 };
794 792
795 793
796 /** 794 /**
797 * A PersistentBase which has move semantics. 795 * A PersistentBase which has move semantics.
798 * 796 *
799 * Note: Persistent class hierarchy is subject to future changes. 797 * Note: Persistent class hierarchy is subject to future changes.
(...skipping 7665 matching lines...) Expand 10 before | Expand all | Expand 10 after
8465 */ 8463 */
8466 8464
8467 8465
8468 } // namespace v8 8466 } // namespace v8
8469 8467
8470 8468
8471 #undef TYPE_CHECK 8469 #undef TYPE_CHECK
8472 8470
8473 8471
8474 #endif // INCLUDE_V8_H_ 8472 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698