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

Side by Side Diff: Source/bindings/core/v8/V8BindingMacros.h

Issue 604833002: Use ExceptionState when converting string arguments to promise methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #define TOSTRING_VOID_INTERNAL(var, value) \ 128 #define TOSTRING_VOID_INTERNAL(var, value) \
129 var = (value); \ 129 var = (value); \
130 if (UNLIKELY(!var.prepare())) \ 130 if (UNLIKELY(!var.prepare())) \
131 return; 131 return;
132 132
133 #define TOSTRING_DEFAULT(type, var, value, retVal) \ 133 #define TOSTRING_DEFAULT(type, var, value, retVal) \
134 type var(value); \ 134 type var(value); \
135 if (UNLIKELY(!var.prepare())) \ 135 if (UNLIKELY(!var.prepare())) \
136 return retVal; 136 return retVal;
137 137
138 // We need to cancel the exception propergation when we return a rejected 138 // We need to cancel the exception propagation when we return a rejected
139 // Promise. 139 // Promise.
140 #define TOSTRING_VOID_PROMISE_INTERNAL(var, value, info) \ 140 #define TOSTRING_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(var, value, exceptionState , info, scriptState) \
141 var = (value); \ 141 var = (value); \
142 if (UNLIKELY(!var.prepare())) { \ 142 if (UNLIKELY(!var.prepare(exceptionState))) { \
143 info.GetReturnValue().Set(ScriptPromise::rejectRaw(info.GetIsolate(), bl ock.Exception())); \ 143 v8SetReturnValue(info, exceptionState.reject(scriptState).v8Value()); \
144 block.Reset(); \ 144 return; \
145 return; \
146 }
147
148 #define TOSTRING_VOID_PROMISE(type, var, value, info) \
Jens Widell 2014/09/25 13:51:14 This macro was never used, BTW. The corresponding
149 type var; \
150 { \
151 v8::TryCatch block; \
152 TOSTRING_VOID_PROMISE_INTERNAL(type, var, value, info); \
153 } 145 }
154 146
155 } // namespace blink 147 } // namespace blink
156 148
157 #endif // V8BindingMacros_h 149 #endif // V8BindingMacros_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698