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

Side by Side Diff: include/v8.h

Issue 1237603003: Add convenience method for converting v8::PersistentBase to v8::Local (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed test compilation Created 5 years, 5 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 | test/cctest/test-global-handles.cc » ('j') | 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 /** 502 /**
503 * If non-empty, destroy the underlying storage cell 503 * If non-empty, destroy the underlying storage cell
504 * and create a new one with the contents of other if other is non empty 504 * and create a new one with the contents of other if other is non empty
505 */ 505 */
506 template <class S> 506 template <class S>
507 V8_INLINE void Reset(Isolate* isolate, const PersistentBase<S>& other); 507 V8_INLINE void Reset(Isolate* isolate, const PersistentBase<S>& other);
508 508
509 V8_INLINE bool IsEmpty() const { return val_ == NULL; } 509 V8_INLINE bool IsEmpty() const { return val_ == NULL; }
510 V8_INLINE void Empty() { val_ = 0; } 510 V8_INLINE void Empty() { val_ = 0; }
511 511
512 V8_INLINE Local<T> Get(Isolate* isolate) const {
513 return Local<T>::New(isolate, *this);
514 }
515
512 template <class S> 516 template <class S>
513 V8_INLINE bool operator==(const PersistentBase<S>& that) const { 517 V8_INLINE bool operator==(const PersistentBase<S>& that) const {
514 internal::Object** a = reinterpret_cast<internal::Object**>(this->val_); 518 internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
515 internal::Object** b = reinterpret_cast<internal::Object**>(that.val_); 519 internal::Object** b = reinterpret_cast<internal::Object**>(that.val_);
516 if (a == NULL) return b == NULL; 520 if (a == NULL) return b == NULL;
517 if (b == NULL) return false; 521 if (b == NULL) return false;
518 return *a == *b; 522 return *a == *b;
519 } 523 }
520 524
521 template <class S> 525 template <class S>
(...skipping 7816 matching lines...) Expand 10 before | Expand all | Expand 10 after
8338 */ 8342 */
8339 8343
8340 8344
8341 } // namespace v8 8345 } // namespace v8
8342 8346
8343 8347
8344 #undef TYPE_CHECK 8348 #undef TYPE_CHECK
8345 8349
8346 8350
8347 #endif // V8_H_ 8351 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698