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

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

Issue 12729023: first step to remove unsafe handles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: issue with debug build 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 | « test/cctest/test-thread-termination.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-threads.cc
diff --git a/test/cctest/test-threads.cc b/test/cctest/test-threads.cc
index 5a010a8c9f1a5fa05b5dc5b56dc58cb540c9a43c..edec8bfbe4d38bb889bbe7f567d9a32f50762367 100644
--- a/test/cctest/test-threads.cc
+++ b/test/cctest/test-threads.cc
@@ -25,6 +25,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// TODO(dcarney): remove
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW
+
#include "v8.h"
#include "platform.h"
@@ -34,10 +38,12 @@
TEST(Preemption) {
- v8::Locker locker(CcTest::default_isolate());
+ v8::Isolate* isolate = CcTest::default_isolate();
+ v8::Locker locker(isolate);
v8::V8::Initialize();
- v8::HandleScope scope(CcTest::default_isolate());
- v8::Context::Scope context_scope(v8::Context::New());
+ v8::HandleScope scope(isolate);
+ v8::Handle<v8::Context> context = v8::Context::New(isolate);
+ v8::Context::Scope context_scope(context);
v8::Locker::StartPreemption(100);
@@ -67,9 +73,11 @@ class ThreadA : public v8::internal::Thread {
public:
ThreadA() : Thread("ThreadA") { }
void Run() {
- v8::Locker locker(CcTest::default_isolate());
- v8::HandleScope scope(CcTest::default_isolate());
- v8::Context::Scope context_scope(v8::Context::New());
+ v8::Isolate* isolate = CcTest::default_isolate();
+ v8::Locker locker(isolate);
+ v8::HandleScope scope(isolate);
+ v8::Handle<v8::Context> context = v8::Context::New(isolate);
+ v8::Context::Scope context_scope(context);
CHECK_EQ(FILL_CACHE, turn);
@@ -105,10 +113,12 @@ class ThreadB : public v8::internal::Thread {
void Run() {
do {
{
- v8::Locker locker(CcTest::default_isolate());
+ v8::Isolate* isolate = CcTest::default_isolate();
+ v8::Locker locker(isolate);
if (turn == CLEAN_CACHE) {
- v8::HandleScope scope(CcTest::default_isolate());
- v8::Context::Scope context_scope(v8::Context::New());
+ v8::HandleScope scope(isolate);
+ v8::Handle<v8::Context> context = v8::Context::New(isolate);
+ v8::Context::Scope context_scope(context);
// Clear the caches by forcing major GC.
HEAP->CollectAllGarbage(v8::internal::Heap::kNoGCFlags);
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698