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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/v8/V8BindingMacros.h
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h
index e5841c9beda84810daf9ed7ea80f01cb7aca48cd..8163666cee2bfee12653c72f4d49ba6db0244477 100644
--- a/Source/bindings/v8/V8BindingMacros.h
+++ b/Source/bindings/v8/V8BindingMacros.h
@@ -93,14 +93,16 @@ namespace WebCore {
// type is an instance of class template V8StringResource<>,
// but Mode argument varies; using type (not Mode) for consistency
// with other macros and ease of code generation
-#define TOSTRING_VOID(type, var, value) \
- type var(value); \
- if (UNLIKELY(!var.prepare())) \
+// Because V8StringResourceToString<Rethrow>::call does not use the instance
+// object, we can pass null pointer to |var.init|.
+#define TOSTRING_VOID(type, var, value) \
+ type var(value); \
+ if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \
return;
-#define TOSTRING_DEFAULT(type, var, value, retVal) \
- type var(value); \
- if (UNLIKELY(!var.prepare())) \
+#define TOSTRING_DEFAULT(type, var, value, retVal) \
+ type var(value); \
+ if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \
return retVal;
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698