OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 8242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8253 AddCallCompletedCallback(reinterpret_cast<CallCompletedCallback>(callback)); | 8253 AddCallCompletedCallback(reinterpret_cast<CallCompletedCallback>(callback)); |
8254 } | 8254 } |
8255 | 8255 |
8256 | 8256 |
8257 void Isolate::RemoveCallCompletedCallback( | 8257 void Isolate::RemoveCallCompletedCallback( |
8258 DeprecatedCallCompletedCallback callback) { | 8258 DeprecatedCallCompletedCallback callback) { |
8259 RemoveCallCompletedCallback( | 8259 RemoveCallCompletedCallback( |
8260 reinterpret_cast<CallCompletedCallback>(callback)); | 8260 reinterpret_cast<CallCompletedCallback>(callback)); |
8261 } | 8261 } |
8262 | 8262 |
| 8263 void Isolate::SetPromiseHook(PromiseHook hook) { |
| 8264 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8265 isolate->SetPromiseHook(hook); |
| 8266 } |
8263 | 8267 |
8264 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { | 8268 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { |
8265 if (callback == NULL) return; | 8269 if (callback == NULL) return; |
8266 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8270 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8267 isolate->SetPromiseRejectCallback(callback); | 8271 isolate->SetPromiseRejectCallback(callback); |
8268 } | 8272 } |
8269 | 8273 |
8270 | 8274 |
8271 void Isolate::RunMicrotasks() { | 8275 void Isolate::RunMicrotasks() { |
8272 DCHECK(MicrotasksPolicy::kScoped != GetMicrotasksPolicy()); | 8276 DCHECK(MicrotasksPolicy::kScoped != GetMicrotasksPolicy()); |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9900 Address callback_address = | 9904 Address callback_address = |
9901 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9905 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9902 VMState<EXTERNAL> state(isolate); | 9906 VMState<EXTERNAL> state(isolate); |
9903 ExternalCallbackScope call_scope(isolate, callback_address); | 9907 ExternalCallbackScope call_scope(isolate, callback_address); |
9904 callback(info); | 9908 callback(info); |
9905 } | 9909 } |
9906 | 9910 |
9907 | 9911 |
9908 } // namespace internal | 9912 } // namespace internal |
9909 } // namespace v8 | 9913 } // namespace v8 |
OLD | NEW |