Changeset 287056 in webkit
- Timestamp:
- Dec 14, 2021, 3:48:21 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/PlatformHave.h (modified) (1 diff)
-
Source/WebCore/PAL/ChangeLog (modified) (1 diff)
-
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (modified) (2 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r287019 r287056 1 2021-12-14 Alex Christensen <achristensen@webkit.org> 2 3 Remove properties set by NSURLProtocol on NSURLRequest before serializing 4 https://bugs.webkit.org/show_bug.cgi?id=232332 5 <rdar://79227845> 6 7 Reviewed by Geoff Garen. 8 9 * wtf/PlatformHave.h: 10 1 11 2021-12-14 Darin Adler <darin@apple.com> 2 12 -
trunk/Source/WTF/wtf/PlatformHave.h
r286958 r287056 935 935 || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 80400) 936 936 #define HAVE_RSA_PSS_OID 1 937 #define HAVE_NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES 1 937 938 #endif 938 939 -
trunk/Source/WebCore/PAL/ChangeLog
r287024 r287056 1 2021-12-14 Alex Christensen <achristensen@webkit.org> 2 3 Remove properties set by NSURLProtocol on NSURLRequest before serializing 4 https://bugs.webkit.org/show_bug.cgi?id=232332 5 <rdar://79227845> 6 7 Reviewed by Geoff Garen. 8 9 * pal/spi/cf/CFNetworkSPI.h: 10 1 11 2021-12-14 Andreu Botella <andreu@andreubotella.com> 2 12 -
trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
r285059 r287056 175 175 176 176 @interface NSMutableURLRequest () 177 #if HAVE(NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES) 178 - (void)_removeAllProtocolProperties; 179 #endif 177 180 - (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray; 178 181 - (void)setBoundInterfaceIdentifier:(NSString *)identifier; … … 192 195 193 196 @interface NSURLRequest () 197 #if HAVE(NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES) 198 @property (nonatomic, readonly, nullable, retain) NSDictionary<NSString *, id> *_allProtocolProperties; 199 #endif 194 200 + (NSArray *)allowsSpecificHTTPSCertificateForHost:(NSString *)host; 195 201 + (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host; -
trunk/Source/WebKit/ChangeLog
r287050 r287056 1 2021-12-14 Alex Christensen <achristensen@webkit.org> 2 3 Remove properties set by NSURLProtocol on NSURLRequest before serializing 4 https://bugs.webkit.org/show_bug.cgi?id=232332 5 <rdar://79227845> 6 7 Reviewed by Geoff Garen. 8 9 NSURLRequest encodeWithCoder: encodes the protocol properties, which are not used by WebKit. 10 They exist to be used by NSURLProtocol. Serializing them can serialize a large amount of data, 11 so to be more efficient and hopefully run out of memory less, remove the properties before serializing. 12 13 * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: 14 (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData): 15 1 16 2021-12-14 Jer Noble <jer.noble@apple.com> 2 17 -
trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
r287021 r287056 38 38 #import <WebCore/ResourceRequest.h> 39 39 #import <WebCore/TextRecognitionResult.h> 40 #import <pal/spi/cf/CFNetworkSPI.h> 40 41 #import <pal/spi/cf/CoreTextSPI.h> 41 42 … … 626 627 // We don't send HTTP body over IPC for better performance. 627 628 // Also, it's not always possible to do, as streams can only be created in process that does networking. 628 if ([requestToSerialize HTTPBody] || [requestToSerialize HTTPBodyStream]) { 629 bool hasHTTPBody = [requestToSerialize HTTPBody] || [requestToSerialize HTTPBodyStream]; 630 #if HAVE(NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES) 631 bool hasProtocolProperties = [requestToSerialize _allProtocolProperties]; 632 #else 633 bool hasProtocolProperties = false; 634 #endif 635 636 if (hasHTTPBody || hasProtocolProperties) { 629 637 auto mutableRequest = adoptNS([requestToSerialize mutableCopy]); 630 638 [mutableRequest setHTTPBody:nil]; 631 639 [mutableRequest setHTTPBodyStream:nil]; 640 #if HAVE(NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES) 641 [mutableRequest _removeAllProtocolProperties]; 642 #endif 632 643 requestToSerialize = WTFMove(mutableRequest); 633 644 } -
trunk/Tools/ChangeLog
r287054 r287056 1 2021-12-14 Alex Christensen <achristensen@webkit.org> 2 3 Remove properties set by NSURLProtocol on NSURLRequest before serializing 4 https://bugs.webkit.org/show_bug.cgi?id=232332 5 <rdar://79227845> 6 7 Reviewed by Geoff Garen. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm: 10 (TestWebKitAPI::TEST): 11 1 12 2021-12-14 Jonathan Bedard <jbedard@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadInvalidURLRequest.mm
r285059 r287056 138 138 } 139 139 140 TEST(WebKit, LoadNSURLRequestWithProtocolProperties) 141 { 142 auto request = adoptNS([[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"test:///"]]); 143 144 [NSURLProtocol setProperty:@"world" forKey:@"hello" inRequest:request.get()]; 145 auto handler = adoptNS([TestURLSchemeHandler new]); 146 __block bool done = false; 147 handler.get().startURLSchemeTaskHandler = ^(WKWebView *, id<WKURLSchemeTask> task) { 148 #if HAVE(NSURLREQUEST_REMOVE_ALL_PROTOCOL_PROPERTIES) 149 EXPECT_FALSE([NSURLProtocol propertyForKey:@"hello" inRequest:task.request]); 150 #else 151 EXPECT_TRUE([NSURLProtocol propertyForKey:@"hello" inRequest:task.request]); 152 #endif 153 done = true; 154 }; 155 auto configuration = adoptNS([WKWebViewConfiguration new]); 156 [configuration setURLSchemeHandler:handler.get() forURLScheme:@"test"]; 157 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration.get()]); 158 [webView loadRequest:request.get()]; 159 Util::run(&done); 160 } 161 140 162 } // namespace TestWebKitAPI 141 163
Note:
See TracChangeset
for help on using the changeset viewer.