1 // Copyright 2020 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/win/atl_throw.h" 6 7 #include <winerror.h> 8 9 #include "base/compiler_specific.h" 10 #include "base/debug/alias.h" 11 #include "base/immediate_crash.h" 12 #include "base/process/memory.h" 13 14 namespace base { 15 namespace win { 16 AtlThrowImpl(HRESULT hr)17NOINLINE void __stdcall AtlThrowImpl(HRESULT hr) { 18 base::debug::Alias(&hr); 19 if (hr == E_OUTOFMEMORY) 20 base::TerminateBecauseOutOfMemory(0); 21 ImmediateCrash(); 22 } 23 24 } // namespace win 25 } // namespace base 26