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

Unified Diff: test/cctest/cctest.h

Issue 14894006: Make v8 compilable without V8_USE_UNSAFE_HANDLES. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 7 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/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index 30cbe799f902b37460efbe9e35758d585a3977ee..5941383afb37d28c6eb383239a6be45e6c04f7bd 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -87,7 +87,12 @@ class CcTest {
default_isolate_ = default_isolate;
}
static v8::Isolate* default_isolate() { return default_isolate_; }
- static v8::Isolate* isolate() { return context()->GetIsolate(); }
+ static v8::Isolate* isolate() {
+ v8::HandleScope handle_scope;
+ return context()->GetIsolate();
dcarney 2013/05/06 11:40:17 store the isolate instead when the context is set
marja 2013/05/06 12:14:23 Removed this function, used default_isolate() inst
+ }
+
+ // You need to have a valid HandleScope before calling this function.
dcarney 2013/05/06 11:40:17 skip the comment
marja 2013/05/06 12:14:23 Done.
static v8::Handle<v8::Context> env() { return context(); }
// Helper function to initialize the VM.
@@ -95,7 +100,7 @@ class CcTest {
private:
static v8::Handle<v8::Context> context() {
- return *reinterpret_cast<v8::Handle<v8::Context>*>(&context_);
+ return v8::Local<v8::Context>::New(v8::Isolate::GetCurrent(), context_);
dcarney 2013/05/06 11:40:17 use the context isolate also, just inline this fun
marja 2013/05/06 12:14:23 Done.
marja 2013/05/06 12:14:23 Done.
}
TestFunction* callback_;
const char* file_;
« 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