Changeset 221632 in webkit
- Timestamp:
- Sep 5, 2017 1:41:31 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r221625 r221632 1 2017-09-05 Brent Fulgham <bfulgham@apple.com> 2 3 Use a single network storage session for stateless connections 4 https://bugs.webkit.org/show_bug.cgi?id=176386 5 <rdar://problem/34262148> 6 7 Reviewed by Alex Christensen. 8 9 Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState' 10 to reflect that the data tasks do not involve credential or cookie storage. Ditto for 11 the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'. 12 13 This update should not change behavior, unless some stateless sessions were depending 14 on cookies to be persistent (which would be a bug!) 15 16 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 17 (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names. 18 (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto. 19 * NetworkProcess/cocoa/NetworkSessionCocoa.h: 20 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 21 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block 22 cookies as well. 23 (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names. 24 (WebKit::NetworkSessionCocoa::clearCredentials): Ditto. 25 (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto. 26 1 27 2017-09-05 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 28 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r221059 r221632 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 117 117 cocoaSession.m_dataTaskMapWithCredentials.add([m_task taskIdentifier], this); 118 118 } else { 119 m_task = [cocoaSession.m_s essionWithoutCredentialStoragedataTaskWithRequest:nsRequest];120 ASSERT(!cocoaSession.m_dataTaskMapWithout Credentials.contains([m_task taskIdentifier]));121 cocoaSession.m_dataTaskMapWithout Credentials.add([m_task taskIdentifier], this);119 m_task = [cocoaSession.m_statelessSession dataTaskWithRequest:nsRequest]; 120 ASSERT(!cocoaSession.m_dataTaskMapWithoutState.contains([m_task taskIdentifier])); 121 cocoaSession.m_dataTaskMapWithoutState.add([m_task taskIdentifier], this); 122 122 } 123 123 LOG(NetworkSession, "%llu Creating NetworkDataTask with URL %s", [m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String); … … 145 145 cocoaSession.m_dataTaskMapWithCredentials.remove([m_task taskIdentifier]); 146 146 } else { 147 ASSERT(cocoaSession.m_dataTaskMapWithout Credentials.get([m_task taskIdentifier]) == this);148 cocoaSession.m_dataTaskMapWithout Credentials.remove([m_task taskIdentifier]);147 ASSERT(cocoaSession.m_dataTaskMapWithoutState.get([m_task taskIdentifier]) == this); 148 cocoaSession.m_dataTaskMapWithoutState.remove([m_task taskIdentifier]); 149 149 } 150 150 } -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
r220857 r221632 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 71 71 72 72 HashMap<NetworkDataTaskCocoa::TaskIdentifier, NetworkDataTaskCocoa*> m_dataTaskMapWithCredentials; 73 HashMap<NetworkDataTaskCocoa::TaskIdentifier, NetworkDataTaskCocoa*> m_dataTaskMapWithout Credentials;73 HashMap<NetworkDataTaskCocoa::TaskIdentifier, NetworkDataTaskCocoa*> m_dataTaskMapWithoutState; 74 74 HashMap<NetworkDataTaskCocoa::TaskIdentifier, DownloadID> m_downloadMap; 75 75 76 76 RetainPtr<NSURLSession> m_sessionWithCredentialStorage; 77 77 RetainPtr<WKNetworkSessionDelegate> m_sessionWithCredentialStorageDelegate; 78 RetainPtr<NSURLSession> m_s essionWithoutCredentialStorage;79 RetainPtr<WKNetworkSessionDelegate> m_s essionWithoutCredentialStorageDelegate;78 RetainPtr<NSURLSession> m_statelessSession; 79 RetainPtr<WKNetworkSessionDelegate> m_statelessSessionDelegate; 80 80 }; 81 81 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r220857 r221632 598 598 m_sessionWithCredentialStorageDelegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:*this withCredentials:true]); 599 599 m_sessionWithCredentialStorage = [NSURLSession sessionWithConfiguration:configuration delegate:static_cast<id>(m_sessionWithCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 600 LOG(NetworkSession, "Created NetworkSession with cookieAcceptPolicy %lu", configuration.HTTPCookieStorage.cookieAcceptPolicy); 600 601 601 602 configuration.URLCredentialStorage = nil; 602 603 configuration._shouldSkipPreferredClientCertificateLookup = YES; 603 m_sessionWithoutCredentialStorageDelegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:*this withCredentials:false]); 604 m_sessionWithoutCredentialStorage = [NSURLSession sessionWithConfiguration:configuration delegate:static_cast<id>(m_sessionWithoutCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 605 LOG(NetworkSession, "Created NetworkSession with cookieAcceptPolicy %lu", configuration.HTTPCookieStorage.cookieAcceptPolicy); 604 configuration.HTTPCookieStorage = nil; 605 configuration.HTTPCookieAcceptPolicy = NSHTTPCookieAcceptPolicyNever; 606 607 m_statelessSessionDelegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:*this withCredentials:false]); 608 m_statelessSession = [NSURLSession sessionWithConfiguration:configuration delegate:static_cast<id>(m_statelessSessionDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 606 609 } 607 610 … … 615 618 616 619 [m_sessionWithCredentialStorage invalidateAndCancel]; 617 [m_s essionWithoutCredentialStorageinvalidateAndCancel];620 [m_statelessSession invalidateAndCancel]; 618 621 [m_sessionWithCredentialStorageDelegate sessionInvalidated]; 619 [m_s essionWithoutCredentialStorageDelegate sessionInvalidated];622 [m_statelessSessionDelegate sessionInvalidated]; 620 623 } 621 624 … … 624 627 #if !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION) 625 628 ASSERT(m_dataTaskMapWithCredentials.isEmpty()); 626 ASSERT(m_dataTaskMapWithout Credentials.isEmpty());629 ASSERT(m_dataTaskMapWithoutState.isEmpty()); 627 630 ASSERT(m_downloadMap.isEmpty()); 628 631 // FIXME: Use resetWithCompletionHandler instead. 629 632 m_sessionWithCredentialStorage = [NSURLSession sessionWithConfiguration:m_sessionWithCredentialStorage.get().configuration delegate:static_cast<id>(m_sessionWithCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 630 m_s essionWithoutCredentialStorage = [NSURLSession sessionWithConfiguration:m_sessionWithoutCredentialStorage.get().configuration delegate:static_cast<id>(m_sessionWithoutCredentialStorageDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]];633 m_statelessSession = [NSURLSession sessionWithConfiguration:m_statelessSession.get().configuration delegate:static_cast<id>(m_statelessSessionDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]]; 631 634 #endif 632 635 } … … 637 640 if (storedCredentials == WebCore::StoredCredentials::AllowStoredCredentials) 638 641 return m_dataTaskMapWithCredentials.get(taskIdentifier); 639 return m_dataTaskMapWithout Credentials.get(taskIdentifier);642 return m_dataTaskMapWithoutState.get(taskIdentifier); 640 643 } 641 644
Note: See TracChangeset
for help on using the changeset viewer.