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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <utility> | 10 #include <utility> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void IsolateHolder::Initialize(ScriptMode mode, | 78 void IsolateHolder::Initialize(ScriptMode mode, |
79 V8ExtrasMode v8_extras_mode, | 79 V8ExtrasMode v8_extras_mode, |
80 v8::ArrayBuffer::Allocator* allocator) { | 80 v8::ArrayBuffer::Allocator* allocator) { |
81 CHECK(allocator); | 81 CHECK(allocator); |
82 V8Initializer::Initialize(mode, v8_extras_mode); | 82 V8Initializer::Initialize(mode, v8_extras_mode); |
83 g_array_buffer_allocator = allocator; | 83 g_array_buffer_allocator = allocator; |
84 } | 84 } |
85 | 85 |
86 void IsolateHolder::AddRunMicrotasksObserver() { | 86 void IsolateHolder::AddRunMicrotasksObserver() { |
87 DCHECK(!task_observer_.get()); | 87 DCHECK(!task_observer_.get()); |
88 task_observer_.reset(new RunMicrotasksObserver(isolate_));; | 88 task_observer_.reset(new RunMicrotasksObserver(isolate_)); |
89 base::MessageLoop::current()->AddTaskObserver(task_observer_.get()); | 89 base::MessageLoop::current()->AddTaskObserver(task_observer_.get()); |
90 } | 90 } |
91 | 91 |
92 void IsolateHolder::RemoveRunMicrotasksObserver() { | 92 void IsolateHolder::RemoveRunMicrotasksObserver() { |
93 DCHECK(task_observer_.get()); | 93 DCHECK(task_observer_.get()); |
94 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get()); | 94 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get()); |
95 task_observer_.reset(); | 95 task_observer_.reset(); |
96 } | 96 } |
97 | 97 |
98 void IsolateHolder::EnableIdleTasks( | 98 void IsolateHolder::EnableIdleTasks( |
99 scoped_ptr<V8IdleTaskRunner> idle_task_runner) { | 99 scoped_ptr<V8IdleTaskRunner> idle_task_runner) { |
100 DCHECK(isolate_data_.get()); | 100 DCHECK(isolate_data_.get()); |
101 isolate_data_->EnableIdleTasks(std::move(idle_task_runner)); | 101 isolate_data_->EnableIdleTasks(std::move(idle_task_runner)); |
102 } | 102 } |
103 | 103 |
104 } // namespace gin | 104 } // namespace gin |
OLD | NEW |