Atomicize frequently identical ResourceResponse string members.
[WebKit-https.git] / Source / WebCore / platform / network / cf / ResourceResponseCFNet.cpp
index 335f72fd2e6e74066bbf6967017a0c9215173e26..42aeee8d21a710fef17619e18fbc548e5c8c8f15 100644 (file)
@@ -52,7 +52,7 @@ CFURLResponseRef ResourceResponse::cfURLResponse() const
 
         // FIXME: This creates a very incomplete CFURLResponse, which does not even have a status code.
 
-        m_cfResponse = adoptCF(CFURLResponseCreate(0, url.get(), m_mimeType.createCFString().get(), m_expectedContentLength, m_textEncodingName.createCFString().get(), kCFURLCacheStorageAllowed));
+        m_cfResponse = adoptCF(CFURLResponseCreate(0, url.get(), m_mimeType.string().createCFString().get(), m_expectedContentLength, m_textEncodingName.string().createCFString().get(), kCFURLCacheStorageAllowed));
     }
 
     return m_cfResponse.get();
@@ -75,7 +75,7 @@ void ResourceResponse::platformLazyInit(InitLevel initLevel)
         // Workaround for <rdar://problem/8757088>, can be removed once that is fixed.
         unsigned textEncodingNameLength = m_textEncodingName.length();
         if (textEncodingNameLength >= 2 && m_textEncodingName[0U] == '"' && m_textEncodingName[textEncodingNameLength - 1] == '"')
-            m_textEncodingName = m_textEncodingName.substring(1, textEncodingNameLength - 2);
+            m_textEncodingName = m_textEncodingName.string().substring(1, textEncodingNameLength - 2);
 
         CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(m_cfResponse.get());
         if (httpResponse) {