diff options
Diffstat (limited to 'WebCore/bridge/c')
-rw-r--r-- | WebCore/bridge/c/c_instance.cpp | 11 | ||||
-rw-r--r-- | WebCore/bridge/c/c_utility.cpp | 2 | ||||
-rw-r--r-- | WebCore/bridge/c/c_utility.h | 18 |
3 files changed, 8 insertions, 23 deletions
diff --git a/WebCore/bridge/c/c_instance.cpp b/WebCore/bridge/c/c_instance.cpp index 3e6f6d6..24b881f 100644 --- a/WebCore/bridge/c/c_instance.cpp +++ b/WebCore/bridge/c/c_instance.cpp @@ -32,6 +32,7 @@ #include "c_class.h" #include "c_runtime.h" #include "c_utility.h" +#include "IdentifierRep.h" #include "npruntime_impl.h" #include "runtime_root.h" #include <runtime/ArgList.h> @@ -45,6 +46,8 @@ #include <wtf/StringExtras.h> #include <wtf/Vector.h> +using namespace WebCore; + namespace JSC { namespace Bindings { @@ -265,12 +268,12 @@ void CInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArray) } for (uint32_t i = 0; i < count; i++) { - PrivateIdentifier* identifier = static_cast<PrivateIdentifier*>(identifiers[i]); + IdentifierRep* identifier = static_cast<IdentifierRep*>(identifiers[i]); - if (identifier->isString) - nameArray.add(identifierFromNPIdentifier(identifier->value.string)); + if (identifier->isString()) + nameArray.add(identifierFromNPIdentifier(identifier->string())); else - nameArray.add(Identifier::from(exec, identifier->value.number)); + nameArray.add(Identifier::from(exec, identifier->number())); } // FIXME: This should really call NPN_MemFree but that's in WebKit diff --git a/WebCore/bridge/c/c_utility.cpp b/WebCore/bridge/c/c_utility.cpp index 1f5ff6c..352163c 100644 --- a/WebCore/bridge/c/c_utility.cpp +++ b/WebCore/bridge/c/c_utility.cpp @@ -139,7 +139,7 @@ JSValuePtr convertNPVariantToValue(ExecState* exec, const NPVariant* variant, Ro String convertNPStringToUTF16(const NPString* string) { - return convertUTF8ToUTF16WithLatin1Fallback(string->UTF8Characters, string->UTF8Length); + return String::fromUTF8WithLatin1Fallback(string->UTF8Characters, string->UTF8Length); } Identifier identifierFromNPIdentifier(const NPUTF8* name) diff --git a/WebCore/bridge/c/c_utility.h b/WebCore/bridge/c/c_utility.h index 2efc66c..bd25e80 100644 --- a/WebCore/bridge/c/c_utility.h +++ b/WebCore/bridge/c/c_utility.h @@ -46,29 +46,11 @@ class RootObject; typedef uint16_t NPUTF16; -enum NP_ValueType { - NP_NumberValueType, - NP_StringValueType, - NP_BooleanValueType, - NP_NullValueType, - NP_UndefinedValueType, - NP_ObjectValueType, - NP_InvalidValueType -}; - WebCore::String convertNPStringToUTF16(const NPString *string); void convertValueToNPVariant(ExecState*, JSValuePtr, NPVariant* result); JSValuePtr convertNPVariantToValue(ExecState*, const NPVariant*, RootObject*); Identifier identifierFromNPIdentifier(const NPUTF8* name); -struct PrivateIdentifier { - union { - const NPUTF8* string; - int32_t number; - } value; - bool isString; -}; - } } #endif // ENABLE(NETSCAPE_PLUGIN_API) |