Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: include/v8.h

Issue 2139873002: V8: Add API to report OOM to embedder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.h » ('j') | src/api.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 4994 matching lines...) Expand 10 before | Expand all | Expand 10 after
5005 uint32_t* stack_limit_; 5005 uint32_t* stack_limit_;
5006 size_t code_range_size_; 5006 size_t code_range_size_;
5007 }; 5007 };
5008 5008
5009 5009
5010 // --- Exceptions --- 5010 // --- Exceptions ---
5011 5011
5012 5012
5013 typedef void (*FatalErrorCallback)(const char* location, const char* message); 5013 typedef void (*FatalErrorCallback)(const char* location, const char* message);
5014 5014
5015 typedef void (*OOMErrorCallback)(const char* location, bool is_heap_oom);
5015 5016
5016 typedef void (*MessageCallback)(Local<Message> message, Local<Value> error); 5017 typedef void (*MessageCallback)(Local<Message> message, Local<Value> error);
5017 5018
5018 // --- Tracing --- 5019 // --- Tracing ---
5019 5020
5020 typedef void (*LogEventCallback)(const char* name, int event); 5021 typedef void (*LogEventCallback)(const char* name, int event);
5021 5022
5022 /** 5023 /**
5023 * Create new error objects by calling the corresponding error object 5024 * Create new error objects by calling the corresponding error object
5024 * constructor with the message. 5025 * constructor with the message.
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
6319 * 6320 *
6320 * Might be empty on other platforms. 6321 * Might be empty on other platforms.
6321 * 6322 *
6322 * https://code.google.com/p/v8/issues/detail?id=3598 6323 * https://code.google.com/p/v8/issues/detail?id=3598
6323 */ 6324 */
6324 void GetCodeRange(void** start, size_t* length_in_bytes); 6325 void GetCodeRange(void** start, size_t* length_in_bytes);
6325 6326
6326 /** Set the callback to invoke in case of fatal errors. */ 6327 /** Set the callback to invoke in case of fatal errors. */
6327 void SetFatalErrorHandler(FatalErrorCallback that); 6328 void SetFatalErrorHandler(FatalErrorCallback that);
6328 6329
6330 /** Set the callback to invoke in case of OOM errors. */
6331 void SetOOMErrorHandler(OOMErrorCallback that);
6332
6329 /** 6333 /**
6330 * Set the callback to invoke to check if code generation from 6334 * Set the callback to invoke to check if code generation from
6331 * strings should be allowed. 6335 * strings should be allowed.
6332 */ 6336 */
6333 void SetAllowCodeGenerationFromStringsCallback( 6337 void SetAllowCodeGenerationFromStringsCallback(
6334 AllowCodeGenerationFromStringsCallback callback); 6338 AllowCodeGenerationFromStringsCallback callback);
6335 6339
6336 /** 6340 /**
6337 * Check if V8 is dead and therefore unusable. This is the case after 6341 * Check if V8 is dead and therefore unusable. This is the case after
6338 * fatal errors such as out-of-memory situations. 6342 * fatal errors such as out-of-memory situations.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
6453 /** 6457 /**
6454 * Container class for static utility functions. 6458 * Container class for static utility functions.
6455 */ 6459 */
6456 class V8_EXPORT V8 { 6460 class V8_EXPORT V8 {
6457 public: 6461 public:
6458 /** Set the callback to invoke in case of fatal errors. */ 6462 /** Set the callback to invoke in case of fatal errors. */
6459 V8_INLINE static V8_DEPRECATED( 6463 V8_INLINE static V8_DEPRECATED(
6460 "Use isolate version", 6464 "Use isolate version",
6461 void SetFatalErrorHandler(FatalErrorCallback that)); 6465 void SetFatalErrorHandler(FatalErrorCallback that));
6462 6466
6467 /** Set the callback to invoke in case of OOM errors. */
6468 V8_INLINE static V8_DEPRECATED(
6469 "Use isolate version",
6470 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.
6471
6463 /** 6472 /**
6464 * Set the callback to invoke to check if code generation from 6473 * Set the callback to invoke to check if code generation from
6465 * strings should be allowed. 6474 * strings should be allowed.
6466 */ 6475 */
6467 V8_INLINE static V8_DEPRECATED( 6476 V8_INLINE static V8_DEPRECATED(
6468 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback( 6477 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback(
6469 AllowCodeGenerationFromStringsCallback that)); 6478 AllowCodeGenerationFromStringsCallback that));
6470 6479
6471 /** 6480 /**
6472 * Check if V8 is dead and therefore unusable. This is the case after 6481 * Check if V8 is dead and therefore unusable. This is the case after
(...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after
8865 isolate->SetCaptureStackTraceForUncaughtExceptions(capture, frame_limit, 8874 isolate->SetCaptureStackTraceForUncaughtExceptions(capture, frame_limit,
8866 options); 8875 options);
8867 } 8876 }
8868 8877
8869 8878
8870 void V8::SetFatalErrorHandler(FatalErrorCallback callback) { 8879 void V8::SetFatalErrorHandler(FatalErrorCallback callback) {
8871 Isolate* isolate = Isolate::GetCurrent(); 8880 Isolate* isolate = Isolate::GetCurrent();
8872 isolate->SetFatalErrorHandler(callback); 8881 isolate->SetFatalErrorHandler(callback);
8873 } 8882 }
8874 8883
8884 void V8::SetOOMErrorHandler(OOMErrorCallback callback) {
8885 Isolate* isolate = Isolate::GetCurrent();
8886 isolate->SetOOMErrorHandler(callback);
8887 }
8875 8888
8876 void V8::RemoveGCPrologueCallback(GCCallback callback) { 8889 void V8::RemoveGCPrologueCallback(GCCallback callback) {
8877 Isolate* isolate = Isolate::GetCurrent(); 8890 Isolate* isolate = Isolate::GetCurrent();
8878 isolate->RemoveGCPrologueCallback( 8891 isolate->RemoveGCPrologueCallback(
8879 reinterpret_cast<v8::Isolate::GCCallback>(callback)); 8892 reinterpret_cast<v8::Isolate::GCCallback>(callback));
8880 } 8893 }
8881 8894
8882 8895
8883 void V8::RemoveGCEpilogueCallback(GCCallback callback) { 8896 void V8::RemoveGCEpilogueCallback(GCCallback callback) {
8884 Isolate* isolate = Isolate::GetCurrent(); 8897 Isolate* isolate = Isolate::GetCurrent();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
8937 */ 8950 */
8938 8951
8939 8952
8940 } // namespace v8 8953 } // namespace v8
8941 8954
8942 8955
8943 #undef TYPE_CHECK 8956 #undef TYPE_CHECK
8944 8957
8945 8958
8946 #endif // INCLUDE_V8_H_ 8959 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.h » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698