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

Side by Side Diff: src/api.h

Issue 1235253007: Revert of [handles] Sanitize Handle and friends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | src/api.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 #ifndef V8_API_H_ 5 #ifndef V8_API_H_
6 #define V8_API_H_ 6 #define V8_API_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "include/v8-testing.h" 10 #include "include/v8-testing.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) { 302 static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) {
303 return OpenHandle(*handle); 303 return OpenHandle(*handle);
304 } 304 }
305 305
306 private: 306 private:
307 static void ReportApiFailure(const char* location, const char* message); 307 static void ReportApiFailure(const char* location, const char* message);
308 }; 308 };
309 309
310 310
311 template <class T> 311 template <class T>
312 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom(
313 v8::EscapableHandleScope* scope) {
314 v8::internal::Handle<T> handle;
315 if (!is_null()) {
316 handle = *this;
317 }
318 return Utils::OpenHandle(*scope->Escape(Utils::ToLocal(handle)), true);
319 }
320
321
322 template <class T>
312 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { 323 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) {
313 return reinterpret_cast<T*>(obj.location()); 324 return reinterpret_cast<T*>(obj.location());
314 } 325 }
315 326
316 template <class T> 327 template <class T>
317 inline v8::Local<T> ToApiHandle( 328 inline v8::Local<T> ToApiHandle(
318 v8::internal::Handle<v8::internal::Object> obj) { 329 v8::internal::Handle<v8::internal::Object> obj) {
319 return Utils::Convert<v8::internal::Object, T>(obj); 330 return Utils::Convert<v8::internal::Object, T>(obj);
320 } 331 }
321 332
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 stress_type_ = stress_type; 716 stress_type_ = stress_type;
706 } 717 }
707 718
708 private: 719 private:
709 static v8::Testing::StressType stress_type_; 720 static v8::Testing::StressType stress_type_;
710 }; 721 };
711 722
712 } } // namespace v8::internal 723 } } // namespace v8::internal
713 724
714 #endif // V8_API_H_ 725 #endif // V8_API_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698