Use ASCIILiteral in some more places
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Sep 2016 14:52:33 +0000 (14:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Sep 2016 14:52:33 +0000 (14:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161557

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-03
Reviewed by Darin Adler.

Source/JavaScriptCore:

* runtime/TypeSet.h:
(JSC::StructureShape::setConstructorName):

Source/WebCore:

* Modules/indexeddb/IDBDatabaseException.cpp:
(WebCore::IDBDatabaseException::getErrorName):
(WebCore::IDBDatabaseException::getErrorDescription):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::binaryType):
* css/FontFace.cpp:
(WebCore::FontFace::stretch):
(WebCore::FontFace::unicodeRange):
(WebCore::FontFace::featureSettings):
* html/canvas/WebGLRenderingContextBase.cpp:
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::initiatorFor):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::Attributes::parseEncodingType):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::toRawString):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::CGImageToDataURL):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageDataToDataURL):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::filenameExtension):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/TypeSet.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseException.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/parser/HTMLPreloadScanner.cpp
Source/WebCore/loader/FormSubmission.cpp
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/svg/graphics/SVGImage.cpp

index 1e07638..a0ae5f8 100644 (file)
@@ -1,3 +1,13 @@
+2016-09-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Use ASCIILiteral in some more places
+        https://bugs.webkit.org/show_bug.cgi?id=161557
+
+        Reviewed by Darin Adler.
+
+        * runtime/TypeSet.h:
+        (JSC::StructureShape::setConstructorName):
+
 2016-09-01  Michael Saboff  <msaboff@apple.com>
 
         Import Chakra tests to JSC
index fefbe08..a7b0af6 100644 (file)
@@ -62,7 +62,7 @@ public:
     String stringRepresentation();
     String toJSONString() const;
     Ref<Inspector::Protocol::Runtime::StructureDescription> inspectorRepresentation();
-    void setConstructorName(String name) { m_constructorName = (name.isEmpty() ? "Object" : name); }
+    void setConstructorName(String name) { m_constructorName = (name.isEmpty() ? ASCIILiteral("Object") : name); }
     String constructorName() { return m_constructorName; }
     void setProto(PassRefPtr<StructureShape> shape) { m_proto = shape; }
     void enterDictionaryMode();
index c7f17ba..8eadd6b 100644 (file)
@@ -1,3 +1,33 @@
+2016-09-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Use ASCIILiteral in some more places
+        https://bugs.webkit.org/show_bug.cgi?id=161557
+
+        Reviewed by Darin Adler.
+
+        * Modules/indexeddb/IDBDatabaseException.cpp:
+        (WebCore::IDBDatabaseException::getErrorName):
+        (WebCore::IDBDatabaseException::getErrorDescription):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::binaryType):
+        * css/FontFace.cpp:
+        (WebCore::FontFace::stretch):
+        (WebCore::FontFace::unicodeRange):
+        (WebCore::FontFace::featureSettings):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        * html/parser/HTMLPreloadScanner.cpp:
+        (WebCore::TokenPreloadScanner::initiatorFor):
+        * loader/FormSubmission.cpp:
+        (WebCore::FormSubmission::Attributes::parseEncodingType):
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::toRawString):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::CGImageToDataURL):
+        (WebCore::ImageBuffer::toDataURL):
+        (WebCore::ImageDataToDataURL):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::filenameExtension):
+
 2016-09-03  Chris Dumez  <cdumez@apple.com>
 
         Object.preventExtensions(window) should throw a TypeError
index 5deb01f..be9bcec 100644 (file)
@@ -91,7 +91,7 @@ String IDBDatabaseException::getErrorName(ExceptionCode ec)
     const IDBDatabaseExceptionNameDescription* entry = getErrorEntry(ec);
     ASSERT(entry);
     if (!entry)
-        return "UnknownError";
+        return ASCIILiteral("UnknownError");
 
     return entry->name;
 }
