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

Unified Diff: test/cctest/test-lockers.cc

Issue 13871008: Change cctest/test-lockers to not rely on casting Handle to Persistent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-lockers.cc
diff --git a/test/cctest/test-lockers.cc b/test/cctest/test-lockers.cc
index a54390bf4e92a6cd133aa22cdd67581e2b7113a5..1259f9e0a47dc98605d417ea58d2b7eeb164e845 100644
--- a/test/cctest/test-lockers.cc
+++ b/test/cctest/test-lockers.cc
@@ -61,7 +61,13 @@ class KangarooThread : public v8::internal::Thread {
KangarooThread(v8::Isolate* isolate,
v8::Handle<v8::Context> context)
: Thread("KangarooThread"),
- isolate_(isolate), context_(context) {
+ isolate_(isolate),
+ context_(v8::Persistent<v8::Context>::New(isolate, context)) {
+ }
+
+ virtual ~KangarooThread() {
+ context_.Dispose(isolate_);
+ context_.Clear();
}
void Run() {
@@ -342,7 +348,11 @@ class LockIsolateAndCalculateFibSharedContextThread : public JoinableThread {
v8::Isolate* isolate, v8::Handle<v8::Context> context)
: JoinableThread("LockIsolateAndCalculateFibThread"),
isolate_(isolate),
- context_(context) {
+ context_(v8::Persistent<v8::Context>::New(isolate, context)) {
+ }
+ virtual ~LockIsolateAndCalculateFibSharedContextThread() {
+ context_.Dispose(isolate_);
+ context_.Clear();
}
virtual void Run() {
@@ -531,7 +541,12 @@ class LockUnlockLockThread : public JoinableThread {
LockUnlockLockThread(v8::Isolate* isolate, v8::Handle<v8::Context> context)
: JoinableThread("LockUnlockLockThread"),
isolate_(isolate),
- context_(context) {
+ context_(v8::Persistent<v8::Context>::New(isolate, context)) {
+ }
+
+ virtual ~LockUnlockLockThread() {
+ context_.Dispose(isolate_);
+ context_.Clear();
}
virtual void Run() {
@@ -591,8 +606,14 @@ TEST(LockUnlockLockMultithreaded) {
class LockUnlockLockDefaultIsolateThread : public JoinableThread {
public:
explicit LockUnlockLockDefaultIsolateThread(v8::Handle<v8::Context> context)
- : JoinableThread("LockUnlockLockDefaultIsolateThread"),
- context_(context) {
+ : JoinableThread("LockUnlockLockDefaultIsolateThread"),
+ context_(v8::Persistent<v8::Context>::New(CcTest::default_isolate(),
+ context)) {
+ }
+
+ virtual ~LockUnlockLockDefaultIsolateThread() {
+ context_.Dispose(CcTest::default_isolate());
+ context_.Clear();
}
virtual void Run() {
« 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