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

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

Issue 970403003: bindings: Use V8 MaybeLocal APIs in V8DeviceMotionEventCustom (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « no previous file | Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8BindingMacros.h
diff --git a/Source/bindings/core/v8/V8BindingMacros.h b/Source/bindings/core/v8/V8BindingMacros.h
index 77a7faafd9a59fd952e4ad244a637f205fda3013..39864ef65a92eb4850d8d0658d07314ac2b98ec6 100644
--- a/Source/bindings/core/v8/V8BindingMacros.h
+++ b/Source/bindings/core/v8/V8BindingMacros.h
@@ -77,6 +77,18 @@ namespace blink {
if (UNLIKELY(!var.prepare())) \
return retVal;
+// Use this macro to call V8 APIs which return MaybeLocal<T>.
+#define CALL_V8_WITH_CHECK_MAYBELOCAL_DEFAULT(type, outVariable, callExpression, returnValue) \
Jens Widell 2015/03/04 10:33:05 This macro reminds me quite a lot about the growin
+ v8::Local<type> outVariable; \
+ { \
+ v8::TryCatch block; \
Jens Widell 2015/03/04 10:21:45 This TryCatch serves no purpose. Exceptions are pr
+ if (!(callExpression).ToLocal(&outVariable)) { \
bashi 2015/03/04 10:12:45 Dropped outVariable.IsEmpty() check because when t
+ if (block.HasCaught()) \
+ block.ReThrow(); \
+ return returnValue; \
+ } \
+ }
+
} // namespace blink
#endif // V8BindingMacros_h
« no previous file with comments | « no previous file | Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698