Changeset 86416 in webkit
- Timestamp:
- May 12, 2011 11:23:10 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86415 r86416 1 2011-05-12 Pratik Solanki <psolanki@apple.com> 2 3 Reviewed by Antti Koivisto. 4 5 Part of WebCore should use CFNetwork-based loader on Mac 6 https://bugs.webkit.org/show_bug.cgi?id=51836 7 8 Fixes for warnings and other minor cleanups when we enable USE_CFNETWORK on Mac. 9 10 * platform/network/cf/ResourceErrorCF.cpp: 11 (WebCore::ResourceError::cfStreamError): 12 * platform/network/cf/ResourceHandleCFNet.cpp: 13 (WebCore::allowsAnyHTTPSCertificateHosts): 14 (WebCore::clientCerts): 15 (WebCore::willSendRequest): 16 (WebCore::didReceiveResponse): 17 (WebCore::didReceiveData): 18 (WebCore::didSendBodyData): 19 (WebCore::shouldUseCredentialStorageCallback): 20 (WebCore::didFinishLoading): 21 (WebCore::didFail): 22 (WebCore::didReceiveChallenge): 23 (WebCore::makeFinalRequest): 24 (WebCore::ResourceHandle::willLoadFromCache): 25 1 26 2011-05-12 Pratik Solanki <psolanki@apple.com> 2 27 -
trunk/Source/WebCore/platform/network/cf/ResourceErrorCF.cpp
r82146 r86416 197 197 else if (m_domain == "NSOSStatusErrorDomain") 198 198 result.domain = kCFStreamErrorDomainMacOSStatus; 199 else 199 else { 200 result.domain = kCFStreamErrorDomainCustom; 200 201 ASSERT_NOT_REACHED(); 202 } 201 203 202 204 return result; -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r86415 r86416 107 107 static HashSet<String>& allowsAnyHTTPSCertificateHosts() 108 108 { 109 static HashSet<String> hosts; 110 109 DEFINE_STATIC_LOCAL(HashSet<String>, hosts, ()); 111 110 return hosts; 112 111 } … … 114 113 static HashMap<String, RetainPtr<CFDataRef> >& clientCerts() 115 114 { 116 static HashMap<String, RetainPtr<CFDataRef> > certs; 115 typedef HashMap<String, RetainPtr<CFDataRef> > CertsMap; 116 DEFINE_STATIC_LOCAL(CertsMap, certs, ()); 117 117 return certs; 118 118 } … … 130 130 } 131 131 132 CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfRequest, CFURLResponseRef cfRedirectResponse, const void* clientInfo) 133 { 132 static CFURLRequestRef willSendRequest(CFURLConnectionRef conn, CFURLRequestRef cfRequest, CFURLResponseRef cfRedirectResponse, const void* clientInfo) 133 { 134 #if LOG_DISABLED 135 UNUSED_PARAM(conn); 136 #endif 134 137 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 135 138 … … 185 188 } 186 189 187 void didReceiveResponse(CFURLConnectionRef conn, CFURLResponseRef cfResponse, const void* clientInfo) 188 { 190 static void didReceiveResponse(CFURLConnectionRef conn, CFURLResponseRef cfResponse, const void* clientInfo) 191 { 192 #if LOG_DISABLED 193 UNUSED_PARAM(conn); 194 #endif 189 195 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 190 196 … … 203 209 } 204 210 205 void didReceiveData(CFURLConnectionRef conn, CFDataRef data, CFIndex originalLength, const void* clientInfo) 206 { 211 static void didReceiveData(CFURLConnectionRef conn, CFDataRef data, CFIndex originalLength, const void* clientInfo) 212 { 213 #if LOG_DISABLED 214 UNUSED_PARAM(conn); 215 #endif 207 216 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 208 217 const UInt8* bytes = CFDataGetBytePtr(data); 209 218 CFIndex length = CFDataGetLength(data); 210 219 211 LOG(Network, "CFNet - didReceiveData(conn=%p, handle=%p, bytes=% d) (%s)", conn, handle, length, handle->firstRequest().url().string().utf8().data());220 LOG(Network, "CFNet - didReceiveData(conn=%p, handle=%p, bytes=%ld) (%s)", conn, handle, length, handle->firstRequest().url().string().utf8().data()); 212 221 213 222 if (handle->client()) … … 215 224 } 216 225 217 static void didSendBodyData(CFURLConnectionRef conn, CFIndex bytesWritten, CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite, const void *clientInfo)226 static void didSendBodyData(CFURLConnectionRef, CFIndex, CFIndex totalBytesWritten, CFIndex totalBytesExpectedToWrite, const void *clientInfo) 218 227 { 219 228 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); … … 225 234 static Boolean shouldUseCredentialStorageCallback(CFURLConnectionRef conn, const void* clientInfo) 226 235 { 236 #if LOG_DISABLED 237 UNUSED_PARAM(conn); 238 #endif 227 239 ResourceHandle* handle = const_cast<ResourceHandle*>(static_cast<const ResourceHandle*>(clientInfo)); 228 240 … … 235 247 } 236 248 237 void didFinishLoading(CFURLConnectionRef conn, const void* clientInfo) 238 { 249 static void didFinishLoading(CFURLConnectionRef conn, const void* clientInfo) 250 { 251 #if LOG_DISABLED 252 UNUSED_PARAM(conn); 253 #endif 239 254 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 240 255 … … 245 260 } 246 261 247 void didFail(CFURLConnectionRef conn, CFErrorRef error, const void* clientInfo) 248 { 262 static void didFail(CFURLConnectionRef conn, CFErrorRef error, const void* clientInfo) 263 { 264 #if LOG_DISABLED 265 UNUSED_PARAM(conn); 266 #endif 249 267 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 250 268 … … 284 302 } 285 303 286 void didReceiveChallenge(CFURLConnectionRef conn, CFURLAuthChallengeRef challenge, const void* clientInfo) 287 { 304 static void didReceiveChallenge(CFURLConnectionRef conn, CFURLAuthChallengeRef challenge, const void* clientInfo) 305 { 306 #if LOG_DISABLED 307 UNUSED_PARAM(conn); 308 #endif 288 309 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 289 310 ASSERT(handle); … … 293 314 } 294 315 295 void addHeadersFromHashMap(CFMutableURLRequestRef request, const HTTPHeaderMap& requestHeaders)296 {297 if (!requestHeaders.size())298 return;299 300 HTTPHeaderMap::const_iterator end = requestHeaders.end();301 for (HTTPHeaderMap::const_iterator it = requestHeaders.begin(); it != end; ++it) {302 CFStringRef key = it->first.createCFString();303 CFStringRef value = it->second.createCFString();304 CFURLRequestSetHTTPHeaderFieldValue(request, key, value);305 CFRelease(key);306 CFRelease(value);307 }308 }309 310 316 ResourceHandleInternal::~ResourceHandleInternal() 311 317 { … … 319 325 { 320 326 LOG(Network, "CFNet - Destroying job %p (%s)", this, d->m_firstRequest.url().string().utf8().data()); 321 }322 323 CFArrayRef arrayFromFormData(const FormData& d)324 {325 size_t size = d.elements().size();326 CFMutableArrayRef a = CFArrayCreateMutable(0, d.elements().size(), &kCFTypeArrayCallBacks);327 for (size_t i = 0; i < size; ++i) {328 const FormDataElement& e = d.elements()[i];329 if (e.m_type == FormDataElement::data) {330 CFDataRef data = CFDataCreate(0, (const UInt8*)e.m_data.data(), e.m_data.size());331 CFArrayAppendValue(a, data);332 CFRelease(data);333 } else {334 ASSERT(e.m_type == FormDataElement::encodedFile);335 CFStringRef filename = e.m_filename.createCFString();336 CFArrayAppendValue(a, filename);337 CFRelease(filename);338 }339 }340 return a;341 327 } 342 328 … … 365 351 if (!sslProps) 366 352 sslProps.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); 353 #if PLATFORM(WIN) 367 354 wkSetClientCertificateInSSLProperties(sslProps.get(), (clientCert->second).get()); 355 #endif 368 356 } 369 357 … … 715 703 } 716 704 717 bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)705 bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*) 718 706 { 719 707 request.setCachePolicy(ReturnCacheDataDontLoad);
Note: See TracChangeset
for help on using the changeset viewer.