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 5 #ifndef THIRD_PARTY_BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_ 6 #define THIRD_PARTY_BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_ 7 8 #include "third_party/base/base_export.h" 9 10 namespace pdfium { 11 namespace base { 12 typedef void (*PartitionAllocOomCallback)(); 13 // Registers a callback to be invoked during an OOM_CRASH(). OOM_CRASH is 14 // invoked by users of PageAllocator (including PartitionAlloc) to signify an 15 // allocation failure from the platform. 16 BASE_EXPORT void SetPartitionAllocOomCallback( 17 PartitionAllocOomCallback callback); 18 19 namespace internal { 20 BASE_EXPORT void RunPartitionAllocOomCallback(); 21 } // namespace internal 22 23 } // namespace base 24 } // namespace pdfium 25 26 #endif // THIRD_PARTY_BASE_ALLOCATOR_PARTITION_ALLOCATOR_OOM_CALLBACK_H_ 27