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

Unified Diff: Source/bindings/templates/methods.cpp

Issue 594213002: Inline exception handling code into PrivateScriptRunner helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index 8dec1a2bf31b7c92c1625ccff57365ca5b94e1d7..4784666311d6f66e8c2ee83d345f9b924b736d0e 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -540,25 +540,14 @@ bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar
v8::Handle<v8::Value> *argv = 0;
{% endif %}
ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.name}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate());
- v8::TryCatch block;
- {% if method.idl_type == 'void' %}
- PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv);
- if (block.HasCaught()) {
- PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolate(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "{{method.name}}", "{{cpp_class}}");
- block.ReThrow();
- return false;
- }
- {% else %}
- v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv);
- if (block.HasCaught()) {
- PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolate(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "{{method.name}}", "{{cpp_class}}");
- block.ReThrow();
+ v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState, scriptStateInUserScript, "{{cpp_class}}", "{{method.name}}", holder, {{method.arguments | length}}, argv);
+ if (v8Value.IsEmpty())
return false;
- }
+ {% if method.idl_type != 'void' %}
{{method.private_script_v8_value_to_local_cpp_value}};
- RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
{% endif %}
+ RELEASE_ASSERT(!exceptionState.hadException());
return true;
}
{% endmacro %}
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698