OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 initialization_state_ = kInitialized; | 90 initialization_state_ = kInitialized; |
91 if (isolate_ == NULL) { | 91 if (isolate_ == NULL) { |
92 v8::Isolate::CreateParams create_params; | 92 v8::Isolate::CreateParams create_params; |
93 create_params.array_buffer_allocator = allocator_; | 93 create_params.array_buffer_allocator = allocator_; |
94 isolate_ = v8::Isolate::New(create_params); | 94 isolate_ = v8::Isolate::New(create_params); |
95 } | 95 } |
96 isolate_->Enter(); | 96 isolate_->Enter(); |
97 } | 97 } |
98 callback_(); | 98 callback_(); |
99 if (initialize_) { | 99 if (initialize_) { |
100 EmptyMessageQueues(isolate_); | 100 if (v8::Locker::IsActive()) { |
| 101 v8::Locker locker(isolate_); |
| 102 EmptyMessageQueues(isolate_); |
| 103 } else { |
| 104 EmptyMessageQueues(isolate_); |
| 105 } |
101 isolate_->Exit(); | 106 isolate_->Exit(); |
102 } | 107 } |
103 } | 108 } |
104 | 109 |
105 | 110 |
106 v8::Local<v8::Context> CcTest::NewContext(CcTestExtensionFlags extensions, | 111 v8::Local<v8::Context> CcTest::NewContext(CcTestExtensionFlags extensions, |
107 v8::Isolate* isolate) { | 112 v8::Isolate* isolate) { |
108 const char* extension_names[kMaxExtensions]; | 113 const char* extension_names[kMaxExtensions]; |
109 int extension_count = 0; | 114 int extension_count = 0; |
110 #define CHECK_EXTENSION_FLAG(Name, Id) \ | 115 #define CHECK_EXTENSION_FLAG(Name, Id) \ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 CcTest::TearDown(); | 246 CcTest::TearDown(); |
242 // TODO(svenpanne) See comment above. | 247 // TODO(svenpanne) See comment above. |
243 // if (!disable_automatic_dispose_) v8::V8::Dispose(); | 248 // if (!disable_automatic_dispose_) v8::V8::Dispose(); |
244 v8::V8::ShutdownPlatform(); | 249 v8::V8::ShutdownPlatform(); |
245 delete platform; | 250 delete platform; |
246 return 0; | 251 return 0; |
247 } | 252 } |
248 | 253 |
249 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 254 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
250 int RegisterThreadedTest::count_ = 0; | 255 int RegisterThreadedTest::count_ = 0; |
OLD | NEW |