Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index c3c7743dfdde5952ceef702e8e0d32d988480242..e60485431471c6a3999f1dea9ae46aa9a956810c 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -5012,6 +5012,7 @@ class V8_EXPORT ResourceConstraints { |
| typedef void (*FatalErrorCallback)(const char* location, const char* message); |
| +typedef void (*OOMErrorCallback)(const char* location, bool is_heap_oom); |
| typedef void (*MessageCallback)(Local<Message> message, Local<Value> error); |
| @@ -6326,6 +6327,9 @@ class V8_EXPORT Isolate { |
| /** Set the callback to invoke in case of fatal errors. */ |
| void SetFatalErrorHandler(FatalErrorCallback that); |
| + /** Set the callback to invoke in case of OOM errors. */ |
| + void SetOOMErrorHandler(OOMErrorCallback that); |
| + |
| /** |
| * Set the callback to invoke to check if code generation from |
| * strings should be allowed. |
| @@ -6460,6 +6464,11 @@ class V8_EXPORT V8 { |
| "Use isolate version", |
| void SetFatalErrorHandler(FatalErrorCallback that)); |
| + /** Set the callback to invoke in case of OOM errors. */ |
| + V8_INLINE static V8_DEPRECATED( |
| + "Use isolate version", |
| + void SetOOMErrorHandler(OOMErrorCallback that)); |
|
jochen (gone - plz use gerrit)
2016/07/12 15:11:30
don't add that
Will Harris
2016/07/12 15:42:53
Done.
|
| + |
| /** |
| * Set the callback to invoke to check if code generation from |
| * strings should be allowed. |
| @@ -8872,6 +8881,10 @@ void V8::SetFatalErrorHandler(FatalErrorCallback callback) { |
| isolate->SetFatalErrorHandler(callback); |
| } |
| +void V8::SetOOMErrorHandler(OOMErrorCallback callback) { |
| + Isolate* isolate = Isolate::GetCurrent(); |
| + isolate->SetOOMErrorHandler(callback); |
| +} |
| void V8::RemoveGCPrologueCallback(GCCallback callback) { |
| Isolate* isolate = Isolate::GetCurrent(); |