Chromium Code Reviews| 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..81cb5e81caf2a90050a39eb34fdf42be1949365b 100644 |
| --- a/Source/bindings/core/v8/V8BindingMacros.h |
| +++ b/Source/bindings/core/v8/V8BindingMacros.h |
| @@ -77,6 +77,12 @@ 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(type, outValue, callExpression, failureExpression) \ |
|
Yuki
2015/03/04 09:04:22
From the point of view of users of this macro, I'd
bashi
2015/03/04 10:12:45
Done.
|
| + v8::Local<type> outValue; \ |
| + if (!(callExpression).ToLocal(&outValue) || outValue.IsEmpty()) \ |
|
Jens Widell
2015/03/04 09:01:44
Should ToLocal() failing and the resulting local b
bashi
2015/03/04 10:12:45
If I read ToLocal() correctly, ToLocal() just fail
|
| + failureExpression |
|
Yuki
2015/03/04 09:04:22
do { failureExpression; } while (0)
would be bette
bashi
2015/03/04 10:12:45
I changed to take returnValue as we should return
|
| + |
| } // namespace blink |
| #endif // V8BindingMacros_h |