| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 #include "platform/text/ICUError.h" |
| 6 |
| 7 namespace blink { |
| 8 |
| 9 // Distinguish memory allocation failures from other errors. |
| 10 // https://groups.google.com/a/chromium.org/d/msg/platform-architecture-dev/MP0k
9WGnCjA/zIBiJtilBwAJ |
| 11 static NEVER_INLINE void ICUOutOfMemory() { |
| 12 OOM_CRASH(); |
| 13 } |
| 14 |
| 15 void ICUError::handleFailure() { |
| 16 switch (m_error) { |
| 17 case U_MEMORY_ALLOCATION_ERROR: |
| 18 ICUOutOfMemory(); |
| 19 break; |
| 20 case U_ILLEGAL_ARGUMENT_ERROR: |
| 21 CHECK(false) << m_error; |
| 22 break; |
| 23 default: |
| 24 break; |
| 25 } |
| 26 } |
| 27 |
| 28 } // namespace blink |
| OLD | NEW |