@@ -101,7 +101,7 @@ String IDBDatabaseException::getErrorDescription(ExceptionCode ec)
     const IDBDatabaseExceptionNameDescription* entry = getErrorEntry(ec);
     ASSERT(entry);
     if (!entry)
-        return "Unknown error.";
+        return ASCIILiteral("Unknown error.");
 
     return entry->description;
 }
index 8b97bbc..aeea27f 100644 (file)
@@ -453,9 +453,9 @@ String WebSocket::binaryType() const
 {
     switch (m_binaryType) {
     case BinaryTypeBlob:
-        return "blob";
+        return ASCIILiteral("blob");
     case BinaryTypeArrayBuffer:
-        return "arraybuffer";
+        return ASCIILiteral("arraybuffer");
     }
     ASSERT_NOT_REACHED();
     return String();
index ae6f5b3..3e6de64 100644 (file)
@@ -316,14 +316,14 @@ String FontFace::weight() const
 
 String FontFace::stretch() const
 {
-    return "normal";
+    return ASCIILiteral("normal");
 }
 
 String FontFace::unicodeRange() const
 {
     const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     if (!m_backing->ranges().size())
-        return "U+0-10FFFF";
+        return ASCIILiteral("U+0-10FFFF");
     RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
     for (auto& range : m_backing->ranges())
         values->append(CSSUnicodeRangeValue::create(range.from, range.to));
@@ -340,7 +340,7 @@ String FontFace::featureSettings() const
 {
     const_cast<CSSFontFace&>(m_backing.get()).updateStyleIfNeeded();
     if (!m_backing->featureSettings().size())
-        return "normal";
+        return ASCIILiteral("normal");
     RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
     for (auto& feature : m_backing->featureSettings())
         list->append(CSSFontFeatureValue::create(FontFeatureTag(feature.tag()), feature.value()));
index e63d561..a0503c4 100644 (file)
@@ -4873,17 +4873,17 @@ namespace {
     {
         switch (error) {
         case GraphicsContext3D::INVALID_ENUM:
-            return "INVALID_ENUM";
+            return ASCIILiteral("INVALID_ENUM");
         case GraphicsContext3D::INVALID_VALUE:
-            return "INVALID_VALUE";
+            return ASCIILiteral("INVALID_VALUE");
         case GraphicsContext3D::INVALID_OPERATION:
-            return "INVALID_OPERATION";
+            return ASCIILiteral("INVALID_OPERATION");
         case GraphicsContext3D::OUT_OF_MEMORY:
-            return "OUT_OF_MEMORY";
+            return ASCIILiteral("OUT_OF_MEMORY");
         case GraphicsContext3D::INVALID_FRAMEBUFFER_OPERATION:
-            return "INVALID_FRAMEBUFFER_OPERATION";
+            return ASCIILiteral("INVALID_FRAMEBUFFER_OPERATION");
         case GraphicsContext3D::CONTEXT_LOST_WEBGL:
-            return "CONTEXT_LOST_WEBGL";
+            return ASCIILiteral("CONTEXT_LOST_WEBGL");
         default:
             return String::format("WebGL ERROR(%04x)", error);
         }
index ea15de0..067e8ec 100644 (file)
@@ -74,13 +74,13 @@ String TokenPreloadScanner::initiatorFor(TagId tagId)
     switch (tagId) {
     case TagId::Source:
     case TagId::Img:
-        return "img";
+        return ASCIILiteral("img");
     case TagId::Input:
-        return "input";
+        return ASCIILiteral("input");
     case TagId::Link:
-        return "link";
+        return ASCIILiteral("link");
     case TagId::Script:
-        return "script";
+        return ASCIILiteral("script");
     case TagId::Unknown:
     case TagId::Style:
     case TagId::Base:
@@ -88,10 +88,10 @@ String TokenPreloadScanner::initiatorFor(TagId tagId)
     case TagId::Meta:
     case TagId::Picture:
         ASSERT_NOT_REACHED();
-        return "unknown";
+        return ASCIILiteral("unknown");
     }
     ASSERT_NOT_REACHED();
-    return "unknown";
+    return ASCIILiteral("unknown");
 }
 
 class TokenPreloadScanner::StartTagScanner {
index f9bbde7..20aaf4c 100644 (file)
@@ -92,10 +92,10 @@ void FormSubmission::Attributes::parseAction(const String& action)
 String FormSubmission::Attributes::parseEncodingType(const String& type)
 {
     if (equalLettersIgnoringASCIICase(type, "multipart/form-data"))
-        return "multipart/form-data";
+        return ASCIILiteral("multipart/form-data");
     if (equalLettersIgnoringASCIICase(type, "text/plain"))
-        return "text/plain";
-    return "application/x-www-form-urlencoded";
+        return ASCIILiteral("text/plain");
+    return ASCIILiteral("application/x-www-form-urlencoded");
 }
 
 void FormSubmission::Attributes::updateEncodingType(const String& type)
index 989d938..b440f1d 100644 (file)
@@ -465,7 +465,7 @@ String SecurityOrigin::toString() const
 String SecurityOrigin::toRawString() const
 {
     if (m_protocol == "file")
-        return "file://";
+        return ASCIILiteral("file://");
 
     StringBuilder result;
     result.reserveCapacity(m_protocol.length() + m_host.length() + 10);
index 5e34bc0..94d1076 100644 (file)
@@ -490,7 +490,7 @@ static String CGImageToDataURL(CGImageRef image, const String& mimeType, const d
 
     RetainPtr<CFMutableDataRef> data = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
     if (!CGImageEncodeToData(image, uti.get(), quality, data.get()))
-        return "data:,";
+        return ASCIILiteral("data:,");
 
     Vector<char> base64Data;
     base64Encode(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()), base64Data);
@@ -515,12 +515,12 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality, Coo
         // JPEGs don't have an alpha channel, so we have to manually composite on top of black.
         premultipliedData = getPremultipliedImageData(IntRect(IntPoint(0, 0), logicalSize()));
         if (!premultipliedData)
-            return "data:,";
+            return ASCIILiteral("data:,");
 
         RetainPtr<CGDataProviderRef> dataProvider;
         dataProvider = adoptCF(CGDataProviderCreateWithData(0, premultipliedData->data(), 4 * logicalSize().width() * logicalSize().height(), 0));
         if (!dataProvider)
-            return "data:,";
+            return ASCIILiteral("data:,");
 
         image = adoptCF(CGImageCreate(logicalSize().width(), logicalSize().height(), 8, 32, 4 * logicalSize().width(),
                                     sRGBColorSpaceRef(), kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast,
@@ -556,7 +556,7 @@ String ImageDataToDataURL(const ImageData& source, const String& mimeType, const
         // JPEGs don't have an alpha channel, so we have to manually composite on top of black.
         size_t size = 4 * source.width() * source.height();
         if (!premultipliedData.tryReserveCapacity(size))
-            return "data:,";
+            return ASCIILiteral("data:,");
 
         premultipliedData.resize(size);
         unsigned char *buffer = premultipliedData.data();
@@ -580,7 +580,7 @@ String ImageDataToDataURL(const ImageData& source, const String& mimeType, const
     RetainPtr<CGDataProviderRef> dataProvider;
     dataProvider = adoptCF(CGDataProviderCreateWithData(0, data, 4 * source.width() * source.height(), 0));
     if (!dataProvider)
-        return "data:,";
+        return ASCIILiteral("data:,");
 
     RetainPtr<CGImageRef> image;
     image = adoptCF(CGImageCreate(source.width(), source.height(), 8, 32, 4 * source.width(),
index 850f931..844d1aa 100644 (file)
@@ -422,7 +422,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
 
 String SVGImage::filenameExtension() const
 {
-    return "svg";
+    return ASCIILiteral("svg");
 }
 
 bool isInSVGImage(const Element* element)