From 50140f9c6f1ba2e46e440a7910438f68596c034c Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Thu, 12 Nov 2009 14:57:10 -0800 Subject: Remove android-specific plugin exception mechanism --- WebCore/bridge/c/c_instance.cpp | 12 ----------- WebCore/bridge/c/c_runtime.cpp | 48 ----------------------------------------- WebCore/bridge/c/c_runtime.h | 5 ----- 3 files changed, 65 deletions(-) (limited to 'WebCore/bridge/c') diff --git a/WebCore/bridge/c/c_instance.cpp b/WebCore/bridge/c/c_instance.cpp index 81b33c8..77b5966 100644 --- a/WebCore/bridge/c/c_instance.cpp +++ b/WebCore/bridge/c/c_instance.cpp @@ -121,9 +121,6 @@ JSValue CInstance::invokeMethod(ExecState* exec, const MethodList& methodList, c convertValueToNPVariant(exec, args.at(i), &cArgs[i]); // Invoke the 'C' method. -#ifdef ANDROID_NPN_SETEXCEPTION - SetGlobalException(0); -#endif bool retval = true; NPVariant resultVariant; VOID_TO_NPVARIANT(resultVariant); @@ -143,9 +140,6 @@ JSValue CInstance::invokeMethod(ExecState* exec, const MethodList& methodList, c JSValue resultValue = convertNPVariantToValue(exec, &resultVariant, _rootObject.get()); _NPN_ReleaseVariantValue(&resultVariant); -#ifdef ANDROID_NPN_SETEXCEPTION - MoveGlobalExceptionToExecState(exec); -#endif return resultValue; } @@ -163,9 +157,6 @@ JSValue CInstance::invokeDefaultMethod(ExecState* exec, const ArgList& args) convertValueToNPVariant(exec, args.at(i), &cArgs[i]); // Invoke the 'C' method. -#ifdef ANDROID_NPN_SETEXCEPTION - SetGlobalException(0); -#endif bool retval = true; NPVariant resultVariant; VOID_TO_NPVARIANT(resultVariant); @@ -184,9 +175,6 @@ JSValue CInstance::invokeDefaultMethod(ExecState* exec, const ArgList& args) JSValue resultValue = convertNPVariantToValue(exec, &resultVariant, _rootObject.get()); _NPN_ReleaseVariantValue(&resultVariant); -#ifdef ANDROID_NPN_SETEXCEPTION - MoveGlobalExceptionToExecState(exec); -#endif return resultValue; } diff --git a/WebCore/bridge/c/c_runtime.cpp b/WebCore/bridge/c/c_runtime.cpp index 46d7c6f..e9a7bb6 100644 --- a/WebCore/bridge/c/c_runtime.cpp +++ b/WebCore/bridge/c/c_runtime.cpp @@ -32,47 +32,11 @@ #include "c_instance.h" #include "c_utility.h" #include "npruntime_impl.h" -#ifdef ANDROID_NPN_SETEXCEPTION -#include "runtime/Error.h" -#endif // ANDROID_NPN_SETEXCEPTION #include namespace JSC { namespace Bindings { -#ifdef ANDROID_NPN_SETEXCEPTION -/* - * When throwing an exception, we need to use the current ExecState. - * The following two methods implement a similar solution to the - * Objective-C implementation, where _NPN_SetException set a global - * exception (using SetGlobalException). - * We then test (using MoveGlobalExceptionToExecState) if the exception - * is set, after each javascript call that might result in an exception. - * If the exception is set we throw it with the passed ExecState. - */ - -static UString* globalLastException = 0; - -void SetGlobalException(const NPUTF8* exception) -{ - if (globalLastException != 0) { - delete globalLastException; - globalLastException = 0; - } - if (exception != 0) - globalLastException = new UString(exception); -} - -void MoveGlobalExceptionToExecState(ExecState* exec) -{ - if (!globalLastException) - return; - JSLock lock(exec); - throwError(exec, GeneralError, *globalLastException); - SetGlobalException(0); -} -#endif // ANDROID_NPN_SETEXCEPTION - JSValue CField::valueFromInstance(ExecState* exec, const Instance* inst) const { const CInstance* instance = static_cast(inst); @@ -81,17 +45,11 @@ JSValue CField::valueFromInstance(ExecState* exec, const Instance* inst) const NPVariant property; VOID_TO_NPVARIANT(property); -#ifdef ANDROID_NPN_SETEXCEPTION - SetGlobalException(0); -#endif // ANDROID_NPN_SETEXCEPTION bool result; { JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly); result = obj->_class->getProperty(obj, _fieldIdentifier, &property); } -#ifdef ANDROID_NPN_SETEXCEPTION - MoveGlobalExceptionToExecState(exec); -#endif // ANDROID_NPN_SETEXCEPTION if (result) { JSValue result = convertNPVariantToValue(exec, &property, instance->rootObject()); _NPN_ReleaseVariantValue(&property); @@ -109,18 +67,12 @@ void CField::setValueToInstance(ExecState *exec, const Instance *inst, JSValue a NPVariant variant; convertValueToNPVariant(exec, aValue, &variant); -#ifdef ANDROID_NPN_SETEXCEPTION - SetGlobalException(0); -#endif // ANDROID_NPN_SETEXCEPTION { JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly); obj->_class->setProperty(obj, _fieldIdentifier, &variant); } _NPN_ReleaseVariantValue(&variant); -#ifdef ANDROID_NPN_SETEXCEPTION - MoveGlobalExceptionToExecState(exec); -#endif // ANDROID_NPN_SETEXCEPTION } } diff --git a/WebCore/bridge/c/c_runtime.h b/WebCore/bridge/c/c_runtime.h index 676d949..e797342 100644 --- a/WebCore/bridge/c/c_runtime.h +++ b/WebCore/bridge/c/c_runtime.h @@ -60,11 +60,6 @@ private: NPIdentifier _methodIdentifier; }; -#ifdef ANDROID_NPN_SETEXCEPTION -void SetGlobalException(const NPUTF8* exception); -void MoveGlobalExceptionToExecState(ExecState* exec); -#endif // ANDROID_NPN_SETEXCEPTION - } // namespace Bindings } // namespace JSC -- cgit v1.1