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 8229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8240 AddCallCompletedCallback(reinterpret_cast<CallCompletedCallback>(callback)); | 8240 AddCallCompletedCallback(reinterpret_cast<CallCompletedCallback>(callback)); |
8241 } | 8241 } |
8242 | 8242 |
8243 | 8243 |
8244 void Isolate::RemoveCallCompletedCallback( | 8244 void Isolate::RemoveCallCompletedCallback( |
8245 DeprecatedCallCompletedCallback callback) { | 8245 DeprecatedCallCompletedCallback callback) { |
8246 RemoveCallCompletedCallback( | 8246 RemoveCallCompletedCallback( |
8247 reinterpret_cast<CallCompletedCallback>(callback)); | 8247 reinterpret_cast<CallCompletedCallback>(callback)); |
8248 } | 8248 } |
8249 | 8249 |
| 8250 void Isolate::SetPromiseHook(PromiseHook hook) { |
| 8251 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8252 isolate->SetPromiseHook(hook); |
| 8253 } |
8250 | 8254 |
8251 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { | 8255 void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { |
8252 if (callback == NULL) return; | 8256 if (callback == NULL) return; |
8253 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8257 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8254 isolate->SetPromiseRejectCallback(callback); | 8258 isolate->SetPromiseRejectCallback(callback); |
8255 } | 8259 } |
8256 | 8260 |
8257 | 8261 |
8258 void Isolate::RunMicrotasks() { | 8262 void Isolate::RunMicrotasks() { |
8259 DCHECK(MicrotasksPolicy::kScoped != GetMicrotasksPolicy()); | 8263 DCHECK(MicrotasksPolicy::kScoped != GetMicrotasksPolicy()); |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9887 Address callback_address = | 9891 Address callback_address = |
9888 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9892 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9889 VMState<EXTERNAL> state(isolate); | 9893 VMState<EXTERNAL> state(isolate); |
9890 ExternalCallbackScope call_scope(isolate, callback_address); | 9894 ExternalCallbackScope call_scope(isolate, callback_address); |
9891 callback(info); | 9895 callback(info); |
9892 } | 9896 } |
9893 | 9897 |
9894 | 9898 |
9895 } // namespace internal | 9899 } // namespace internal |
9896 } // namespace v8 | 9900 } // namespace v8 |
OLD | NEW |