Changeset 86255 in webkit
- Timestamp:
- May 11, 2011 12:51:19 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86254 r86255 1 2011-05-11 Jessie Berlin <jberlin@apple.com> 2 3 Reviewed by Steve Falkenburg. 4 5 [Windows WebKit2] Use cookies set in WebKit1 6 https://bugs.webkit.org/show_bug.cgi?id=60274 7 8 Share the default storage session between the UI and Web Processes. 9 10 * platform/network/cf/CookieStorageCFNet.cpp: 11 (WebCore::defaultSessionCookieStorage): 12 Keep track of the default storage session cookie storage. 13 (WebCore::currentCookieStorage): 14 Call defaultCookieStorage to get the default cookie storage. 15 (WebCore::defaultCookieStorage): 16 If there is a default storage session cookie storage, prefer that over getting the default 17 cookie storage. In the Web Process, asking CFNetwork for the default cookie storage directly 18 without specifying a storage session will not get the cookie storage being shared by the UI 19 and Web Processes. 20 21 * platform/network/ResourceHandle.h: 22 * platform/network/cf/ResourceHandleCFNet.cpp: 23 (WebCore::willSendRequest): 24 Make sure to set the current storage session on any requests used by the Web 25 Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid 26 doing anything with the Web Process's default storage session (which is not the one shared 27 with the UI Process). 28 (WebCore::makeFinalRequest): 29 Ditto. 30 (WebCore::ResourceHandle::willSendRequest): 31 Ditto. 32 (WebCore::ResourceHandle::currentStorageSession): 33 If there is a Private Browsing storage session, return that. 34 If not, on Windows return the default storage session that is being shared with the UI 35 Process and on Mac return 0. 36 (WebCore::defaultCFURLStorageSession): 37 (WebCore::ResourceHandle::setDefaultStorageSession): 38 (WebCore::ResourceHandle::defaultStorageSession): 39 40 * platform/network/cf/ResourceRequestCFNet.cpp: 41 (WebCore::ResourceRequest::doUpdatePlatformRequest): 42 Make sure to set the current storage session on any requests used by the Web 43 Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid 44 doing anything with the Web Process's default storage session (which is not the one shared 45 with the UI Process). 46 1 47 2011-05-11 Martin Robinson <mrobinson@igalia.com> 2 48 -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r86018 r86255 195 195 static CFURLStorageSessionRef privateBrowsingStorageSession(); 196 196 static void setPrivateBrowsingStorageSessionIdentifierBase(const String&); 197 #endif 197 static CFURLStorageSessionRef currentStorageSession(); 198 #if PLATFORM(WIN) 199 static void setDefaultStorageSession(CFURLStorageSessionRef); 200 static CFURLStorageSessionRef defaultStorageSession(); 201 #endif // PLATFORM(WIN) 202 #endif // USE(CFURLSTORAGESESSIONS) 198 203 199 204 using RefCounted<ResourceHandle>::ref; -
trunk/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
r86018 r86255 63 63 #if USE(CFNETWORK) 64 64 65 static RetainPtr<CFHTTPCookieStorageRef>& defaultSessionCookieStorage() 66 { 67 DEFINE_STATIC_LOCAL(RetainPtr<CFHTTPCookieStorageRef>, cookieStorage, ()); 68 #if USE(CFURLSTORAGESESSIONS) && PLATFORM(WIN) 69 if (!cookieStorage && ResourceHandle::defaultStorageSession()) 70 cookieStorage.adoptCF(wkCopyHTTPCookieStorage(ResourceHandle::defaultStorageSession())); 71 #endif 72 return cookieStorage; 73 } 74 65 75 CFHTTPCookieStorageRef currentCookieStorage() 66 76 { … … 69 79 if (CFHTTPCookieStorageRef cookieStorage = privateBrowsingCookieStorage().get()) 70 80 return cookieStorage; 71 return wkGetDefaultHTTPCookieStorage();81 return defaultCookieStorage(); 72 82 } 73 83 … … 98 108 CFHTTPCookieStorageRef defaultCookieStorage() 99 109 { 110 if (CFHTTPCookieStorageRef defaultCookieStorage = defaultSessionCookieStorage().get()) 111 return defaultCookieStorage; 100 112 return wkGetDefaultHTTPCookieStorage(); 101 113 } -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r86018 r86255 149 149 if (CFStringCompareWithOptions(lastHTTPMethod.get(), newMethod.get(), CFRangeMake(0, CFStringGetLength(lastHTTPMethod.get())), kCFCompareCaseInsensitive)) { 150 150 RetainPtr<CFMutableURLRequestRef> mutableRequest(AdoptCF, CFURLRequestCreateMutableCopy(0, cfRequest)); 151 #if USE(CFURLSTORAGESESSIONS) 152 wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), mutableRequest.get()); 153 #endif 151 154 CFURLRequestSetHTTPRequestMethod(mutableRequest.get(), lastHTTPMethod.get()); 152 155 … … 341 344 { 342 345 CFMutableURLRequestRef newRequest = CFURLRequestCreateMutableCopy(kCFAllocatorDefault, request.cfURLRequest()); 343 344 346 #if USE(CFURLSTORAGESESSIONS) 345 if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession()) 346 wkSetRequestStorageSession(storageSession, newRequest); 347 wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), newRequest); 347 348 #endif 348 349 … … 494 495 495 496 #if USE(CFURLSTORAGESESSIONS) 496 if (CFURLStorageSessionRef storageSession = privateBrowsingStorageSession()) 497 request.setStorageSession(storageSession); 497 request.setStorageSession(ResourceHandle::currentStorageSession()); 498 498 #endif 499 499 … … 745 745 } 746 746 747 CFURLStorageSessionRef ResourceHandle::currentStorageSession() 748 { 749 if (CFURLStorageSessionRef privateStorageSession = privateBrowsingStorageSession()) 750 return privateStorageSession; 751 #if PLATFORM(WIN) 752 return defaultStorageSession(); 753 #else 754 return 0; 747 755 #endif 756 } 757 758 #if PLATFORM(WIN) 759 760 static RetainPtr<CFURLStorageSessionRef>& defaultCFURLStorageSession() 761 { 762 DEFINE_STATIC_LOCAL(RetainPtr<CFURLStorageSessionRef>, storageSession, ()); 763 return storageSession; 764 } 765 766 void ResourceHandle::setDefaultStorageSession(CFURLStorageSessionRef storageSession) 767 { 768 defaultCFURLStorageSession().adoptCF(storageSession); 769 } 770 771 CFURLStorageSessionRef ResourceHandle::defaultStorageSession() 772 { 773 return defaultCFURLStorageSession().get(); 774 } 775 776 #endif // PLATFORM(WIN) 777 778 #endif // USE(CFURLSTORAGESESSIONS) 748 779 749 780 void WebCoreSynchronousLoaderClient::willSendRequest(ResourceHandle* handle, ResourceRequest& request, const ResourceResponse& /*redirectResponse*/) -
trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
r86018 r86255 27 27 #include "ResourceRequestCFNet.h" 28 28 29 #include "ResourceHandle.h" 29 30 #include "ResourceRequest.h" 30 31 … … 124 125 CFURLRequestSetCachePolicy(cfRequest, (CFURLRequestCachePolicy)cachePolicy()); 125 126 CFURLRequestSetTimeoutInterval(cfRequest, timeoutInterval()); 126 } else {127 } else 127 128 cfRequest = CFURLRequestCreateMutable(0, url.get(), (CFURLRequestCachePolicy)cachePolicy(), timeoutInterval(), firstPartyForCookies.get()); 128 } 129 #if USE(CFURLSTORAGESESSIONS) 130 wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), cfRequest); 131 #endif 129 132 130 133 RetainPtr<CFStringRef> requestMethod(AdoptCF, httpMethod().createCFString()); -
trunk/Source/WebKit/win/ChangeLog
r86130 r86255 1 2011-05-11 Jessie Berlin <jberlin@apple.com> 2 3 Reviewed by Steve Falkenburg. 4 5 [Windows WebKit2] Use cookies set in WebKit1 6 https://bugs.webkit.org/show_bug.cgi?id=60274 7 8 * WebView.cpp: 9 (WebView::setCacheModel): 10 Pass 0 to wkCopyFoundationCacheDirectory so that it uses the default session. 11 1 12 2011-05-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Source/WebKit/win/WebView.cpp
r86018 r86255 453 453 454 454 RetainPtr<CFURLCacheRef> cfurlCache(AdoptCF, CFURLCacheCopySharedURLCache()); 455 RetainPtr<CFStringRef> cfurlCacheDirectory(AdoptCF, wkCopyFoundationCacheDirectory( ));455 RetainPtr<CFStringRef> cfurlCacheDirectory(AdoptCF, wkCopyFoundationCacheDirectory(0)); 456 456 if (!cfurlCacheDirectory) 457 457 cfurlCacheDirectory.adoptCF(WebCore::localUserSpecificStorageDirectory().createCFString()); -
trunk/Source/WebKit2/ChangeLog
r86249 r86255 1 2011-05-11 Jessie Berlin <jberlin@apple.com> 2 3 Reviewed by Steve Falkenburg. 4 5 [Windows WebKit2] Use cookies set in WebKit1 6 https://bugs.webkit.org/show_bug.cgi?id=60274 7 8 Share the default storage session between the UI and Web Processes. 9 10 * Shared/WebProcessCreationParameters.cpp: 11 (WebKit::WebProcessCreationParameters::encode): 12 (WebKit::WebProcessCreationParameters::decode): 13 * Shared/WebProcessCreationParameters.h: 14 Add a parameter for a serialized default storage session, used only on Windows. 15 16 * Shared/win/WebCoreArgumentCodersWin.cpp: 17 (CoreIPC::decodeResourceRequest): 18 Make sure to set the current storage session on any requests used by the Web 19 Process before CFNetwork has to do anything with them, in order for CFNetwork to avoid 20 doing anything with the Web Process's default storage session. 21 22 * UIProcess/win/WebContextWin.cpp: 23 (WebKit::WebContext::platformInitializeWebProcess): 24 Serialize the default storage session in the UI Process and add it to the 25 WebProcessCreationParameters. 26 27 * WebProcess/WebPage/win/WebPageWin.cpp: 28 (WebKit::cachedResponseForURL): 29 Use the cache associated with the current storage session and make sure the request has the 30 current storage session set on it before doing anything with it. 31 32 * WebProcess/win/WebProcessWin.cpp: 33 (WebKit::WebProcess::platformSetCacheModel): 34 Use the default storage session. 35 (WebKit::WebProcess::platformClearResourceCaches): 36 Ditto. 37 (WebKit::WebProcess::platformInitializeWebProcess): 38 Deserialize the default storage session passed in by the UI Process and hand it to the 39 ResourceHandle. 40 1 41 2011-05-11 Sam Weinig <sam@webkit.org> 2 42 -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
r86018 r86255 28 28 29 29 #include "ArgumentCoders.h" 30 #if USE(CFURLSTORAGESESSIONS) && PLATFORM(WIN) 31 #include "ArgumentCodersCF.h" 32 #endif 30 33 31 34 namespace WebKit { … … 80 83 encoder->encode(cfURLCacheMemoryCapacity); 81 84 encoder->encode(initialHTTPCookieAcceptPolicy); 85 #if USE(CFURLSTORAGESESSIONS) 86 CoreIPC::encode(encoder, serializedDefaultStorageSession.get()); 87 #endif // USE(CFURLSTORAGESESSIONS) 82 88 #endif 83 89 } … … 150 156 if (!decoder->decode(parameters.initialHTTPCookieAcceptPolicy)) 151 157 return false; 158 #if USE(CFURLSTORAGESESSIONS) 159 if (!CoreIPC::decode(decoder, parameters.serializedDefaultStorageSession)) 160 return false; 161 #endif // USE(CFURLSTORAGESESSIONS) 152 162 #endif 153 163 -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h
r86018 r86255 30 30 #include "SandboxExtension.h" 31 31 #include "TextCheckerState.h" 32 #include <wtf/RetainPtr.h> 32 33 #include <wtf/Vector.h> 33 34 #include <wtf/text/WTFString.h> … … 104 105 105 106 bool shouldPaintNativeControls; 106 #endif 107 108 #if USE(CFURLSTORAGESESSIONS) 109 RetainPtr<CFDataRef> serializedDefaultStorageSession; 110 #endif // USE(CFURLSTORAGESESSIONS) 111 #endif // PLATFORM(WIN) 107 112 }; 108 113 -
trunk/Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp
r86018 r86255 30 30 #include "ArgumentCodersCF.h" 31 31 #include "PlatformCertificateInfo.h" 32 #include <CFNetwork/CFURLRequestPriv.h> 32 33 #include <WebCore/CertificateCFWin.h> 34 #include <WebCore/ResourceHandle.h> 33 35 #include <WebKitSystemInterface/WebKitSystemInterface.h> 34 36 #endif … … 71 73 if (!cfURLRequest) 72 74 return false; 75 CFMutableURLRequestRef mutableCFURLRequest = CFURLRequestCreateMutableCopy(0, cfURLRequest); 76 CFRelease(cfURLRequest); 77 #if USE(CFURLSTORAGESESSIONS) 78 wkSetRequestStorageSession(WebCore::ResourceHandle::currentStorageSession(), mutableCFURLRequest); 79 #endif 73 80 74 resourceRequest = WebCore::ResourceRequest( cfURLRequest);81 resourceRequest = WebCore::ResourceRequest(mutableCFURLRequest); 75 82 return true; 76 83 #else -
trunk/Source/WebKit2/UIProcess/win/WebContextWin.cpp
r86018 r86255 61 61 parameters.cfURLCacheMemoryCapacity = CFURLCacheMemoryCapacity(cfurlCache.get()); 62 62 63 RetainPtr<CFStringRef> cfURLCachePath(AdoptCF, wkCopyFoundationCacheDirectory( ));63 RetainPtr<CFStringRef> cfURLCachePath(AdoptCF, wkCopyFoundationCacheDirectory(0)); 64 64 parameters.cfURLCachePath = String(cfURLCachePath.get()); 65 65 // Remove the ending '\' (necessary to have CFNetwork find the Cache file). … … 70 70 #if USE(CFURLSTORAGESESSIONS) 71 71 parameters.uiProcessBundleIdentifier = String(reinterpret_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleIdentifierKey))); 72 parameters.serializedDefaultStorageSession.adoptCF(wkCopySerializedDefaultStorageSession()); 72 73 #endif // USE(CFURLSTORAGESESSIONS) 73 74 -
trunk/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
r86077 r86255 268 268 RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL()); 269 269 RetainPtr<CFMutableURLRequestRef> request(AdoptCF, CFURLRequestCreateMutable(0, cfURL.get(), kCFURLRequestCachePolicyReloadIgnoringCache, 60, 0)); 270 #if USE(CFURLSTORAGESESSIONS) 271 wkSetRequestStorageSession(ResourceHandle::currentStorageSession(), request.get()); 272 #endif 270 273 271 274 RetainPtr<CFStringRef> userAgent(AdoptCF, webPage->userAgent().createCFString()); … … 274 277 RetainPtr<CFURLCacheRef> cache; 275 278 #if USE(CFURLSTORAGESESSIONS) 276 if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())277 cache.adoptCF(wkCopyURLCache( storageSession));279 if (CFURLStorageSessionRef currentStorageSession = ResourceHandle::currentStorageSession()) 280 cache.adoptCF(wkCopyURLCache(currentStorageSession)); 278 281 else 279 282 #endif -
trunk/Source/WebKit2/WebProcess/win/WebProcessWin.cpp
r86018 r86255 33 33 #include <WebCore/MemoryCache.h> 34 34 #include <WebCore/PageCache.h> 35 #include <WebCore/ResourceHandle.h> 35 36 #include <WebCore/Settings.h> 36 37 #include <wtf/text/WTFString.h> … … 70 71 { 71 72 #if USE(CFNETWORK) 72 RetainPtr<CFStringRef> cfurlCacheDirectory(AdoptCF, wkCopyFoundationCacheDirectory()); 73 RetainPtr<CFStringRef> cfurlCacheDirectory; 74 #if USE(CFURLSTORAGESESSIONS) 75 if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession()) 76 cfurlCacheDirectory.adoptCF(wkCopyFoundationCacheDirectory(defaultStorageSession)); 77 else 78 #endif 79 cfurlCacheDirectory.adoptCF(wkCopyFoundationCacheDirectory(0)); 80 73 81 if (!cfurlCacheDirectory) 74 82 cfurlCacheDirectory.adoptCF(WebCore::localUserSpecificStorageDirectory().createCFString()); … … 95 103 pageCache()->setCapacity(pageCacheCapacity); 96 104 97 RetainPtr<CFURLCacheRef> cfurlCache(AdoptCF, CFURLCacheCopySharedURLCache()); 105 RetainPtr<CFURLCacheRef> cfurlCache; 106 #if USE(CFURLSTORAGESESSIONS) 107 if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession()) 108 cfurlCache.adoptCF(wkCopyURLCache(defaultStorageSession)); 109 else 110 #endif // USE(CFURLSTORAGESESSIONS) 111 cfurlCache.adoptCF(CFURLCacheCopySharedURLCache()); 112 98 113 CFURLCacheSetMemoryCapacity(cfurlCache.get(), urlCacheMemoryCapacity); 99 114 CFURLCacheSetDiskCapacity(cfurlCache.get(), max<unsigned long>(urlCacheDiskCapacity, CFURLCacheDiskCapacity(cfurlCache.get()))); // Don't shrink a big disk cache, since that would cause churn. … … 106 121 if (cachesToClear == InMemoryResourceCachesOnly) 107 122 return; 108 CFURLCacheRemoveAllCachedResponses(RetainPtr<CFURLCacheRef>(AdoptCF, CFURLCacheCopySharedURLCache()).get()); 109 #endif 123 124 RetainPtr<CFURLCacheRef> cache; 125 #if USE(CFURLSTORAGESESSIONS) 126 if (CFURLStorageSessionRef defaultStorageSession = ResourceHandle::defaultStorageSession()) 127 cache.adoptCF(wkCopyURLCache(defaultStorageSession)); 128 else 129 #endif // USE(CFURLSTORAGESESSIONS) 130 cache.adoptCF(CFURLCacheCopySharedURLCache()); 131 132 CFURLCacheRemoveAllCachedResponses(cache.get()); 133 #endif // USE(CFNETWORK) 110 134 } 111 135 … … 115 139 116 140 #if USE(CFNETWORK) 141 #if USE(CFURLSTORAGESESSIONS) 142 if (CFURLStorageSessionRef defaultStorageSession = wkDeserializeStorageSession(parameters.serializedDefaultStorageSession.get())) { 143 ResourceHandle::setDefaultStorageSession(defaultStorageSession); 144 return; 145 } 146 #endif // USE(CFURLSTORAGESESSIONS) 147 117 148 RetainPtr<CFStringRef> cachePath(AdoptCF, parameters.cfURLCachePath.createCFString()); 118 149 if (!cachePath) … … 123 154 RetainPtr<CFURLCacheRef> uiProcessCache(AdoptCF, CFURLCacheCreate(kCFAllocatorDefault, cacheMemoryCapacity, cacheDiskCapacity, cachePath.get())); 124 155 CFURLCacheSetSharedURLCache(uiProcessCache.get()); 125 #endif 156 #endif // USE(CFNETWORK) 126 157 127 158 WebCookieManager::shared().setHTTPCookieAcceptPolicy(parameters.initialHTTPCookieAcceptPolicy); -
trunk/WebKitLibraries/ChangeLog
r86079 r86255 1 2011-05-11 Jessie Berlin <jberlin@apple.com> 2 3 Reviewed by Steve Falkenburg. 4 5 [Windows WebKit2] Use cookies set in WebKit1 6 https://bugs.webkit.org/show_bug.cgi?id=60274 7 8 Take 3 after rolling out KB2465367 from my system. 9 10 * win/include/WebKitSystemInterface/WebKitSystemInterface.h: 11 * win/lib/WebKitSystemInterface.lib: 12 1 13 2011-05-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 14 -
trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
r86018 r86255 94 94 CFHTTPCookieStorageRef wkCreateInMemoryHTTPCookieStorage(); 95 95 void wkSetCFURLRequestShouldContentSniff(CFMutableURLRequestRef, bool); 96 CFStringRef wkCopyFoundationCacheDirectory( );96 CFStringRef wkCopyFoundationCacheDirectory(CFURLStorageSessionRef); 97 97 void wkSetClientCertificateInSSLProperties(CFMutableDictionaryRef, CFDataRef); 98 98 … … 104 104 CFURLCacheRef wkCopyURLCache(CFURLStorageSessionRef); 105 105 CFHTTPCookieStorageRef wkCopyHTTPCookieStorage(CFURLStorageSessionRef); 106 CFDataRef wkCopySerializedDefaultStorageSession(); 107 CFURLStorageSessionRef wkDeserializeStorageSession(CFDataRef); 106 108 107 109 CFArrayRef wkCFURLCacheCopyAllHostNamesInPersistentStore();
Note: See TracChangeset
for help on using the changeset viewer.