Commit 99428fc0 authored by barraclough@apple.com's avatar barraclough@apple.com

Switch String::/UString::ascii() to return a CString.

Rubber stamped by Sam Weinig.

JavaScriptCore: 

* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* bytecode/SamplingTool.cpp:
(JSC::SamplingTool::dump):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::dumpCaller):
* jsc.cpp:
(runWithScripts):
(runInteractive):
* runtime/Identifier.h:
(JSC::Identifier::ascii):
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::print):
* runtime/UString.cpp:
(JSC::UString::ascii):
(JSC::UString::latin1):
* runtime/UString.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::asciiOLD):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::ascii):
(WTF::String::latin1):
* wtf/text/WTFString.h:

WebCore: 

* WebCore.xcodeproj/project.pbxproj:
* bridge/c/c_class.cpp:
(JSC::Bindings::CClass::methodsNamed):
(JSC::Bindings::CClass::fieldNamed):
* bridge/jni/jsc/JNIBridgeJSC.cpp:
(JavaField::valueFromInstance):
(JavaField::setValueToInstance):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaInstance::invokeMethod):
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::methodsNamed):
(JSC::Bindings::ObjcClass::fieldNamed):
* bridge/objc/objc_instance.mm:
(ObjcInstance::setValueOfUndefinedField):
(ObjcInstance::getValueOfUndefinedField):
* loader/icon/IconRecord.cpp:
* platform/sql/SQLiteDatabase.cpp:
* platform/sql/SQLiteStatement.cpp:
* storage/SQLStatement.cpp:

WebKit: 

* WebKit.xcodeproj/project.pbxproj:

WebKit/mac: 

* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 643badf6
2010-08-13 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig.
Switch String::/UString::ascii() to return a CString.
* JavaScriptCore.exp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* bytecode/SamplingTool.cpp:
(JSC::SamplingTool::dump):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::dumpCaller):
* jsc.cpp:
(runWithScripts):
(runInteractive):
* runtime/Identifier.h:
(JSC::Identifier::ascii):
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::print):
* runtime/UString.cpp:
(JSC::UString::ascii):
(JSC::UString::latin1):
* runtime/UString.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::asciiOLD):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::ascii):
(WTF::String::latin1):
* wtf/text/WTFString.h:
2010-08-13 Gabor Loki <loki@webkit.org>
Reviewed by Gavin Barraclough.
......
......@@ -333,7 +333,6 @@ __ZN3WTF10StringImpl4findEPKcib
__ZN3WTF10StringImpl4findEPS0_ib
__ZN3WTF10StringImpl4findEti
__ZN3WTF10StringImpl5adoptERNS_12StringBufferE
__ZN3WTF10StringImpl5asciiEv
__ZN3WTF10StringImpl5emptyEv
__ZN3WTF10StringImpl5lowerEv
__ZN3WTF10StringImpl5toIntEPb
......
......@@ -2326,6 +2326,7 @@
isa = PBXProject;
buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
......
......@@ -353,7 +353,7 @@ void CodeBlock::dump(ExecState* exec) const
printf("\nIdentifiers:\n");
size_t i = 0;
do {
printf(" id%u = %s\n", static_cast<unsigned>(i), m_identifiers[i].ascii());
printf(" id%u = %s\n", static_cast<unsigned>(i), m_identifiers[i].ustring().utf8().data());
++i;
} while (i != m_identifiers.size());
}
......@@ -363,7 +363,7 @@ void CodeBlock::dump(ExecState* exec) const
unsigned registerIndex = m_numVars;
size_t i = 0;
do {
printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).ascii());
printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).utf8().data());
++i;
++registerIndex;
} while (i < m_constantRegisters.size());
......@@ -373,7 +373,7 @@ void CodeBlock::dump(ExecState* exec) const
printf("\nm_regexps:\n");
size_t i = 0;
do {
printf(" re%u = %s\n", static_cast<unsigned>(i), regexpToSourceString(m_rareData->m_regexps[i].get()).ascii());
printf(" re%u = %s\n", static_cast<unsigned>(i), regexpToSourceString(m_rareData->m_regexps[i].get()).utf8().data());
++i;
} while (i < m_rareData->m_regexps.size());
}
......@@ -454,7 +454,7 @@ void CodeBlock::dump(ExecState* exec) const
continue;
ASSERT(!((i + m_rareData->m_characterSwitchJumpTables[i].min) & ~0xFFFF));
UChar ch = static_cast<UChar>(entry + m_rareData->m_characterSwitchJumpTables[i].min);
printf("\t\t\"%s\" => %04d\n", UString(&ch, 1).ascii(), *iter);
printf("\t\t\"%s\" => %04d\n", UString(&ch, 1).utf8().data(), *iter);
}
printf(" }\n");
++i;
......@@ -468,7 +468,7 @@ void CodeBlock::dump(ExecState* exec) const
printf(" %1d = {\n", i);
StringJumpTable::StringOffsetTable::const_iterator end = m_rareData->m_stringSwitchJumpTables[i].offsetTable.end();
for (StringJumpTable::StringOffsetTable::const_iterator iter = m_rareData->m_stringSwitchJumpTables[i].offsetTable.begin(); iter != end; ++iter)
printf("\t\t\"%s\" => %04d\n", UString(iter->first).ascii(), iter->second.branchOffset);
printf("\t\t\"%s\" => %04d\n", UString(iter->first).utf8().data(), iter->second.branchOffset);
printf(" }\n");
++i;
} while (i < m_rareData->m_stringSwitchJumpTables.size());
......@@ -714,7 +714,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).data());
printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data());
it += 2;
break;
}
......@@ -723,7 +723,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
JSValue scope = JSValue((++it)->u.jsCell);
int id0 = (++it)->u.operand;
int depth = it[2].u.operand;
printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).data(), depth);
printf("[%4d] resolve_global_dynamic\t %s, %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), idName(id0, m_identifiers[id0]).data(), depth);
it += 3;
break;
}
......@@ -745,14 +745,14 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).ascii(), index);
printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).data(), valueToSourceString(exec, scope).utf8().data(), index);
break;
}
case op_put_global_var: {
JSValue scope = JSValue((++it)->u.jsCell);
int index = (++it)->u.operand;
int r0 = (++it)->u.operand;
printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(exec, r0).data());
printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).utf8().data(), index, registerName(exec, r0).data());
break;
}
case op_resolve_base: {
......
......@@ -337,7 +337,7 @@ void SamplingTool::dump(ExecState* exec)
if (blockPercent >= 1) {
//Instruction* code = codeBlock->instructions().begin();
printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().ascii(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().utf8().data(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent);
if (i < 10) {
HashMap<unsigned,unsigned> lineCounts;
codeBlock->dump(exec);
......
......@@ -40,7 +40,7 @@ void CallFrame::dumpCaller()
JSValue function;
interpreter()->retrieveLastCaller(this, signedLineNumber, sourceID, urlString, function);
printf("Callpoint => %s:%d\n", urlString.ascii(), signedLineNumber);
printf("Callpoint => %s:%d\n", urlString.utf8().data(), signedLineNumber);
}
RegisterFile* CallFrame::registerFile()
......
......@@ -392,9 +392,9 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector<Script>& scr
success = success && completion.complType() != Throw;
if (dump) {
if (completion.complType() == Throw)
printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
else
printf("End: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
printf("End: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
}
globalData->stopSampling();
......@@ -440,7 +440,7 @@ static void runInteractive(GlobalObject* globalObject)
Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line.data(), interpreterName));
#endif
if (completion.complType() == Throw)
printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).ascii());
printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
else
printf("%s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
......
......@@ -50,7 +50,7 @@ namespace JSC {
const UChar* characters() const { return m_string.characters(); }
int length() const { return m_string.length(); }
const char* ascii() const { return m_string.ascii(); }
CString ascii() const { return m_string.ascii(); }
static Identifier from(ExecState* exec, unsigned y);
static Identifier from(ExecState* exec, int y);
......
......@@ -43,7 +43,7 @@ void ScopeChainNode::print() const
fprintf(stderr, "----- [scope %p] -----\n", o);
for (PropertyNameArray::const_iterator propIter = propertyNames.begin(); propIter != propEnd; propIter++) {
Identifier name = *propIter;
fprintf(stderr, "%s, ", name.ascii());
fprintf(stderr, "%s, ", name.ustring().utf8().data());
}
fprintf(stderr, "\n");
}
......
......@@ -204,28 +204,6 @@ UString UString::number(double d)
return UString(buffer, length);
}
char* UString::ascii() const
{
static char* asciiBuffer = 0;
unsigned len = length();
unsigned neededSize = len + 1;
delete[] asciiBuffer;
asciiBuffer = new char[neededSize];
const UChar* p = characters();
char* q = asciiBuffer;
const UChar* limit = p + len;
while (p != limit) {
*q = static_cast<char>(p[0]);
++p;
++q;
}
*q = '\0';
return asciiBuffer;
}
static inline bool isInfinity(double number)
{
return number == Inf || number == -Inf;
......@@ -583,6 +561,44 @@ bool operator>(const UString& s1, const UString& s2)
return (l1 > l2);
}
CString UString::ascii() const
{
// Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
// preserved, characters outside of this range are converted to '?'.
unsigned length = this->length();
const UChar* characters = this->characters();
char* characterBuffer;
CString result = CString::newUninitialized(length, characterBuffer);
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
characterBuffer[i] = ch && (ch < 0x20 || ch >= 0x7f) ? '?' : ch;
}
return result;
}
CString UString::latin1() const
{
// Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
// preserved, characters outside of this range are converted to '?'.
unsigned length = this->length();
const UChar* characters = this->characters();
char* characterBuffer;
CString result = CString::newUninitialized(length, characterBuffer);
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
characterBuffer[i] = ch > 0xff ? '?' : ch;
}
return result;
}
// Helper to write a three-byte UTF-8 code point to the buffer, caller must check room is available.
static inline void putUTF8Triple(char*& buffer, UChar ch)
{
......
......@@ -87,6 +87,8 @@ public:
return m_impl->characters();
}
CString ascii() const;
CString latin1() const;
CString utf8(bool strict = false) const;
UChar operator[](unsigned index) const
......@@ -120,10 +122,6 @@ public:
UString substr(unsigned pos = 0, unsigned len = 0xFFFFFFFF) const;
// NOTE: This method should only be used for *debugging* purposes as it
// is neither Unicode safe nor free from side effects nor thread-safe.
char* ascii() const;
private:
RefPtr<StringImpl> m_impl;
};
......
......@@ -883,20 +883,6 @@ bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
return false;
}
Vector<char> StringImpl::ascii()
{
Vector<char> buffer(m_length + 1);
for (unsigned i = 0; i != m_length; ++i) {
UChar c = m_data[i];
if ((c >= 0x20 && c < 0x7F) || c == 0x00)
buffer[i] = static_cast<char>(c);
else
buffer[i] = '?';
}
buffer[m_length] = '\0';
return buffer;
}
WTF::Unicode::Direction StringImpl::defaultWritingDirection()
{
for (unsigned i = 0; i < m_length; ++i) {
......
......@@ -306,8 +306,6 @@ public:
PassRefPtr<StringImpl> replace(StringImpl*, StringImpl*);
PassRefPtr<StringImpl> replace(unsigned index, unsigned len, StringImpl*);
Vector<char> ascii();
WTF::Unicode::Direction defaultWritingDirection();
#if PLATFORM(CF)
......
......@@ -612,18 +612,23 @@ void String::split(UChar separator, Vector<String>& result) const
return split(String(&separator, 1), false, result);
}
Vector<char> String::ascii() const
CString String::ascii() const
{
if (m_impl)
return m_impl->ascii();
const char* nullMsg = "(null impl)";
Vector<char, 2048> buffer;
for (int i = 0; nullMsg[i]; ++i)
buffer.append(nullMsg[i]);
buffer.append('\0');
return buffer;
// Basic Latin1 (ISO) encoding - Unicode characters 0..255 are
// preserved, characters outside of this range are converted to '?'.
unsigned length = this->length();
const UChar* characters = this->characters();
char* characterBuffer;
CString result = CString::newUninitialized(length, characterBuffer);
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
characterBuffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch;
}
return result;
}
CString String::latin1() const
......@@ -639,7 +644,7 @@ CString String::latin1() const
for (unsigned i = 0; i < length; ++i) {
UChar ch = characters[i];
characterBuffer[i] = ch > 255 ? '?' : ch;
characterBuffer[i] = ch > 0xff ? '?' : ch;
}
return result;
......
......@@ -125,6 +125,7 @@ public:
return m_impl->characters();
}
CString ascii() const;
CString latin1() const;
CString utf8(bool strict = false) const;
......@@ -278,8 +279,6 @@ public:
operator BString() const;
#endif
Vector<char> ascii() const;
static String fromUTF8(const char*, size_t);
static String fromUTF8(const char*);
......
2010-08-13 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig.
Switch String::/UString::ascii() to return a CString.
* WebCore.xcodeproj/project.pbxproj:
* bridge/c/c_class.cpp:
(JSC::Bindings::CClass::methodsNamed):
(JSC::Bindings::CClass::fieldNamed):
* bridge/jni/jsc/JNIBridgeJSC.cpp:
(JavaField::valueFromInstance):
(JavaField::setValueToInstance):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaInstance::invokeMethod):
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::methodsNamed):
(JSC::Bindings::ObjcClass::fieldNamed):
* bridge/objc/objc_instance.mm:
(ObjcInstance::setValueOfUndefinedField):
(ObjcInstance::getValueOfUndefinedField):
* loader/icon/IconRecord.cpp:
* platform/sql/SQLiteDatabase.cpp:
* platform/sql/SQLiteStatement.cpp:
* storage/SQLStatement.cpp:
2010-08-13 Mihai Parparita <mihaip@chromium.org>
Reviewed by Dimitri Glazkov.
......@@ -20222,6 +20222,7 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -81,7 +81,7 @@ MethodList CClass::methodsNamed(const Identifier& identifier, Instance* instance
return methodList;
}
NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii().data());
const CInstance* inst = static_cast<const CInstance*>(instance);
NPObject* obj = inst->getObject();
if (_isa->hasMethod && _isa->hasMethod(obj, ident)){
......@@ -102,7 +102,7 @@ Field* CClass::fieldNamed(const Identifier& identifier, Instance* instance) cons
if (aField)
return aField;
NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii());
NPIdentifier ident = _NPN_GetStringIdentifier(identifier.ascii().data());
const CInstance* inst = static_cast<const CInstance*>(instance);
NPObject* obj = inst->getObject();
if (_isa->hasProperty && _isa->hasProperty(obj, ident)){
......
......@@ -150,7 +150,7 @@ JSValue JavaField::valueFromInstance(ExecState* exec, const Instance* i) const
break;
}
LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name()).utf8().data(), jsresult.toString(exec).ascii());
LOG(LiveConnect, "JavaField::valueFromInstance getting %s = %s", UString(name()).utf8().data(), jsresult.toString(exec).ascii().data());
return jsresult;
}
......@@ -186,7 +186,7 @@ void JavaField::setValueToInstance(ExecState* exec, const Instance* i, JSValue a
const JavaInstance* instance = static_cast<const JavaInstance*>(i);
jvalue javaValue = convertValueToJValue(exec, i->rootObject(), aValue, m_JNIType, type());
LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name()).utf8().data(), aValue.toString(exec).ascii());
LOG(LiveConnect, "JavaField::setValueToInstance setting value %s to %s", UString(name()).utf8().data(), aValue.toString(exec).ascii().data());
switch (m_JNIType) {
case array_type:
......
......@@ -169,7 +169,7 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
for (i = 0; i < count; i++) {
JavaParameter* aParameter = jMethod->parameterAt(i);
jArgs[i] = convertValueToJValue(exec, m_rootObject.get(), exec->argument(i), aParameter->getJNIType(), aParameter->type());
LOG(LiveConnect, "JavaInstance::invokeMethod arg[%d] = %s", i, exec->argument(i).toString(exec).ascii());
LOG(LiveConnect, "JavaInstance::invokeMethod arg[%d] = %s", i, exec->argument(i).toString(exec).ascii().data());
}
jvalue result;
......
......@@ -78,11 +78,11 @@ MethodList ObjcClass::methodsNamed(const Identifier& identifier, Instance*) cons
MethodList methodList;
char fixedSizeBuffer[1024];
char* buffer = fixedSizeBuffer;
const char* JSName = identifier.ascii();
if (!convertJSMethodNameToObjc(JSName, buffer, sizeof(fixedSizeBuffer))) {
int length = strlen(JSName) + 1;
CString jsName = identifier.ascii();
if (!convertJSMethodNameToObjc(jsName.data(), buffer, sizeof(fixedSizeBuffer))) {
int length = jsName.length() + 1;
buffer = new char[length];
if (!buffer || !convertJSMethodNameToObjc(JSName, buffer, length))
if (!buffer || !convertJSMethodNameToObjc(jsName.data(), buffer, length))
return methodList;
}
......@@ -153,8 +153,8 @@ Field* ObjcClass::fieldNamed(const Identifier& identifier, Instance* instance) c
{
ClassStructPtr thisClass = _isa;
const char* name = identifier.ascii();
RetainPtr<CFStringRef> fieldName(AdoptCF, CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII));
CString jsName = identifier.ascii();
RetainPtr<CFStringRef> fieldName(AdoptCF, CFStringCreateWithCString(NULL, jsName.data(), kCFStringEncodingASCII));
Field* aField = (Field*)CFDictionaryGetValue(_fields.get(), fieldName.get());
if (aField)
return aField;
......@@ -220,7 +220,7 @@ Field* ObjcClass::fieldNamed(const Identifier& identifier, Instance* instance) c
if ([thisClass respondsToSelector:@selector(webScriptNameForKey:)])
mappedName = [thisClass webScriptNameForKey:objcIvarName];
if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || strcmp(objcIvarName, name) == 0) {
if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || strcmp(objcIvarName, jsName.data()) == 0) {
aField = new ObjcField(objcIVar); // deleted when the dictionary is destroyed
CFDictionaryAddValue(_fields.get(), fieldName.get(), aField);
break;
......
......@@ -391,7 +391,7 @@ bool ObjcInstance::setValueOfUndefinedField(ExecState* exec, const Identifier& p
ObjcValue objcValue = convertValueToObjcValue(exec, aValue, ObjcObjectType);
@try {
[targetObject setValue:objcValue.objectValue forUndefinedKey:[NSString stringWithCString:property.ascii() encoding:NSASCIIStringEncoding]];
[targetObject setValue:objcValue.objectValue forUndefinedKey:[NSString stringWithCString:property.ascii().data() encoding:NSASCIIStringEncoding]];
} @catch(NSException* localException) {
// Do nothing. Class did not override valueForUndefinedKey:.
}
......@@ -417,7 +417,7 @@ JSValue ObjcInstance::getValueOfUndefinedField(ExecState* exec, const Identifier
setGlobalException(nil);
@try {
id objcValue = [targetObject valueForUndefinedKey:[NSString stringWithCString:property.ascii() encoding:NSASCIIStringEncoding]];
id objcValue = [targetObject valueForUndefinedKey:[NSString stringWithCString:property.ascii().data() encoding:NSASCIIStringEncoding]];
result = convertObjcValueToValue(exec, &objcValue, ObjcObjectType, m_rootObject.get());
} @catch(NSException* localException) {
// Do nothing. Class did not override valueForUndefinedKey:.
......
......@@ -34,6 +34,7 @@
#include "Logging.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
#include <wtf/text/CString.h>
#include <limits.h>
......
......@@ -33,6 +33,7 @@
#include "SQLiteStatement.h"
#include <sqlite3.h>
#include <wtf/Threading.h>
#include <wtf/text/CString.h>
namespace WebCore {
......
......@@ -30,6 +30,7 @@
#include "SQLValue.h"
#include <sqlite3.h>
#include <wtf/Assertions.h>
#include <wtf/text/CString.h>
namespace WebCore {
......
......@@ -39,6 +39,7 @@
#include "SQLStatementErrorCallback.h"
#include "SQLTransaction.h"
#include "SQLValue.h"
#include <wtf/text/CString.h>
namespace WebCore {
......
2010-08-13 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig.
Switch String::/UString::ascii() to return a CString.
* WebKit.xcodeproj/project.pbxproj:
2010-08-06 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig
......
......@@ -1616,6 +1616,7 @@
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
......
2010-08-13 Gavin Barraclough <barraclough@apple.com>
Rubber stamped by Sam Weinig.
Switch String::/UString::ascii() to return a CString.
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::methodsNamed):
(WebKit::ProxyInstance::fieldNamed):
2010-08-13 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig
......
......@@ -337,7 +337,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier)
return methodList;
}
uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data()));
uint32_t requestID = m_instanceProxy->nextRequestID();
if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(),
......@@ -373,7 +373,7 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier)
if (existingMapEntry != m_fields.end())
return existingMapEntry->second;
uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii()));
uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data()));
uint32_t requestID = m_instanceProxy->nextRequestID();
if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment