Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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_WITH_CHECK_MAYBELOCAL(type, outValue, callExpression, failureExp ression) \ | |
|
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.
| |
| 82 v8::Local<type> outValue; \ | |
| 83 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
| |
| 84 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
| |
| 85 | |
| 80 } // namespace blink | 86 } // namespace blink |
| 81 | 87 |
| 82 #endif // V8BindingMacros_h | 88 #endif // V8BindingMacros_h |
| OLD | NEW |