Changeset 90873 in webkit
- Timestamp:
- Jul 12, 2011 5:24:03 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90872 r90873 1 2011-07-12 Pratik Solanki <psolanki@apple.com> 2 3 Get webkit to compile with USE(CFNETWORK) enabled on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=63674 5 6 Reviewed by David Kilzer. 7 8 Changes to ResourceHandle class to get it to compile with USE(CFNETWORK). 9 10 No new tests because no change in functionality and option is not enabled on Mac. 11 12 * platform/network/ResourceHandle.h: 13 * platform/network/ResourceHandleInternal.h: 14 * platform/network/cf/ResourceHandleCFNet.cpp: 15 (WebCore::didReceiveResponse): 16 (WebCore::ResourceHandleInternal::~ResourceHandleInternal): 17 (WebCore::ResourceHandle::start): 18 (WebCore::WebCoreSynchronousLoaderClient::willSendRequest): Call adjustMIMETypeIfNecessary 19 on Mac. Also port over fix for <rdar://problem/6901522> added in r43993 which forces the 20 MIME type to text/html if the request is annotated with a "ForceHTMLMIMEType" property. 21 1 22 2011-07-12 James Robinson <jamesr@chromium.org> 2 23 -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r90834 r90873 235 235 virtual void derefAuthenticationClient() { deref(); } 236 236 237 #if PLATFORM(MAC) 237 #if PLATFORM(MAC) && !USE(CFNETWORK) 238 238 void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff); 239 239 #elif USE(CF) -
trunk/Source/WebCore/platform/network/ResourceHandleInternal.h
r83587 r90873 156 156 #if USE(CFNETWORK) 157 157 RetainPtr<CFURLConnectionRef> m_connection; 158 #elif PLATFORM(MAC) 158 #endif 159 #if PLATFORM(MAC) && !USE(CFNETWORK) 159 160 RetainPtr<NSURLConnection> m_connection; 160 161 RetainPtr<WebCoreResourceHandleAsDelegate> m_delegate; 161 162 RetainPtr<id> m_proxy; 163 #endif 164 #if PLATFORM(MAC) 162 165 bool m_startWhenScheduled; 163 166 bool m_needsSiteSpecificQuirks; -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r90834 r90873 206 206 return; 207 207 208 #if PLATFORM(MAC) 209 // Avoid MIME type sniffing if the response comes back as 304 Not Modified. 210 CFHTTPMessageRef msg = wkGetCFURLResponseHTTPResponse(cfResponse); 211 int statusCode = msg ? CFHTTPMessageGetResponseStatusCode(msg) : 0; 212 213 if (statusCode != 304) 214 adjustMIMETypeIfNecessary(cfResponse); 215 216 if (_CFURLRequestCopyProtocolPropertyForKey(handle->firstRequest().cfURLRequest(), CFSTR("ForceHTMLMIMEType"))) 217 wkSetCFURLResponseMIMEType(cfResponse, CFSTR("text/html")); 218 #else 208 219 if (!CFURLResponseGetMIMEType(cfResponse)) { 209 220 // We should never be applying the default MIMEType if we told the networking layer to do content sniffing for handle. … … 211 222 setDefaultMIMEType(cfResponse); 212 223 } 224 #endif 213 225 214 226 handle->client()->didReceiveResponse(handle, cfResponse); … … 339 351 { 340 352 if (m_connection) { 341 LOG(Network, "CFNet - Cancelling connection %p (%s)", m_connection , m_firstRequest.url().string().utf8().data());353 LOG(Network, "CFNet - Cancelling connection %p (%s)", m_connection.get(), m_firstRequest.url().string().utf8().data()); 342 354 CFURLConnectionCancel(m_connection.get()); 343 355 } … … 470 482 createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff); 471 483 484 #if PLATFORM(WIN) 472 485 CFURLConnectionScheduleWithCurrentMessageQueue(d->m_connection.get()); 486 #else 487 CFURLConnectionScheduleWithRunLoop(d->m_connection.get(), CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 488 #endif 473 489 CFURLConnectionScheduleDownloadWithRunLoop(d->m_connection.get(), loaderRunLoop(), kCFRunLoopDefaultMode); 474 490 CFURLConnectionStart(d->m_connection.get()); 475 491 476 LOG(Network, "CFNet - Starting URL %s (handle=%p, conn=%p)", firstRequest().url().string().utf8().data(), this, d->m_connection );492 LOG(Network, "CFNet - Starting URL %s (handle=%p, conn=%p)", firstRequest().url().string().utf8().data(), this, d->m_connection.get()); 477 493 478 494 return true; … … 829 845 m_error = cfError.get(); 830 846 m_isDone = true; 831 request = 0; 847 CFURLRequestRef nullRequest = 0; 848 request = nullRequest; 832 849 return; 833 850 }
Note: See TracChangeset
for help on using the changeset viewer.