oom_callback.h 970 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_
  5. #define BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_
  6. #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h"
  7. namespace partition_alloc {
  8. using PartitionAllocOomCallback = void (*)();
  9. // Registers a callback to be invoked during an OOM_CRASH(). OOM_CRASH is
  10. // invoked by users of PageAllocator (including PartitionAlloc) to signify an
  11. // allocation failure from the platform.
  12. PA_COMPONENT_EXPORT(PARTITION_ALLOC)
  13. void SetPartitionAllocOomCallback(PartitionAllocOomCallback callback);
  14. namespace internal {
  15. PA_COMPONENT_EXPORT(PARTITION_ALLOC) void RunPartitionAllocOomCallback();
  16. } // namespace internal
  17. } // namespace partition_alloc
  18. #endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_