diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/win')
4 files changed, 27 insertions, 2 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp index aa1f975..13f1e3f 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp @@ -23,6 +23,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "ChunkedUpdateDrawingArea.h" #include "UpdateChunk.h" diff --git a/Source/WebKit2/WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp index cae79c2..3c2f3c9 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp @@ -23,10 +23,11 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#if USE(ACCELERATED_COMPOSITING) - +#include "config.h" #include "LayerBackedDrawingArea.h" +#if USE(ACCELERATED_COMPOSITING) + using namespace WebCore; namespace WebKit { diff --git a/Source/WebKit2/WebProcess/WebPage/win/WebInspectorWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/WebInspectorWin.cpp index 4c30b8b..3ae0dae 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/WebInspectorWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/WebInspectorWin.cpp @@ -23,6 +23,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "WebInspector.h" #if ENABLE(INSPECTOR) diff --git a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp index d41972c..e20af3a 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp @@ -23,6 +23,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "WebPage.h" #include "FontSmoothingLevel.h" @@ -261,6 +262,27 @@ bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url) #endif } +String WebPage::cachedResponseMIMETypeForURL(const WebCore::KURL& url) +{ +#if USE(CFNETWORK) + RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL()); + RetainPtr<CFMutableURLRequestRef> request(AdoptCF, CFURLRequestCreateMutable(0, cfURL.get(), kCFURLRequestCachePolicyReloadIgnoringCache, 60, 0)); + + RetainPtr<CFStringRef> userAgent(AdoptCF, userAgent().createCFString()); + CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), userAgent.get()); + + RetainPtr<CFURLCacheRef> cache(AdoptCF, CFURLCacheCopySharedURLCache()); + + RetainPtr<CFCachedURLResponseRef> cachedResponse(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get())); + + CFURLResponseRef response = CFCachedURLResponseGetWrappedResponse(cachedResponse.get()); + + return response ? CFURLResponseGetMIMEType(response) : String(); +#else + return String(); +#endif +} + bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) { #if USE(CFNETWORK) |