[curl] Unreviewed speculative build fix after r170021.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 00:06:09 +0000 (00:06 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 00:06:09 +0000 (00:06 +0000)
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
(WebCore::CurlCacheEntry::parseResponseHeaders):
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::didReceiveHeader):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::getProtectionSpace):
(WebCore::headerCallback):
Use HTTPHeaderName constants.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/curl/CurlCacheEntry.cpp
Source/WebCore/platform/network/curl/CurlDownload.cpp
Source/WebCore/platform/network/curl/ResourceHandleManager.cpp

index 97a5e25..8f1069f 100644 (file)
@@ -1,3 +1,17 @@
+2014-06-18  Alex Christensen  <achristensen@webkit.org>
+
+        [curl] Unreviewed speculative build fix after r170021.
+
+        * platform/network/curl/CurlCacheEntry.cpp:
+        (WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
+        (WebCore::CurlCacheEntry::parseResponseHeaders):
+        * platform/network/curl/CurlDownload.cpp:
+        (WebCore::CurlDownload::didReceiveHeader):
+        * platform/network/curl/ResourceHandleManager.cpp:
+        (WebCore::getProtectionSpace):
+        (WebCore::headerCallback):
+        Use HTTPHeaderName constants.
+
 2014-06-18  Simon Fraser  <simon.fraser@apple.com>
 
         Move the removeNode() tree walking from ScrollingStateNote into ScrollingStateTree
index 8fc769c..540665a 100644 (file)
@@ -184,17 +184,17 @@ void CurlCacheEntry::setResponseFromCachedHeaders(ResourceResponse& response)
 
     // Try to parse expected content length
     long long contentLength = -1;
-    if (!response.httpHeaderField("Content-Length").isNull()) {
+    if (!response.httpHeaderField(HTTPHeaderName::ContentLength).isNull()) {
         bool success = false;
-        long long parsedContentLength = response.httpHeaderField("Content-Length").toInt64(&success);
+        long long parsedContentLength = response.httpHeaderField(HTTPHeaderName::ContentLength).toInt64(&success);
         if (success)
             contentLength = parsedContentLength;
     }
     response.setExpectedContentLength(contentLength); // -1 on parse error or null
 
-    response.setMimeType(extractMIMETypeFromMediaType(response.httpHeaderField("Content-Type")));
-    response.setTextEncodingName(extractCharsetFromMediaType(response.httpHeaderField("Content-Type")));
-    response.setSuggestedFilename(filenameFromHTTPContentDisposition(response.httpHeaderField("Content-Disposition")));
+    response.setMimeType(extractMIMETypeFromMediaType(response.httpHeaderField(HTTPHeaderName::ContentType)));
+    response.setTextEncodingName(extractCharsetFromMediaType(response.httpHeaderField(HTTPHeaderName::ContentType)));
+    response.setSuggestedFilename(filenameFromHTTPContentDisposition(response.httpHeaderField(HTTPHeaderName::ContentDisposition)));
 }
 
 void CurlCacheEntry::didFail()
@@ -332,11 +332,11 @@ bool CurlCacheEntry::parseResponseHeaders(const ResourceResponse& response)
             m_expireDate = 0;
     }
 
-    String etag = response.httpHeaderField("ETag");
+    String etag = response.httpHeaderField(HTTPHeaderName::ETag);
     if (!etag.isNull())
         m_requestHeaders.set(HTTPHeaderName::IfNoneMatch, etag);
 
-    String lastModified = response.httpHeaderField("Last-Modified");
+    String lastModified = response.httpHeaderField(HTTPHeaderName::LastModified);
     if (!lastModified.isNull())
         m_requestHeaders.set(HTTPHeaderName::IfModifiedSince, lastModified);
 
index 244a68f..df79b9d 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "CurlDownload.h"
 
+#include "HTTPHeaderNames.h"
 #include "HTTPParsers.h"
 #include "MainThreadTask.h"
 #include "ResourceHandleManager.h"
@@ -396,9 +397,9 @@ void CurlDownload::didReceiveHeader(const String& header)
             err = curl_easy_getinfo(m_curlHandle, CURLINFO_EFFECTIVE_URL, &url);
             m_response.setURL(URL(ParsedURLString, url));
 
-            m_response.setMimeType(extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")));
-            m_response.setTextEncodingName(extractCharsetFromMediaType(m_response.httpHeaderField("Content-Type")));
-            m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(m_response.httpHeaderField("Content-Disposition")));
+            m_response.setMimeType(extractMIMETypeFromMediaType(m_response.httpHeaderField(HTTPHeaderName::ContentType)));
+            m_response.setTextEncodingName(extractCharsetFromMediaType(m_response.httpHeaderField(HTTPHeaderName::ContentType)));
+            m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(m_response.httpHeaderField(HTTPHeaderName::ContentDisposition)));
 
             callOnMainThread(MainThreadTask(receivedResponseCallback, this));
         }
index 70f2223..54cb4f1 100644 (file)
@@ -42,6 +42,7 @@
 #include "CredentialStorage.h"
 #include "CurlCacheManager.h"
 #include "DataURL.h"
+#include "HTTPHeaderNames.h"
 #include "HTTPParsers.h"
 #include "MIMETypeRegistry.h"
 #include "MultipartHandle.h"
@@ -407,7 +408,7 @@ static bool getProtectionSpace(CURL* h, const ResourceResponse& response, Protec
 
     String realm;
 
-    const String authHeader = response.httpHeaderField("WWW-Authenticate");
+    const String authHeader = response.httpHeaderField(HTTPHeaderName::WWWAuthenticate);
     const String realmString = "realm=";
     int realmPos = authHeader.find(realmString);
     if (realmPos > 0) {
@@ -488,13 +489,13 @@ static size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* data)
         d->m_response.setURL(URL(ParsedURLString, hdr));
 
         d->m_response.setHTTPStatusCode(httpCode);
-        d->m_response.setMimeType(extractMIMETypeFromMediaType(d->m_response.httpHeaderField("Content-Type")).lower());
-        d->m_response.setTextEncodingName(extractCharsetFromMediaType(d->m_response.httpHeaderField("Content-Type")));
-        d->m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(d->m_response.httpHeaderField("Content-Disposition")));
+        d->m_response.setMimeType(extractMIMETypeFromMediaType(d->m_response.httpHeaderField(HTTPHeaderName::ContentType)).lower());
+        d->m_response.setTextEncodingName(extractCharsetFromMediaType(d->m_response.httpHeaderField(HTTPHeaderName::ContentType)));
+        d->m_response.setSuggestedFilename(filenameFromHTTPContentDisposition(d->m_response.httpHeaderField(HTTPHeaderName::ContentDisposition)));
 
         if (d->m_response.isMultipart()) {
             String boundary;
-            bool parsed = MultipartHandle::extractBoundary(d->m_response.httpHeaderField("Content-Type"), boundary);
+            bool parsed = MultipartHandle::extractBoundary(d->m_response.httpHeaderField(HTTPHeaderName::ContentType), boundary);
             if (parsed)
                 d->m_multipartHandle = MultipartHandle::create(job, boundary);
         }
@@ -506,7 +507,7 @@ static size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* data)
 
         // HTTP redirection
         if (isHttpRedirect(httpCode)) {
-            String location = d->m_response.httpHeaderField("location");
+            String location = d->m_response.httpHeaderField(HTTPHeaderName::Location);
             if (!location.isEmpty()) {
                 URL newURL = URL(job->firstRequest().url(), location);