summaryrefslogtreecommitdiff
path: root/Source/WebCore/bridge/c/c_utility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/bridge/c/c_utility.cpp')
-rw-r--r--Source/WebCore/bridge/c/c_utility.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/WebCore/bridge/c/c_utility.cpp b/Source/WebCore/bridge/c/c_utility.cpp
index 8c5f473ba..66d1e15a1 100644
--- a/Source/WebCore/bridge/c/c_utility.cpp
+++ b/Source/WebCore/bridge/c/c_utility.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2006, 2013 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
*
* Redistribution and use in source and binary forms, with or without
@@ -11,10 +11,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -31,6 +31,7 @@
#include "c_utility.h"
#include "CRuntimeObject.h"
+#include "DOMWindow.h"
#include "JSDOMBinding.h"
#include "JSDOMWindow.h"
#include "NP_jsobject.h"
@@ -69,11 +70,12 @@ static String convertUTF8ToUTF16WithLatin1Fallback(const NPUTF8* UTF8Chars, int
void convertValueToNPVariant(ExecState* exec, JSValue value, NPVariant* result)
{
JSLockHolder lock(exec);
-
+ VM& vm = exec->vm();
+
VOID_TO_NPVARIANT(*result);
if (value.isString()) {
- String ustring = value.toString(exec)->value(exec);
+ String ustring = value.toWTFString(exec);
CString cstring = ustring.utf8();
NPString string = { (const NPUTF8*)cstring.data(), static_cast<uint32_t>(cstring.length()) };
NPN_InitializeVariantWithStringCopy(result, &string);
@@ -85,7 +87,7 @@ void convertValueToNPVariant(ExecState* exec, JSValue value, NPVariant* result)
NULL_TO_NPVARIANT(*result);
} else if (value.isObject()) {
JSObject* object = asObject(value);
- if (object->classInfo() == CRuntimeObject::info()) {
+ if (object->classInfo(vm) == CRuntimeObject::info()) {
CRuntimeObject* runtimeObject = static_cast<CRuntimeObject*>(object);
CInstance* instance = runtimeObject->getInternalCInstance();
if (instance) {
@@ -122,7 +124,7 @@ JSValue convertNPVariantToValue(ExecState* exec, const NPVariant* variant, RootO
if (type == NPVariantType_Double)
return jsNumber(NPVARIANT_TO_DOUBLE(*variant));
if (type == NPVariantType_String)
- return WebCore::jsStringWithCache(exec, convertNPStringToUTF16(&variant->value.stringValue));
+ return jsStringWithCache(exec, convertNPStringToUTF16(&variant->value.stringValue));
if (type == NPVariantType_Object) {
NPObject* obj = variant->value.objectValue;
@@ -144,7 +146,7 @@ String convertNPStringToUTF16(const NPString* string)
Identifier identifierFromNPIdentifier(ExecState* exec, const NPUTF8* name)
{
- return Identifier(exec, convertUTF8ToUTF16WithLatin1Fallback(name, -1));
+ return Identifier::fromString(exec, convertUTF8ToUTF16WithLatin1Fallback(name, -1));
}
} }