OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium 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 #include "gin/public/isolate_holder.h" | 5 #include "gin/public/isolate_holder.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/files/memory_mapped_file.h" | 10 #include "base/files/memory_mapped_file.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 size_t size; | 247 size_t size; |
248 isolate_->GetCodeRange(&code_range, &size); | 248 isolate_->GetCodeRange(&code_range, &size); |
249 Debug::CodeRangeDeletedCallback callback = | 249 Debug::CodeRangeDeletedCallback callback = |
250 DebugImpl::GetCodeRangeDeletedCallback(); | 250 DebugImpl::GetCodeRangeDeletedCallback(); |
251 if (code_range && callback) | 251 if (code_range && callback) |
252 callback(code_range); | 252 callback(code_range); |
253 } | 253 } |
254 #endif | 254 #endif |
255 isolate_data_.reset(); | 255 isolate_data_.reset(); |
256 isolate_->Dispose(); | 256 isolate_->Dispose(); |
| 257 isolate_ = NULL; |
257 } | 258 } |
258 | 259 |
259 // static | 260 // static |
260 void IsolateHolder::Initialize(ScriptMode mode, | 261 void IsolateHolder::Initialize(ScriptMode mode, |
261 v8::ArrayBuffer::Allocator* allocator) { | 262 v8::ArrayBuffer::Allocator* allocator) { |
262 CHECK(allocator); | 263 CHECK(allocator); |
263 static bool v8_is_initialized = false; | 264 static bool v8_is_initialized = false; |
264 if (v8_is_initialized) | 265 if (v8_is_initialized) |
265 return; | 266 return; |
266 v8::V8::InitializePlatform(V8Platform::Get()); | 267 v8::V8::InitializePlatform(V8Platform::Get()); |
(...skipping 29 matching lines...) Expand all Loading... |
296 base::MessageLoop::current()->AddTaskObserver(task_observer_.get()); | 297 base::MessageLoop::current()->AddTaskObserver(task_observer_.get()); |
297 } | 298 } |
298 | 299 |
299 void IsolateHolder::RemoveRunMicrotasksObserver() { | 300 void IsolateHolder::RemoveRunMicrotasksObserver() { |
300 DCHECK(task_observer_.get()); | 301 DCHECK(task_observer_.get()); |
301 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get()); | 302 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get()); |
302 task_observer_.reset(); | 303 task_observer_.reset(); |
303 } | 304 } |
304 | 305 |
305 } // namespace gin | 306 } // namespace gin |
OLD | NEW |