Skip to content

Commit 5e6fd47

Browse files
committed
Call deprecatedCharacters instead of characters at more call sites
https://bugs.webkit.org/show_bug.cgi?id=127631 Reviewed by Sam Weinig. Source/JavaScriptCore: * API/JSValueRef.cpp: (JSValueMakeFromJSONString): * API/OpaqueJSString.cpp: (OpaqueJSString::~OpaqueJSString): * bindings/ScriptValue.cpp: (Deprecated::jsToInspectorValue): * inspector/ContentSearchUtilities.cpp: (Inspector::ContentSearchUtilities::createSearchRegexSource): * inspector/InspectorValues.cpp: * runtime/Identifier.h: (JSC::Identifier::deprecatedCharacters): * runtime/JSStringBuilder.h: (JSC::JSStringBuilder::append): Use the new name. Source/WebCore: * bindings/objc/WebScriptObject.mm: (+[WebScriptObject _convertValueToObjcValue:JSC::originRootObject:rootObject:]): * editing/CompositeEditCommand.cpp: (WebCore::containsOnlyWhitespace): * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText): * editing/VisibleUnits.cpp: (WebCore::startOfParagraph): (WebCore::endOfParagraph): * html/parser/HTMLParserIdioms.cpp: (WebCore::stripLeadingAndTrailingHTMLSpaces): (WebCore::parseHTMLNonNegativeInteger): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters): * inspector/InspectorStyleTextEditor.cpp: (WebCore::InspectorStyleTextEditor::insertProperty): (WebCore::InspectorStyleTextEditor::internalReplaceProperty): * platform/Length.cpp: (WebCore::newCoordsArray): * platform/LinkHash.cpp: (WebCore::visitedLinkHash): * platform/graphics/Color.cpp: (WebCore::Color::parseHexColor): (WebCore::Color::Color): * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): * platform/text/TextEncodingRegistry.cpp: (WebCore::atomicCanonicalTextEncodingName): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::constructTextRun): * rendering/RenderCombineText.cpp: (WebCore::RenderCombineText::width): * svg/SVGFontElement.cpp: (WebCore::SVGFontElement::registerLigaturesInGlyphCache): * xml/XPathFunctions.cpp: (WebCore::XPath::FunId::evaluate): Use the new name. Source/WTF: * wtf/text/StringImpl.cpp: (WTF::StringImpl::replace): * wtf/text/WTFString.h: (WTF::String::isAllSpecialCharacters): Use the new name. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: (TestWebKitAPI::expectBuilderContent): (TestWebKitAPI::expectEmpty): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/StringImpl.cpp: (TestWebKitAPI::TEST): Use the new name. Canonical link: https://commits.webkit.org/145649@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 80440ad commit 5e6fd47

31 files changed

Lines changed: 138 additions & 43 deletions

Source/JavaScriptCore/API/JSValueRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)
327327
LiteralParser<LChar> parser(exec, str.characters8(), length, StrictJSON);
328328
return toRef(exec, parser.tryLiteralParse());
329329
}
330-
LiteralParser<UChar> parser(exec, str.characters(), length, StrictJSON);
330+
LiteralParser<UChar> parser(exec, str.deprecatedCharacters(), length, StrictJSON);
331331
return toRef(exec, parser.tryLiteralParse());
332332
}
333333

Source/JavaScriptCore/API/OpaqueJSString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ OpaqueJSString::~OpaqueJSString()
4747
if (!characters)
4848
return;
4949

50-
if (!m_string.is8Bit() && m_string.characters() == characters)
50+
if (!m_string.is8Bit() && m_string.deprecatedCharacters() == characters)
5151
return;
5252

5353
fastFree(characters);

Source/JavaScriptCore/ChangeLog

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2014-01-25 Darin Adler <[email protected]>
2+
3+
Call deprecatedCharacters instead of characters at more call sites
4+
https://bugs.webkit.org/show_bug.cgi?id=127631
5+
6+
Reviewed by Sam Weinig.
7+
8+
* API/JSValueRef.cpp:
9+
(JSValueMakeFromJSONString):
10+
* API/OpaqueJSString.cpp:
11+
(OpaqueJSString::~OpaqueJSString):
12+
* bindings/ScriptValue.cpp:
13+
(Deprecated::jsToInspectorValue):
14+
* inspector/ContentSearchUtilities.cpp:
15+
(Inspector::ContentSearchUtilities::createSearchRegexSource):
16+
* inspector/InspectorValues.cpp:
17+
* runtime/Identifier.h:
18+
(JSC::Identifier::deprecatedCharacters):
19+
* runtime/JSStringBuilder.h:
20+
(JSC::JSStringBuilder::append):
21+
Use the new name.
22+
123
2014-01-25 Darin Adler <[email protected]>
224

