| Index: third_party/WebKit/Source/platform/text/ICUError.cpp
|
| diff --git a/third_party/WebKit/Source/platform/text/ICUError.cpp b/third_party/WebKit/Source/platform/text/ICUError.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..33d64313cd135530ed4db49d523f9f62f64e71f2
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/platform/text/ICUError.cpp
|
| @@ -0,0 +1,28 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "platform/text/ICUError.h"
|
| +
|
| +namespace blink {
|
| +
|
| +// Distinguish memory allocation failures from other errors.
|
| +// https://groups.google.com/a/chromium.org/d/msg/platform-architecture-dev/MP0k9WGnCjA/zIBiJtilBwAJ
|
| +static NEVER_INLINE void ICUOutOfMemory() {
|
| + OOM_CRASH();
|
| +}
|
| +
|
| +void ICUError::handleFailure() {
|
| + switch (m_error) {
|
| + case U_MEMORY_ALLOCATION_ERROR:
|
| + ICUOutOfMemory();
|
| + break;
|
| + case U_ILLEGAL_ARGUMENT_ERROR:
|
| + CHECK(false) << m_error;
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| +}
|
| +
|
| +} // namespace blink
|
|
|