OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_V8_PLATFORM_H_ | 5 #ifndef V8_V8_PLATFORM_H_ |
6 #define V8_V8_PLATFORM_H_ | 6 #define V8_V8_PLATFORM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <memory> | 10 #include <memory> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 virtual ~TraceStateObserver() = default; | 205 virtual ~TraceStateObserver() = default; |
206 virtual void OnTraceEnabled() = 0; | 206 virtual void OnTraceEnabled() = 0; |
207 virtual void OnTraceDisabled() = 0; | 207 virtual void OnTraceDisabled() = 0; |
208 }; | 208 }; |
209 | 209 |
210 /** Adds tracing state change observer. */ | 210 /** Adds tracing state change observer. */ |
211 virtual void AddTraceStateObserver(TraceStateObserver*) {} | 211 virtual void AddTraceStateObserver(TraceStateObserver*) {} |
212 | 212 |
213 /** Removes tracing state change observer. */ | 213 /** Removes tracing state change observer. */ |
214 virtual void RemoveTraceStateObserver(TraceStateObserver*) {} | 214 virtual void RemoveTraceStateObserver(TraceStateObserver*) {} |
| 215 |
| 216 /** |
| 217 * Returns true if the system-wide available free memory (referred to as the |
| 218 * global memory budget) can be obtained via GetGlobalMemoryBudget(). |
| 219 */ |
| 220 virtual bool IsGlobalMemoryBudgetAvailable() { return false; } |
| 221 |
| 222 /** |
| 223 * Returns the global memory budget. A nagative value can be returned when |
| 224 * the global memory budget is unknown or the system is under high memory |
| 225 * pressure. |
| 226 */ |
| 227 virtual int64_t GetGlobalMemoryBudget() { return -1; } |
| 228 |
| 229 /** |
| 230 * TODO(bashi): Tentative. Set an interval to update the global memory budget. |
| 231 */ |
| 232 virtual void SetGlobalMemoryBudgetUpdateInterval(uint32_t interval_ms) {} |
215 }; | 233 }; |
216 | 234 |
217 } // namespace v8 | 235 } // namespace v8 |
218 | 236 |
219 #endif // V8_V8_PLATFORM_H_ | 237 #endif // V8_V8_PLATFORM_H_ |
OLD | NEW |