summaryrefslogtreecommitdiffstats
path: root/WebCore/bridge/npruntime.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebCore/bridge/npruntime.cpp
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebCore/bridge/npruntime.cpp')
-rw-r--r--WebCore/bridge/npruntime.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/WebCore/bridge/npruntime.cpp b/WebCore/bridge/npruntime.cpp
index bef3676..bb31c6e 100644
--- a/WebCore/bridge/npruntime.cpp
+++ b/WebCore/bridge/npruntime.cpp
@@ -32,7 +32,7 @@
#include "npruntime_priv.h"
#include "c_utility.h"
-#include <kjs/identifier.h>
+#include <runtime/Identifier.h>
#include <runtime/JSLock.h>
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
@@ -71,6 +71,8 @@ NPIdentifier _NPN_GetStringIdentifier(const NPUTF8* name)
identifier = getStringIdentifierMap()->get(identifierFromNPIdentifier(name).ustring().rep());
if (identifier == 0) {
identifier = (PrivateIdentifier*)malloc(sizeof(PrivateIdentifier));
+ if (!identifier)
+ CRASH();
// We never release identifier names, so this dictionary will grow, as will
// the memory for the identifier name strings.
identifier->isString = true;
@@ -104,6 +106,8 @@ NPIdentifier _NPN_GetIntIdentifier(int32_t intid)
identifier = negativeOneAndZeroIdentifiers[intid + 1];
if (!identifier) {
identifier = (PrivateIdentifier*)malloc(sizeof(PrivateIdentifier));
+ if (!identifier)
+ CRASH();
identifier->isString = false;
identifier->value.number = intid;
@@ -113,6 +117,8 @@ NPIdentifier _NPN_GetIntIdentifier(int32_t intid)
identifier = getIntIdentifierMap()->get(intid);
if (!identifier) {
identifier = (PrivateIdentifier*)malloc(sizeof(PrivateIdentifier));
+ if (!identifier)
+ CRASH();
// We never release identifier names, so this dictionary will grow.
identifier->isString = false;
identifier->value.number = intid;
@@ -151,6 +157,8 @@ void NPN_InitializeVariantWithStringCopy(NPVariant* variant, const NPString* val
variant->type = NPVariantType_String;
variant->value.stringValue.UTF8Length = value->UTF8Length;
variant->value.stringValue.UTF8Characters = (NPUTF8 *)malloc(sizeof(NPUTF8) * value->UTF8Length);
+ if (!variant->value.stringValue.UTF8Characters)
+ CRASH();
memcpy((void*)variant->value.stringValue.UTF8Characters, value->UTF8Characters, sizeof(NPUTF8) * value->UTF8Length);
}
@@ -180,7 +188,8 @@ NPObject *_NPN_CreateObject(NPP npp, NPClass* aClass)
obj = aClass->allocate(npp, aClass);
else
obj = (NPObject*)malloc(sizeof(NPObject));
-
+ if (!obj)
+ CRASH();
obj->_class = aClass;
obj->referenceCount = 1;