Changeset 170574 in webkit
- Timestamp:
- Jun 29, 2014 1:59:03 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r170573 r170574 1 2014-06-29 Pratik Solanki <pratik.solanki@gmail.com> 2 3 Refactor ResourceRequest into Cocoa and iOS specific files 4 https://bugs.webkit.org/show_bug.cgi?id=134430 5 6 Reviewed by Andreas Kling. 7 8 No new tests because no functional changes. 9 10 * WebCore.xcodeproj/project.pbxproj: 11 * platform/network/cf/ResourceRequestCFNet.cpp: 12 (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted. 13 * platform/network/cocoa/ResourceRequestCocoa.mm: Copied from Source/WebCore/platform/network/mac/ResourceRequestMac.mm. 14 (WebCore::ResourceRequest::nsURLRequest): 15 (WebCore::ResourceRequest::cfURLRequest): 16 (WebCore::ResourceRequest::doUpdateResourceRequest): 17 (WebCore::ResourceRequest::doUpdateResourceHTTPBody): 18 (WebCore::ResourceRequest::doUpdatePlatformRequest): 19 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): 20 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): 21 (WebCore::ResourceRequest::applyWebArchiveHackForMail): 22 (WebCore::ResourceRequest::setStorageSession): 23 * platform/network/ios/ResourceRequestIOS.mm: Added. 24 (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks): 25 (WebCore::ResourceRequest::ResourceRequest): 26 (WebCore::ResourceRequest::updateNSURLRequest): 27 * platform/network/mac/ResourceRequestMac.mm: 28 (WebCore::initQuickLookResourceCachingQuirks): 29 (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks): 30 (WebCore::ResourceRequest::ResourceRequest): 31 (WebCore::ResourceRequest::updateNSURLRequest): 32 (WebCore::ResourceRequest::applyWebArchiveHackForMail): 33 (WebCore::ResourceRequest::nsURLRequest): Deleted. 34 (WebCore::ResourceRequest::cfURLRequest): Deleted. 35 (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted. 36 (WebCore::ResourceRequest::doUpdateResourceHTTPBody): Deleted. 37 (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted. 38 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Deleted. 39 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted. 40 (WebCore::ResourceRequest::setStorageSession): Deleted. 41 1 42 2014-06-29 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 43 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r170557 r170574 2443 2443 7E66E23416D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */; }; 2444 2444 7E66E23417E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E66E23217E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h */; }; 2445 7E7DE1FD195CEF260035363B /* ResourceRequestCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E7DE1FC195CEF260035363B /* ResourceRequestCocoa.mm */; }; 2446 7E7DE202195CEFCD0035363B /* ResourceRequestIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E7DE201195CEFCD0035363B /* ResourceRequestIOS.mm */; }; 2445 2447 7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; }; 2446 2448 7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9593 9595 7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLCompressedTextureATC.h; path = canvas/WebGLCompressedTextureATC.h; sourceTree = "<group>"; }; 9594 9596 7E66E23217E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLCompressedTexturePVRTC.h; path = canvas/WebGLCompressedTexturePVRTC.h; sourceTree = "<group>"; }; 9597 7E7DE1FC195CEF260035363B /* ResourceRequestCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ResourceRequestCocoa.mm; path = cocoa/ResourceRequestCocoa.mm; sourceTree = "<group>"; }; 9598 7E7DE201195CEFCD0035363B /* ResourceRequestIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceRequestIOS.mm; sourceTree = "<group>"; }; 9595 9599 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFocusAllowedIndicator.cpp; sourceTree = "<group>"; }; 9596 9600 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFocusAllowedIndicator.h; sourceTree = "<group>"; }; … … 15707 15711 A10DBF4618F92317000D70C6 /* QuickLookHandleClient.h */, 15708 15712 7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */, 15713 7E7DE201195CEFCD0035363B /* ResourceRequestIOS.mm */, 15709 15714 44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */, 15710 15715 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */, … … 16279 16284 isa = PBXGroup; 16280 16285 children = ( 16286 7E7DE1FE195CEF2D0035363B /* cocoa */, 16281 16287 B2F34FE70E82F81700F627CD /* cf */, 16282 16288 4497D58C0EBA854F00A10552 /* ios */, … … 16724 16730 ); 16725 16731 path = icu; 16732 sourceTree = "<group>"; 16733 }; 16734 7E7DE1FE195CEF2D0035363B /* cocoa */ = { 16735 isa = PBXGroup; 16736 children = ( 16737 7E7DE1FC195CEF260035363B /* ResourceRequestCocoa.mm */, 16738 ); 16739 name = cocoa; 16726 16740 sourceTree = "<group>"; 16727 16741 }; … … 28266 28280 1AE2AA970A1CDD2D00B42B25 /* JSHTMLImageElement.cpp in Sources */, 28267 28281 A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */, 28282 7E7DE202195CEFCD0035363B /* ResourceRequestIOS.mm in Sources */, 28268 28283 BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */, 28269 28284 A6148A7812E41E3B0044A784 /* JSHTMLKeygenElement.cpp in Sources */, … … 28825 28840 E44613E30CD6819F00FADA75 /* MediaPlayer.cpp in Sources */, 28826 28841 072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */, 28842 7E7DE1FD195CEF260035363B /* ResourceRequestCocoa.mm in Sources */, 28827 28843 DF9AFD7313FC31D80015FEB7 /* MediaPlayerPrivateAVFoundationObjC.mm in Sources */, 28828 28844 CDC8B5A2180463470016E685 /* MediaPlayerPrivateMediaSourceAVFObjC.mm in Sources */, -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
r170503 r170574 348 348 } 349 349 350 #if PLATFORM(MAC)351 void ResourceRequest::applyWebArchiveHackForMail()352 {353 // Hack because Mail checks for this property to detect data / archive loads354 _CFURLRequestSetProtocolProperty(cfURLRequest(DoNotUpdateHTTPBody), CFSTR("WebDataRequest"), CFSTR(""));355 }356 #endif357 358 350 #endif // USE(CFNETWORK) 359 351 -
trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm
r170573 r170574 1 1 /* 2 * Copyright (C) 20 06, 2007, 2008Apple, Inc. All rights reserved.2 * Copyright (C) 2014 Apple, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 26 #import "config.h" 27 27 #import "ResourceRequest.h" 28 29 #if PLATFORM(COCOA) 28 30 29 31 #import "FormDataStreamMac.h" … … 32 34 #import "RuntimeApplicationChecks.h" 33 35 #import "WebCoreSystemInterface.h" 36 37 #import <Foundation/Foundation.h> 34 38 #import <wtf/text/CString.h> 35 36 #import <Foundation/Foundation.h>37 38 39 39 40 @interface NSURLRequest (WebNSURLRequestDetails) … … 53 54 { 54 55 updatePlatformRequest(bodyPolicy); 55 56 56 return [[m_nsRequest.get() retain] autorelease]; 57 57 } 58 58 59 #if USE(CFNETWORK) 60 61 ResourceRequest::ResourceRequest(NSURLRequest *nsRequest) 62 : ResourceRequestBase() 63 #if PLATFORM(IOS) 64 , m_mainResourceRequest(false) 65 #endif 66 , m_cfRequest([nsRequest _CFURLRequest]) 67 , m_nsRequest(nsRequest) 68 { 69 } 70 71 void ResourceRequest::updateNSURLRequest() 72 { 73 #if PLATFORM(IOS) 74 // There is client code that extends NSURLRequest and expects to get back, in the delegate 75 // callbacks, an object of the same type that they passed into WebKit. To keep then running, we 76 // create an object of the same type and return that. See <rdar://9843582>. 77 // Also, developers really really want an NSMutableURLRequest so try to create an 78 // NSMutableURLRequest instead of NSURLRequest. 79 static Class nsURLRequestClass = [NSURLRequest class]; 80 static Class nsMutableURLRequestClass = [NSMutableURLRequest class]; 81 Class requestClass = [m_nsRequest.get() class]; 82 83 if (!requestClass || requestClass == nsURLRequestClass) 84 requestClass = nsMutableURLRequestClass; 85 86 if (m_cfRequest) 87 m_nsRequest = adoptNS([[requestClass alloc] _initWithCFURLRequest:m_cfRequest.get()]); 88 #else 89 if (m_cfRequest) 90 m_nsRequest = adoptNS([[NSURLRequest alloc] _initWithCFURLRequest:m_cfRequest.get()]); 91 #endif 92 } 93 94 #else 59 #if !USE(CFNETWORK) 95 60 96 61 CFURLRequestRef ResourceRequest::cfURLRequest(HTTPBodyUpdatePolicy bodyPolicy) const … … 105 70 m_timeoutInterval = [m_nsRequest.get() timeoutInterval]; 106 71 m_firstPartyForCookies = [m_nsRequest.get() mainDocumentURL]; 107 72 108 73 if (NSString* method = [m_nsRequest.get() HTTPMethod]) 109 74 m_httpMethod = method; … … 158 123 return; 159 124 } 160 125 161 126 NSMutableURLRequest *nsRequest = [m_nsRequest.get() mutableCopy]; 162 127 … … 274 239 m_nsRequest = adoptNS(wkCopyRequestWithStorageSession(storageSession, m_nsRequest.get())); 275 240 } 276 241 277 242 #endif // USE(CFNETWORK) 278 243 279 #if !PLATFORM(IOS)280 static bool initQuickLookResourceCachingQuirks()281 {282 if (applicationIsSafari())283 return false;284 285 NSArray* frameworks = [NSBundle allFrameworks];286 287 if (!frameworks)288 return false;289 290 for (unsigned int i = 0; i < [frameworks count]; i++) {291 NSBundle* bundle = [frameworks objectAtIndex: i];292 const char* bundleID = [[bundle bundleIdentifier] UTF8String];293 if (bundleID && !strcasecmp(bundleID, "com.apple.QuickLookUIFramework"))294 return true;295 }296 return false;297 }298 #endif // !PLATFORM(IOS)299 300 bool ResourceRequest::useQuickLookResourceCachingQuirks()301 {302 #if !PLATFORM(IOS)303 static bool flag = initQuickLookResourceCachingQuirks();304 return flag;305 #else306 return false;307 #endif // !PLATFORM(IOS)308 }309 310 244 } // namespace WebCore 311 245 246 #endif // PLATFORM(COCOA) 247 -
trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm
r170503 r170574 27 27 #import "ResourceRequest.h" 28 28 29 #import "FormDataStreamMac.h" 30 #import "HTTPHeaderNames.h" 31 #import "ResourceRequestCFNet.h" 29 #if PLATFORM(MAC) 30 32 31 #import "RuntimeApplicationChecks.h" 33 #import "WebCoreSystemInterface.h"34 #import <wtf/text/CString.h>35 32 36 33 #import <Foundation/Foundation.h> 37 34 38 39 35 @interface NSURLRequest (WebNSURLRequestDetails) 40 - (NSArray *)contentDispositionEncodingFallbackArray;41 + (void)setDefaultTimeoutInterval:(NSTimeInterval)seconds;42 36 - (CFURLRequestRef)_CFURLRequest; 43 37 - (id)_initWithCFURLRequest:(CFURLRequestRef)request; 44 38 @end 45 39 46 @interface NSMutableURLRequest (WebMutableNSURLRequestDetails)47 - (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray;48 @end49 50 40 namespace WebCore { 51 41 52 NSURLRequest *ResourceRequest::nsURLRequest(HTTPBodyUpdatePolicy bodyPolicy) const53 {54 updatePlatformRequest(bodyPolicy);55 56 return [[m_nsRequest.get() retain] autorelease];57 }58 59 #if USE(CFNETWORK)60 61 ResourceRequest::ResourceRequest(NSURLRequest *nsRequest)62 : ResourceRequestBase()63 #if PLATFORM(IOS)64 , m_mainResourceRequest(false)65 #endif66 , m_cfRequest([nsRequest _CFURLRequest])67 , m_nsRequest(nsRequest)68 {69 }70 71 void ResourceRequest::updateNSURLRequest()72 {73 #if PLATFORM(IOS)74 // There is client code that extends NSURLRequest and expects to get back, in the delegate75 // callbacks, an object of the same type that they passed into WebKit. To keep then running, we76 // create an object of the same type and return that. See <rdar://9843582>.77 // Also, developers really really want an NSMutableURLRequest so try to create an78 // NSMutableURLRequest instead of NSURLRequest.79 static Class nsURLRequestClass = [NSURLRequest class];80 static Class nsMutableURLRequestClass = [NSMutableURLRequest class];81 Class requestClass = [m_nsRequest.get() class];82 83 if (!requestClass || requestClass == nsURLRequestClass)84 requestClass = nsMutableURLRequestClass;85 86 if (m_cfRequest)87 m_nsRequest = adoptNS([[requestClass alloc] _initWithCFURLRequest:m_cfRequest.get()]);88 #else89 if (m_cfRequest)90 m_nsRequest = adoptNS([[NSURLRequest alloc] _initWithCFURLRequest:m_cfRequest.get()]);91 #endif92 }93 94 #else95 96 CFURLRequestRef ResourceRequest::cfURLRequest(HTTPBodyUpdatePolicy bodyPolicy) const97 {98 return [nsURLRequest(bodyPolicy) _CFURLRequest];99 }100 101 void ResourceRequest::doUpdateResourceRequest()102 {103 m_url = [m_nsRequest.get() URL];104 m_cachePolicy = (ResourceRequestCachePolicy)[m_nsRequest.get() cachePolicy];105 m_timeoutInterval = [m_nsRequest.get() timeoutInterval];106 m_firstPartyForCookies = [m_nsRequest.get() mainDocumentURL];107 108 if (NSString* method = [m_nsRequest.get() HTTPMethod])109 m_httpMethod = method;110 m_allowCookies = [m_nsRequest.get() HTTPShouldHandleCookies];111 112 if (ResourceRequest::resourcePrioritiesEnabled())113 m_priority = toResourceLoadPriority(wkGetHTTPRequestPriority([m_nsRequest.get() _CFURLRequest]));114 115 NSDictionary *headers = [m_nsRequest.get() allHTTPHeaderFields];116 NSEnumerator *e = [headers keyEnumerator];117 NSString *name;118 m_httpHeaderFields.clear();119 while ((name = [e nextObject]))120 m_httpHeaderFields.set(String(name), [headers objectForKey:name]);121 122 m_responseContentDispositionEncodingFallbackArray.clear();123 NSArray *encodingFallbacks = [m_nsRequest.get() contentDispositionEncodingFallbackArray];124 NSUInteger count = [encodingFallbacks count];125 for (NSUInteger i = 0; i < count; ++i) {126 CFStringEncoding encoding = CFStringConvertNSStringEncodingToEncoding([(NSNumber *)[encodingFallbacks objectAtIndex:i] unsignedLongValue]);127 if (encoding != kCFStringEncodingInvalidId)128 m_responseContentDispositionEncodingFallbackArray.append(CFStringConvertEncodingToIANACharSetName(encoding));129 }130 131 #if ENABLE(CACHE_PARTITIONING)132 if (m_nsRequest) {133 NSString* cachePartition = [NSURLProtocol propertyForKey:(NSString *)wkCachePartitionKey() inRequest:m_nsRequest.get()];134 if (cachePartition)135 m_cachePartition = cachePartition;136 }137 #endif138 }139 140 void ResourceRequest::doUpdateResourceHTTPBody()141 {142 if (NSData* bodyData = [m_nsRequest.get() HTTPBody])143 m_httpBody = FormData::create([bodyData bytes], [bodyData length]);144 else if (NSInputStream* bodyStream = [m_nsRequest.get() HTTPBodyStream]) {145 FormData* formData = httpBodyFromStream(bodyStream);146 // There is no FormData object if a client provided a custom data stream.147 // We shouldn't be looking at http body after client callbacks.148 ASSERT(formData);149 if (formData)150 m_httpBody = formData;151 }152 }153 154 void ResourceRequest::doUpdatePlatformRequest()155 {156 if (isNull()) {157 m_nsRequest = nil;158 return;159 }160 161 NSMutableURLRequest *nsRequest = [m_nsRequest.get() mutableCopy];162 163 if (nsRequest)164 [nsRequest setURL:url()];165 else166 nsRequest = [[NSMutableURLRequest alloc] initWithURL:url()];167 168 if (ResourceRequest::httpPipeliningEnabled())169 wkHTTPRequestEnablePipelining([nsRequest _CFURLRequest]);170 171 if (ResourceRequest::resourcePrioritiesEnabled())172 wkSetHTTPRequestPriority([nsRequest _CFURLRequest], toPlatformRequestPriority(m_priority));173 174 [nsRequest setCachePolicy:(NSURLRequestCachePolicy)cachePolicy()];175 wkCFURLRequestAllowAllPostCaching([nsRequest _CFURLRequest]);176 177 double timeoutInterval = ResourceRequestBase::timeoutInterval();178 if (timeoutInterval)179 [nsRequest setTimeoutInterval:timeoutInterval];180 // Otherwise, respect NSURLRequest default timeout.181 182 [nsRequest setMainDocumentURL:firstPartyForCookies()];183 if (!httpMethod().isEmpty())184 [nsRequest setHTTPMethod:httpMethod()];185 [nsRequest setHTTPShouldHandleCookies:allowCookies()];186 187 // Cannot just use setAllHTTPHeaderFields here, because it does not remove headers.188 NSArray *oldHeaderFieldNames = [[nsRequest allHTTPHeaderFields] allKeys];189 for (unsigned i = [oldHeaderFieldNames count]; i != 0; --i)190 [nsRequest setValue:nil forHTTPHeaderField:[oldHeaderFieldNames objectAtIndex:i - 1]];191 for (const auto& header : httpHeaderFields())192 [nsRequest setValue:header.value forHTTPHeaderField:header.key];193 194 NSMutableArray *encodingFallbacks = [NSMutableArray array];195 unsigned count = m_responseContentDispositionEncodingFallbackArray.size();196 for (unsigned i = 0; i != count; ++i) {197 RetainPtr<CFStringRef> encodingName = m_responseContentDispositionEncodingFallbackArray[i].createCFString();198 unsigned long nsEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding(encodingName.get()));199 200 if (nsEncoding != kCFStringEncodingInvalidId)201 [encodingFallbacks addObject:[NSNumber numberWithUnsignedLong:nsEncoding]];202 }203 [nsRequest setContentDispositionEncodingFallbackArray:encodingFallbacks];204 205 #if ENABLE(CACHE_PARTITIONING)206 String partition = cachePartition();207 if (!partition.isNull() && !partition.isEmpty()) {208 NSString *partitionValue = [NSString stringWithUTF8String:partition.utf8().data()];209 [NSURLProtocol setProperty:partitionValue forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest];210 }211 #endif212 213 m_nsRequest = adoptNS(nsRequest);214 }215 216 void ResourceRequest::doUpdatePlatformHTTPBody()217 {218 if (isNull()) {219 ASSERT(!m_nsRequest);220 return;221 }222 223 NSMutableURLRequest *nsRequest = [m_nsRequest.get() mutableCopy];224 225 if (nsRequest)226 [nsRequest setURL:url()];227 else228 nsRequest = [[NSMutableURLRequest alloc] initWithURL:url()];229 230 RefPtr<FormData> formData = httpBody();231 if (formData && !formData->isEmpty())232 WebCore::setHTTPBody(nsRequest, formData);233 234 if (NSInputStream *bodyStream = [nsRequest HTTPBodyStream]) {235 // For streams, provide a Content-Length to avoid using chunked encoding, and to get accurate total length in callbacks.236 NSString *lengthString = [bodyStream propertyForKey:(NSString *)formDataStreamLengthPropertyName()];237 if (lengthString) {238 [nsRequest setValue:lengthString forHTTPHeaderField:@"Content-Length"];239 // Since resource request is already marked updated, we need to keep it up to date too.240 ASSERT(m_resourceRequestUpdated);241 m_httpHeaderFields.set(HTTPHeaderName::ContentLength, lengthString);242 }243 }244 245 m_nsRequest = adoptNS(nsRequest);246 }247 248 void ResourceRequest::updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest)249 {250 RefPtr<FormData> oldHTTPBody = httpBody();251 #if ENABLE(INSPECTOR)252 bool isHiddenFromInspector = hiddenFromInspector();253 #endif254 255 *this = delegateProvidedRequest;256 257 setHTTPBody(oldHTTPBody.release());258 #if ENABLE(INSPECTOR)259 setHiddenFromInspector(isHiddenFromInspector);260 #endif261 }262 263 #if !PLATFORM(IOS)264 void ResourceRequest::applyWebArchiveHackForMail()265 {266 // Hack because Mail checks for this property to detect data / archive loads267 [NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)nsURLRequest(DoNotUpdateHTTPBody)];268 }269 #endif270 271 void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)272 {273 updatePlatformRequest();274 m_nsRequest = adoptNS(wkCopyRequestWithStorageSession(storageSession, m_nsRequest.get()));275 }276 277 #endif // USE(CFNETWORK)278 279 #if !PLATFORM(IOS)280 42 static bool initQuickLookResourceCachingQuirks() 281 43 { … … 296 58 return false; 297 59 } 298 #endif // !PLATFORM(IOS)299 60 300 61 bool ResourceRequest::useQuickLookResourceCachingQuirks() 301 62 { 302 #if !PLATFORM(IOS)303 63 static bool flag = initQuickLookResourceCachingQuirks(); 304 64 return flag; 305 #else306 return false;307 #endif // !PLATFORM(IOS)308 65 } 66 67 #if USE(CFNETWORK) 68 69 ResourceRequest::ResourceRequest(NSURLRequest *nsRequest) 70 : ResourceRequestBase() 71 , m_cfRequest([nsRequest _CFURLRequest]) 72 , m_nsRequest(nsRequest) 73 { 74 } 75 76 void ResourceRequest::updateNSURLRequest() 77 { 78 if (m_cfRequest) 79 m_nsRequest = adoptNS([[NSURLRequest alloc] _initWithCFURLRequest:m_cfRequest.get()]); 80 } 81 82 void ResourceRequest::applyWebArchiveHackForMail() 83 { 84 // Hack because Mail checks for this property to detect data / archive loads 85 _CFURLRequestSetProtocolProperty(cfURLRequest(DoNotUpdateHTTPBody), CFSTR("WebDataRequest"), CFSTR("")); 86 } 87 88 #endif 309 89 310 90 } // namespace WebCore 311 91 92 #endif
Note: See TracChangeset
for help on using the changeset viewer.