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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 461593002: Remove V8TryCatchRethrowScope from private script bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 if (!scriptState->executionContext()) 1659 if (!scriptState->executionContext())
1660 return false; 1660 return false;
1661 1661
1662 ScriptState::Scope scope(scriptState); 1662 ScriptState::Scope scope(scriptState);
1663 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 1663 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1664 1664
1665 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 1665 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
1666 v8::Handle<v8::Value> argv[] = { valueHandle }; 1666 v8::Handle<v8::Value> argv[] = { valueHandle };
1667 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate()); 1667 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestInterfaceImplementation", scr iptState->context()->Global(), scriptState->isolate());
1668 v8::TryCatch block; 1668 v8::TryCatch block;
1669 V8RethrowTryCatchScope rethrow(block);
1670 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPriv ateScript", holder, 1, argv); 1669 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestInterfaceImplementation", "shortMethodWithShortArgumentImplementedInPriv ateScript", holder, 1, argv);
1671 if (block.HasCaught()) { 1670 if (block.HasCaught()) {
1672 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 1671 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1673 // FIXME: We should support more exceptions. 1672 // FIXME: We should support more exceptions.
1674 RELEASE_ASSERT_NOT_REACHED(); 1673 RELEASE_ASSERT_NOT_REACHED();
1675 } 1674 }
1675 block.ReThrow();
1676 return false; 1676 return false;
1677 } 1677 }
1678 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 1678 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
1679 RELEASE_ASSERT(!exceptionState.hadException()); 1679 RELEASE_ASSERT(!exceptionState.hadException());
1680 *result = cppValue; 1680 *result = cppValue;
1681 return true; 1681 return true;
1682 } 1682 }
1683 1683
1684 bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String* result) 1684 bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String* result)
1685 { 1685 {
1686 if (!frame) 1686 if (!frame)
1687 return false; 1687 return false;
1688 v8::HandleScope handleScope(toIsolate(frame)); 1688 v8::HandleScope handleScope(toIsolate(frame));
1689 ScriptForbiddenScope::AllowUserAgentScript script; 1689 ScriptForbiddenScope::AllowUserAgentScript script;
1690 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 1690 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
1691 if (context.IsEmpty()) 1691 if (context.IsEmpty())
1692 return false; 1692 return false;
1693 ScriptState* scriptState = ScriptState::from(context); 1693 ScriptState* scriptState = ScriptState::from(context);
1694 if (!scriptState->executionContext()) 1694 if (!scriptState->executionContext())
1695 return false; 1695 return false;
1696 1696
1697 ScriptState::Scope scope(scriptState); 1697 ScriptState::Scope scope(scriptState);
1698 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 1698 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1699 1699
1700 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 1700 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
1701 v8::TryCatch block; 1701 v8::TryCatch block;
1702 V8RethrowTryCatchScope rethrow(block);
1703 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestInterfaceImplementation", "stringAttribute", holder); 1702 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestInterfaceImplementation", "stringAttribute", holder);
1704 if (block.HasCaught()) { 1703 if (block.HasCaught()) {
1705 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 1704 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1706 // FIXME: We should support more exceptions. 1705 // FIXME: We should support more exceptions.
1707 RELEASE_ASSERT_NOT_REACHED(); 1706 RELEASE_ASSERT_NOT_REACHED();
1708 } 1707 }
1708 block.ReThrow();
1709 return false; 1709 return false;
1710 } 1710 }
1711 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 1711 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false);
1712 RELEASE_ASSERT(!exceptionState.hadException()); 1712 RELEASE_ASSERT(!exceptionState.hadException());
1713 *result = cppValue; 1713 *result = cppValue;
1714 return true; 1714 return true;
1715 } 1715 }
1716 1716
1717 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue) 1717 bool V8TestInterface::PrivateScript::stringAttributeAttributeSetter(LocalFrame* frame, TestInterfaceImplementation* holderImpl, String cppValue)
1718 { 1718 {
1719 if (!frame) 1719 if (!frame)
1720 return false; 1720 return false;
1721 v8::HandleScope handleScope(toIsolate(frame)); 1721 v8::HandleScope handleScope(toIsolate(frame));
1722 ScriptForbiddenScope::AllowUserAgentScript script; 1722 ScriptForbiddenScope::AllowUserAgentScript script;
1723 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 1723 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
1724 if (context.IsEmpty()) 1724 if (context.IsEmpty())
1725 return false; 1725 return false;
1726 ScriptState* scriptState = ScriptState::from(context); 1726 ScriptState* scriptState = ScriptState::from(context);
1727 if (!scriptState->executionContext()) 1727 if (!scriptState->executionContext())
1728 return false; 1728 return false;
1729 1729
1730 ScriptState::Scope scope(scriptState); 1730 ScriptState::Scope scope(scriptState);
1731 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 1731 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
1732 1732
1733 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate()); 1733 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestInterfaceImplementation", scriptState->context()->Global(), scriptState ->isolate());
1734 v8::TryCatch block; 1734 v8::TryCatch block;
1735 V8RethrowTryCatchScope rethrow(block);
1736 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestInterfaceImplem entation", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue) ); 1735 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestInterfaceImplem entation", "stringAttribute", holder, v8String(scriptState->isolate(), cppValue) );
1737 if (block.HasCaught()) { 1736 if (block.HasCaught()) {
1738 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 1737 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
1739 // FIXME: We should support more exceptions. 1738 // FIXME: We should support more exceptions.
1740 RELEASE_ASSERT_NOT_REACHED(); 1739 RELEASE_ASSERT_NOT_REACHED();
1741 } 1740 }
1741 block.ReThrow();
1742 return false; 1742 return false;
1743 } 1743 }
1744 return true; 1744 return true;
1745 } 1745 }
1746 1746
1747 } // namespace blink 1747 } // namespace blink
1748 #endif // ENABLE(CONDITION) 1748 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698