Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 62319203f418c4522b103b3d54ced4e43f09971b..bfabad156c628e0413bb4b709e9e2084190d44a9 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -5554,6 +5554,8 @@ class V8_EXPORT Isolate { |
| kUseCounterFeatureCount // This enum value must be last. |
| }; |
| + enum MemoryPressureLevel { kNone, kModerate, kCritical }; |
|
jochen (gone - plz use gerrit)
2016/03/15 20:57:18
this should be an enum class
|
| + |
| typedef void (*UseCounterCallback)(Isolate* isolate, |
| UseCounterFeature feature); |
| @@ -5875,6 +5877,12 @@ class V8_EXPORT Isolate { |
| void RequestInterrupt(InterruptCallback callback, void* data); |
| /** |
| + * Request V8 to interrupt long running JavaScript code and do GC, |
| + * when system memory is pressured. |
| + */ |
| + void RequestMemoryPressureInterrupt(MemoryPressureLevel level); |
|
jochen (gone - plz use gerrit)
2016/03/15 20:57:18
this should be NotifyMemoryPressure(MemoryPressure
|
| + |
| + /** |
| * Request garbage collection in this Isolate. It is only valid to call this |
| * function if --expose_gc was specified. |
| * |
| @@ -6185,6 +6193,12 @@ class V8_EXPORT Isolate { |
| */ |
| void VisitWeakHandles(PersistentHandleVisitor* visitor); |
| + /** |
| + * This method can handle memory pressure interrupt, no matter v8 is busy or |
| + * idle. |
| + */ |
| + void HandleMemoryPressureInterrupt(); |
|
jochen (gone - plz use gerrit)
2016/03/15 20:57:18
please remove this.
|
| + |
| private: |
| template <class K, class V, class Traits> |
| friend class PersistentValueMapBase; |