Changeset 80370 in webkit


Ignore:
Timestamp:
Mar 4, 2011 12:37:53 PM (13 years ago)
Author:
jberlin@webkit.org
Message:

WebKit2: Use CFNetwork Sessions API.
https://bugs.webkit.org/show_bug.cgi?id=55435.

Reviewed by Maciej Stachowiak.

When Private Browsing is enabled, get the cached url response from the cache associated with
the Private Browsing Storage Session.

Source/WebCore:

  • WebCore.exp.in:

Export the symbol for ResourceHandle::privateBrowsingStorageSession.

Source/WebKit/mac:

  • WebView/WebView.mm:

(-[WebView _cachedResponseForURL:]):

Source/WebKit2:

  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::platformHasLocalDataForURL):
If Private Browsing is enabled, call into WKSI to get the response.
(WebKit::WebPage::cachedResponseMIMETypeForURL):
Ditto.

  • WebProcess/WebPage/win/WebPageWin.cpp:

(WebKit::WebPage::platformHasLocalDataForURL):
If Private Browsing is enabled, call into WKSI to get the CFURLCacheRef.
(WebKit::WebPage::cachedResponseMIMETypeForURL):
Ditto.

WebKitLibraries:

Update WebKitSystemInterface headers and libraries with the new functions.

  • WebKitSystemInterface.h:
  • libWebKitSystemInterfaceLeopard.a:
  • libWebKitSystemInterfaceSnowLeopard.a:
  • win/include/WebKitSystemInterface/WebKitSystemInterface.h:
  • win/lib/WebKitSystemInterface.lib:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80367 r80370  
     12011-03-04  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        WebKit2: Use CFNetwork Sessions API.
     6        https://bugs.webkit.org/show_bug.cgi?id=55435.
     7
     8        When Private Browsing is enabled, get the cached url response from the cache associated with
     9        the Private Browsing Storage Session.
     10
     11        * WebCore.exp.in:
     12        Export the symbol for ResourceHandle::privateBrowsingStorageSession.
     13
    1142011-03-04  Steve Block  <steveblock@google.com>
    215
  • trunk/Source/WebCore/WebCore.exp.in

    r80358 r80370  
    17911791#if USE(CFURLSTORAGESESSIONS)
    17921792__ZN7WebCore14ResourceHandle46setPrivateBrowsingStorageSessionIdentifierBaseERKN3WTF6StringE
    1793 #endif
     1793__ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
     1794#endif
  • trunk/Source/WebKit/mac/ChangeLog

    r80310 r80370  
     12011-03-04  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        WebKit2: Use CFNetwork Sessions API.
     6        https://bugs.webkit.org/show_bug.cgi?id=55435.
     7
     8        When Private Browsing is enabled, get the cached url response from the cache associated with
     9        the Private Browsing Storage Session.
     10
     11        * WebView/WebView.mm:
     12        (-[WebView _cachedResponseForURL:]):
     13
    1142011-03-03  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r80310 r80370  
    18721872    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL];
    18731873    [request _web_setHTTPUserAgent:[self userAgentForURL:URL]];
    1874     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     1874    NSCachedURLResponse *cachedResponse;
     1875#if USE(CFURLSTORAGESESSIONS)
     1876    if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())
     1877        cachedResponse = WKCachedResponseForRequest(storageSession, request);
     1878    else
     1879#endif
     1880        cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
    18751881    [request release];
    18761882    return cachedResponse;
  • trunk/Source/WebKit2/ChangeLog

    r80365 r80370  
     12011-03-04  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        WebKit2: Use CFNetwork Sessions API.
     6        https://bugs.webkit.org/show_bug.cgi?id=55435.
     7
     8        When Private Browsing is enabled, get the cached url response from the cache associated with
     9        the Private Browsing Storage Session.
     10
     11        * WebProcess/WebPage/mac/WebPageMac.mm:
     12        (WebKit::WebPage::platformHasLocalDataForURL):
     13        If Private Browsing is enabled, call into WKSI to get the response.
     14        (WebKit::WebPage::cachedResponseMIMETypeForURL):
     15        Ditto.
     16        * WebProcess/WebPage/win/WebPageWin.cpp:
     17        (WebKit::WebPage::platformHasLocalDataForURL):
     18        If Private Browsing is enabled, call into WKSI to get the CFURLCacheRef.
     19        (WebKit::WebPage::cachedResponseMIMETypeForURL):
     20        Ditto.
     21
    1222011-03-04  Jeff Miller  <jeffm@apple.com>
    223
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r79914 r80370  
    4343#import <WebCore/Page.h>
    4444#import <WebCore/PlatformKeyboardEvent.h>
     45#import <WebCore/ResourceHandle.h>
    4546#import <WebCore/ScrollView.h>
    4647#import <WebCore/TextIterator.h>
     
    444445    NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
    445446    [request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"];
    446     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     447    NSCachedURLResponse *cachedResponse;
     448#if USE(CFURLSTORAGESESSIONS)
     449    if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())
     450        cachedResponse = WKCachedResponseForRequest(storageSession, request);
     451    else
     452#endif
     453        cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
    447454    [request release];
    448455   
     
    454461    NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
    455462    [request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"];
    456     NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
     463    NSCachedURLResponse *cachedResponse;
     464#if USE(CFURLSTORAGESESSIONS)
     465    if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())
     466        cachedResponse = WKCachedResponseForRequest(storageSession, request);
     467    else
     468#endif
     469        cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request];
    457470    [request release];
    458471   
  • trunk/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp

    r76993 r80370  
    3737#include <WebCore/Page.h>
    3838#include <WebCore/PlatformKeyboardEvent.h>
     39#include <WebCore/ResourceHandle.h>
    3940#include <WebCore/Settings.h>
    4041#if PLATFORM(CG)
     
    254255    CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), userAgent.get());
    255256
    256     RetainPtr<CFURLCacheRef> cache(AdoptCF, CFURLCacheCopySharedURLCache());
     257    RetainPtr<CFURLCacheRef> cache;
     258#if USE(CFURLSTORAGESESSIONS)
     259    if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())
     260        cache.adoptCF(wkCopyURLCache(storageSession));
     261    else
     262#endif
     263        cache.adoptCF(CFURLCacheCopySharedURLCache());
    257264
    258265    RetainPtr<CFCachedURLResponseRef> response(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get()));   
     
    272279    CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), userAgent.get());
    273280
    274     RetainPtr<CFURLCacheRef> cache(AdoptCF, CFURLCacheCopySharedURLCache());
     281    RetainPtr<CFURLCacheRef> cache;
     282#if USE(CFURLSTORAGESESSIONS)
     283    if (CFURLStorageSessionRef storageSession = ResourceHandle::privateBrowsingStorageSession())
     284        cache.adoptCF(wkCopyURLCache(storageSession));
     285    else
     286#endif
     287        cache.adoptCF(CFURLCacheCopySharedURLCache());
    275288
    276289    RetainPtr<CFCachedURLResponseRef> cachedResponse(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get()));
  • trunk/WebKitLibraries/ChangeLog

    r80294 r80370  
     12011-03-04  Jessie Berlin  <jberlin@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        WebKit2: Use CFNetwork Sessions API.
     6        https://bugs.webkit.org/show_bug.cgi?id=55435.
     7
     8        When Private Browsing is enabled, get the cached url response from the cache associated with
     9        the Private Browsing Storage Session.
     10
     11        Update WebKitSystemInterface headers and libraries with the new functions.
     12
     13        * WebKitSystemInterface.h:
     14        * libWebKitSystemInterfaceLeopard.a:
     15        * libWebKitSystemInterfaceSnowLeopard.a:
     16        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
     17        * win/lib/WebKitSystemInterface.lib:
     18
    1192011-03-03  Jessie Berlin  <jberlin@apple.com>
    220
  • trunk/WebKitLibraries/WebKitSystemInterface.h

    r80294 r80370  
    237237CFURLStorageSessionRef WKCreatePrivateStorageSession(CFStringRef);
    238238NSURLRequest *WKCopyRequestWithStorageSession(CFURLStorageSessionRef, NSURLRequest*);
     239NSCachedURLResponse *WKCachedResponseForRequest(CFURLStorageSessionRef, NSURLRequest*);
    239240
    240241void WKSetVisibleApplicationName(CFStringRef);
  • trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h

    r80294 r80370  
    6666typedef struct _CFURLCredential* WKCFURLCredentialRef;
    6767typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
     68typedef const struct _CFURLCache* CFURLCacheRef;
    6869
    6970void wkSetFontSmoothingLevel(int type);
     
    99100CFURLStorageSessionRef wkCreatePrivateStorageSession(CFStringRef identifier);
    100101void wkSetRequestStorageSession(CFURLStorageSessionRef, CFMutableURLRequestRef);
     102CFURLCacheRef wkCopyURLCache(CFURLStorageSessionRef);
    101103
    102104CFArrayRef wkCFURLCacheCopyAllHostNamesInPersistentStore();
Note: See TracChangeset for help on using the changeset viewer.