diff options
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/bridge/NP_jsobject.cpp | 13 | ||||
-rw-r--r-- | WebCore/bridge/c/c_instance.cpp | 12 | ||||
-rw-r--r-- | WebCore/bridge/c/c_runtime.cpp | 48 | ||||
-rw-r--r-- | WebCore/bridge/c/c_runtime.h | 5 | ||||
-rw-r--r-- | WebCore/config.h | 4 |
5 files changed, 0 insertions, 82 deletions
diff --git a/WebCore/bridge/NP_jsobject.cpp b/WebCore/bridge/NP_jsobject.cpp index 76e2738..6a89652 100644 --- a/WebCore/bridge/NP_jsobject.cpp +++ b/WebCore/bridge/NP_jsobject.cpp @@ -31,9 +31,6 @@ #include "PlatformString.h" #include "StringSourceProvider.h" -#ifdef ANDROID_NPN_SETEXCEPTION -#include "c_runtime.h" -#endif // ANDROID_NPN_SETEXCEPTION #include "c_utility.h" #include "c_instance.h" #include "IdentifierRep.h" @@ -380,21 +377,11 @@ bool _NPN_HasMethod(NPP, NPObject* o, NPIdentifier methodName) return false; } -#ifdef ANDROID_NPN_SETEXCEPTION -void _NPN_SetException(NPObject* o, const NPUTF8* message) -#else void _NPN_SetException(NPObject*, const NPUTF8* message) -#endif { -#ifdef ANDROID_NPN_SETEXCEPTION - if (o->_class == NPScriptObjectClass) { - JSC::Bindings::SetGlobalException(message); - } -#else // Ignorning the NPObject param is consistent with the Mozilla implementation. UString exception(message); CInstance::setGlobalException(exception); -#endif // ANDROID_NPN_SETEXCEPTION } bool _NPN_Enumerate(NPP, NPObject* o, NPIdentifier** identifier, uint32_t* count) 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 <runtime/JSLock.h> 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<const CInstance*>(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 diff --git a/WebCore/config.h b/WebCore/config.h index 49dc01b..50100f3 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -189,10 +189,6 @@ // element will be always fixed to the top page. #define ANDROID_DISABLE_POSITION_FIXED -// Fix exceptions not surfacing through NPAPI bindings to the -// JavaScriptCore execution context. -#define ANDROID_NPN_SETEXCEPTION 1 - // Enable dumping the display tree to a file (triggered in WebView.java) #define ANDROID_DUMP_DISPLAY_TREE |