summaryrefslogtreecommitdiffstats
path: root/WebCore/bridge/c
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/bridge/c
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/bridge/c')
-rw-r--r--WebCore/bridge/c/c_instance.cpp11
-rw-r--r--WebCore/bridge/c/c_utility.cpp2
-rw-r--r--WebCore/bridge/c/c_utility.h18
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)