| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 SKY_ENGINE_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_ | |
| 6 #define SKY_ENGINE_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_ | |
| 7 | |
| 8 #include "sky/engine/bindings2/exception_state.h" | |
| 9 #include "sky/engine/wtf/Assertions.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class IgnorableExceptionState final : public ExceptionState { | |
| 14 public: | |
| 15 ExceptionState& ReturnThis() { return *this; } | |
| 16 }; | |
| 17 | |
| 18 #define IGNORE_EXCEPTION (::blink::IgnorableExceptionState().ReturnThis()) | |
| 19 | |
| 20 #if ENABLE(ASSERT) | |
| 21 | |
| 22 class NoExceptionStateAssertionChecker final : public ExceptionState { | |
| 23 public: | |
| 24 NoExceptionStateAssertionChecker(const char* file, int line); | |
| 25 ExceptionState& ReturnThis() { return *this; } | |
| 26 }; | |
| 27 | |
| 28 #define ASSERT_NO_EXCEPTION \ | |
| 29 (::blink::NoExceptionStateAssertionChecker(__FILE__, __LINE__).ReturnThis()) | |
| 30 | |
| 31 #else | |
| 32 | |
| 33 #define ASSERT_NO_EXCEPTION (::blink::IgnorableExceptionState().ReturnThis()) | |
| 34 | |
| 35 #endif | |
| 36 | |
| 37 } // namespace blink | |
| 38 | |
| 39 #endif // SKY_ENGINE_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_ | |
| OLD | NEW |