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

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

Issue 242913002: [ABANDONED] Add exception handling options to V8StringResource<T>::prepare. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 var = (value); \ 86 var = (value); \
87 if (UNLIKELY(block.HasCaught())) \ 87 if (UNLIKELY(block.HasCaught())) \
88 exceptionState.rethrowV8Exception(block.Exception()); \ 88 exceptionState.rethrowV8Exception(block.Exception()); \
89 if (UNLIKELY(exceptionState.throwIfNeeded())) \ 89 if (UNLIKELY(exceptionState.throwIfNeeded())) \
90 return retVal; \ 90 return retVal; \
91 } 91 }
92 92
93 // type is an instance of class template V8StringResource<>, 93 // type is an instance of class template V8StringResource<>,
94 // but Mode argument varies; using type (not Mode) for consistency 94 // but Mode argument varies; using type (not Mode) for consistency
95 // with other macros and ease of code generation 95 // with other macros and ease of code generation
96 #define TOSTRING_VOID(type, var, value) \ 96 // Because V8StringResourceToString<Rethrow>::call does not use the instance
97 type var(value); \ 97 // object, we can pass null pointer to |var.init|.
98 if (UNLIKELY(!var.prepare())) \ 98 #define TOSTRING_VOID(type, var, value) \
99 type var(value); \
100 if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \
99 return; 101 return;
100 102
101 #define TOSTRING_DEFAULT(type, var, value, retVal) \ 103 #define TOSTRING_DEFAULT(type, var, value, retVal) \
102 type var(value); \ 104 type var(value); \
103 if (UNLIKELY(!var.prepare())) \ 105 if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \
104 return retVal; 106 return retVal;
105 107
106 } // namespace WebCore 108 } // namespace WebCore
107 109
108 #endif // V8BindingMacros_h 110 #endif // V8BindingMacros_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698