325
Get rid of ICU_UNICODE and WCHAR_UNICODE remnants

Source/JavaScriptCore/bindings/ScriptValue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSV
117117
return InspectorBasicValue::create(value.asNumber());
118118
if (value.isString()) {
119119
String s = value.getString(scriptState);
120-
return InspectorString::create(String(s.characters(), s.length()));
120+
return InspectorString::create(String(s.deprecatedCharacters(), s.length()));
121121
}
122122

123123
if (value.isObject()) {
@@ -144,7 +144,7 @@ static PassRefPtr<InspectorValue> jsToInspectorValue(ExecState* scriptState, JSV
144144
RefPtr<InspectorValue> inspectorValue = jsToInspectorValue(scriptState, propertyValue, maxDepth);
145145
if (!inspectorValue)
146146
return nullptr;
147-
inspectorObject->setValue(String(name.characters(), name.length()), inspectorValue);
147+
inspectorObject->setValue(String(name.deprecatedCharacters(), name.length()), inspectorValue);
148148
}
149149
return inspectorObject;
150150
}

Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static const char regexSpecialCharacters[] = "[](){}+-*.,?\\^$|";
4848
static String createSearchRegexSource(const String& text)
4949
{
5050
String result;
51-
const UChar* characters = text.characters();
51+
const UChar* characters = text.deprecatedCharacters();
5252
String specials(regexSpecialCharacters);
5353

5454
for (unsigned i = 0; i < text.length(); i++) {

Source/JavaScriptCore/inspector/InspectorValues.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ inline void doubleQuoteString(const String& str, StringBuilder* dst)
472472
// is also optional. It would also be a pain to implement here.
473473
unsigned int symbol = static_cast<unsigned int>(c);
474474
String symbolCode = String::format("\\u%04X", symbol);
475-
dst->append(symbolCode.characters(), symbolCode.length());
475+
dst->append(symbolCode.deprecatedCharacters(), symbolCode.length());
476476
} else
477477
dst->append(c);
478478
}

Source/JavaScriptCore/runtime/Identifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace JSC {
5555
const String& string() const { return m_string; }
5656
StringImpl* impl() const { return m_string.impl(); }
5757

58-
const UChar* characters() const { return m_string.characters(); }
58+
const UChar* deprecatedCharacters() const { return m_string.deprecatedCharacters(); }
5959
int length() const { return m_string.length(); }
6060

6161
CString ascii() const { return m_string.ascii(); }

Source/JavaScriptCore/runtime/JSStringBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class JSStringBuilder {
105105
}
106106
upConvert();
107107
}
108-
m_okay &= buffer16.tryAppend(str.characters(), length);
108+
m_okay &= buffer16.tryAppend(str.deprecatedCharacters(), length);
109109
}
110110

111111
void upConvert()

Source/WTF/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2014-01-25 Darin Adler <[email protected]>
2+
3+
Call deprecatedCharacters instead of characters at more call sites
4+
https://bugs.webkit.org/show_bug.cgi?id=127631
5+
6+
Reviewed by Sam Weinig.
7+
8+
* wtf/text/StringImpl.cpp:
9+
(WTF::StringImpl::replace):
10+
* wtf/text/WTFString.h:
11+
(WTF::String::isAllSpecialCharacters):
12+
Use the new name.
13+
114
2014-01-25 Darin Adler <[email protected]>
215

316
Add a new separate LChar.h header file, to be used after we remove Unicode.h

Source/WTF/wtf/text/StringImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ PassRef<StringImpl> StringImpl::replace(unsigned position, unsigned lengthToRepl
14891489
for (unsigned i = 0; i < length() - position - lengthToReplace; ++i)
14901490
data[i + position + lengthToInsert] = m_data8[i + position + lengthToReplace];
14911491
} else {
1492-
memcpy(data + position + lengthToInsert, characters() + position + lengthToReplace,
1492+
memcpy(data + position + lengthToInsert, characters16() + position + lengthToReplace,
14931493
(length() - position - lengthToReplace) * sizeof(UChar));
14941494
}
14951495
return newImpl;

0 commit comments

Comments
 (0)