Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1453)

Unified Diff: sky/engine/bindings2/exception_state_placeholder.h

Issue 918333002: Add the c++ code part of bindings2/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Updated per earlier reviews Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/bindings2/exception_state.cc ('k') | sky/engine/bindings2/exception_state_placeholder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings2/exception_state_placeholder.h
diff --git a/sky/engine/bindings2/exception_state_placeholder.h b/sky/engine/bindings2/exception_state_placeholder.h
new file mode 100644
index 0000000000000000000000000000000000000000..7983f832a1826f2b08f2f918aac107eda5c692ef
--- /dev/null
+++ b/sky/engine/bindings2/exception_state_placeholder.h
@@ -0,0 +1,39 @@
+// 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_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_
+#define SKY_ENGINE_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_
+
+#include "sky/engine/bindings2/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_BINDINGS2_EXCEPTION_STATE_PLACEHOLDER_H_
« no previous file with comments | « sky/engine/bindings2/exception_state.cc ('k') | sky/engine/bindings2/exception_state_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698