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

Unified Diff: Source/bindings/v8/V8BindingMacros.h

Issue 234403004: Rename V8TRYCATCH_* macros in v8/V8BindingMacros.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8BindingMacros.h
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h
index f5ab5832bef8783b2b6e8890d6f03dce09915a27..af4de06365a5b56a248bafdf28afe1d8097ce1b2 100644
--- a/Source/bindings/v8/V8BindingMacros.h
+++ b/Source/bindings/v8/V8BindingMacros.h
@@ -33,6 +33,9 @@
namespace WebCore {
+// Naming scheme:
+// COMMAND[_VOID][_ARG]...
haraken 2014/04/11 02:33:20 COMMAND[_RETURNTYPE][_ARGUMENTTYPE]... ? Currentl
Nils Barth (inactive) 2014/04/11 03:00:56 How about TONATIVE[_TYPE][_ARGUMENTTYPE]... That w
haraken 2014/04/11 03:28:59 Actually, TONATIVE_BOOL and TONATIVE_STRING are di
+
#define V8TRYCATCH(type, var, value) \
haraken 2014/04/11 02:33:20 V8TRYCATCH_EXCEPTION ?
type var; \
{ \
@@ -42,6 +45,17 @@ namespace WebCore {
return block.ReThrow(); \
}
+#define V8TRYCATCH_VOID(type, var, value) \
+ type var; \
+ { \
+ v8::TryCatch block; \
+ var = (value); \
+ if (UNLIKELY(block.HasCaught())) { \
+ block.ReThrow(); \
+ return; \
+ } \
+ }
+
#define V8TRYCATCH_RETURN(type, var, value, retVal) \
haraken 2014/04/11 02:33:20 V8TRYCATCH_BOOL ?
type var; \
{ \
@@ -53,6 +67,17 @@ namespace WebCore {
} \
}
+#define V8TRYCATCH_VOID_EXCEPTION(type, var, value, exceptionState) \
haraken 2014/04/11 02:33:20 V8TRYCATCH_VOID_EXCEPTIONSTATE ?
+ type var; \
+ { \
+ v8::TryCatch block; \
+ var = (value); \
+ if (UNLIKELY(block.HasCaught())) \
+ exceptionState.rethrowV8Exception(block.Exception()); \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ return; \
+ }
+
#define V8TRYCATCH_EXCEPTION_RETURN(type, var, value, exceptionState, retVal) \
haraken 2014/04/11 02:33:20 V8TRYCATCH_BOOL_EXCEPTIONSTATE ?
type var; \
{ \
@@ -64,38 +89,16 @@ namespace WebCore {
return retVal; \
}
-#define V8TRYCATCH_VOID(type, var, value) \
- type var; \
- { \
- v8::TryCatch block; \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) { \
- block.ReThrow(); \
- return; \
- } \
- }
-
-#define V8TRYCATCH_EXCEPTION_VOID(type, var, value, exceptionState) \
- type var; \
- { \
- v8::TryCatch block; \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) \
- exceptionState.rethrowV8Exception(block.Exception()); \
- if (UNLIKELY(exceptionState.throwIfNeeded())) \
- return; \
- }
+#define V8STRINGRESOURCE_PREPARE_VOID(type, var, value) \
+ type var(value); \
haraken 2014/04/11 02:33:20 You can drop the |type| parameter, because |type|
Nils Barth (inactive) 2014/04/11 03:00:56 V8StringResource<> is a class template, and is ins
haraken 2014/04/11 03:28:59 Makes sense.
Nils Barth (inactive) 2014/04/11 06:01:38 Anyway, added a comment about usage.
+ if (UNLIKELY(!var.prepare())) \
+ return;
-#define V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(type, var, value, retVal) \
- type var(value); \
- if (UNLIKELY(!var.prepare())) \
+#define V8STRINGRESOURCE_PREPARE_RETURN(type, var, value, retVal) \
+ type var(value); \
haraken 2014/04/11 02:33:20 Ditto.
+ if (UNLIKELY(!var.prepare())) \
return retVal;
-#define V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(type, var, value) \
- type var(value); \
- if (UNLIKELY(!var.prepare())) \
- return;
-
} // namespace WebCore
#endif // V8BindingMacros_h
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698