summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp22
1 files changed, 22 insertions, 0 deletions
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)