mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
There's only one bindings system now. TBR=eseidel@chromium.org Review URL: https://codereview.chromium.org/915293003
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
// Copyright 2014 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.
|
|
|
|
#ifndef SKY_ENGINE_BINDINGS_EXCEPTION_STATE_PLACEHOLDER_H_
|
|
#define SKY_ENGINE_BINDINGS_EXCEPTION_STATE_PLACEHOLDER_H_
|
|
|
|
#include "sky/engine/bindings/exception_state.h"
|
|
#include "sky/engine/wtf/Assertions.h"
|
|
|
|
namespace blink {
|
|
|
|
class IgnorableExceptionState final : public ExceptionState {
|
|
public:
|
|
ExceptionState& ReturnThis() { return *this; }
|
|
};
|
|
|
|
#define IGNORE_EXCEPTION (::blink::IgnorableExceptionState().ReturnThis())
|
|
|
|
#if ENABLE(ASSERT)
|
|
|
|
class NoExceptionStateAssertionChecker final : public ExceptionState {
|
|
public:
|
|
NoExceptionStateAssertionChecker(const char* file, int line);
|
|
ExceptionState& ReturnThis() { return *this; }
|
|
};
|
|
|
|
#define ASSERT_NO_EXCEPTION \
|
|
(::blink::NoExceptionStateAssertionChecker(__FILE__, __LINE__).ReturnThis())
|
|
|
|
#else
|
|
|
|
#define ASSERT_NO_EXCEPTION (::blink::IgnorableExceptionState().ReturnThis())
|
|
|
|
#endif
|
|
|
|
} // namespace blink
|
|
|
|
#endif // SKY_ENGINE_BINDINGS_EXCEPTION_STATE_PLACEHOLDER_H_
|