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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #define TOSTRING_VOID(type, var, value) \ 70 #define TOSTRING_VOID(type, var, value) \
71 type var(value); \ 71 type var(value); \
72 if (UNLIKELY(!var.prepare())) \ 72 if (UNLIKELY(!var.prepare())) \
73 return; 73 return;
74 74
75 #define TOSTRING_DEFAULT(type, var, value, retVal) \ 75 #define TOSTRING_DEFAULT(type, var, value, retVal) \
76 type var(value); \ 76 type var(value); \
77 if (UNLIKELY(!var.prepare())) \ 77 if (UNLIKELY(!var.prepare())) \
78 return retVal; 78 return retVal;
79 79
80 // Use this macro to call V8 APIs which return MaybeLocal<T>.
81 #define CALL_V8_MAYBELOCAL(outVariable, isolate, callExpression, exceptionState, failureReturnValue) \
haraken 2015/03/06 02:44:07 Do we need the isolate parameter?
haraken 2015/03/06 02:44:07 Nit: I'd prefer calling this CALL_V8, since we don
bashi 2015/03/06 02:54:44 It seems that v8::V8::IsExecutionTerminating() is
bashi 2015/03/06 02:54:44 I'm fine with dropping _MAYBELOCAL, but what the n
82 { \
83 v8::TryCatch block; \
haraken 2015/03/06 02:44:07 Why do we need this TryCatch block? - It's heavy
bashi 2015/03/06 02:54:44 Yeah, this is my concern, but...
Yuki 2015/03/06 04:30:03 Maybe, we'd better ask V8 team to make ToLocal() r
bashi 2015/03/06 05:11:37 @dcarney, WDYT?
haraken 2015/03/06 05:30:51 I'm confused. ToLocal() already returns false when
84 if ((callExpression).ToLocal(&outVariable)) { \
Yuki 2015/03/06 04:30:03 Did you mean?: if (!(...)) I thought that ToLoc
bashi 2015/03/06 05:11:37 ToLocal() returns true when the MaybeLocal<T> is e
85 if (isolate->IsExecutionTerminating()) \
86 return failureReturnValue; \
87 if (block.HasCaught()) \
88 exceptionState.rethrowV8Exception(block.Exception()); \
89 return failureReturnValue; \
90 } \
91 }
92
80 } // namespace blink 93 } // namespace blink
81 94
82 #endif // V8BindingMacros_h 95 #endif // V8BindingMacros_h
OLDNEW
« 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