Changeset 74131 in webkit
- Timestamp:
- Dec 15, 2010 11:34:25 AM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r74124 r74131 1 2010-12-15 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 WebKit2: WebPageWin needs implementations of hasLocalDataForURL and canHandleRequest 6 https://bugs.webkit.org/show_bug.cgi?id=51090 7 8 Implement these functions for WebKit2 on Windows. 9 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::hasLocalDataForURL): Does the cross-platform part of the check for having local 12 data (file URL or subresource), then calls platformHasLocalDataForURL to let the platform do 13 their specific checks. 14 * WebProcess/WebPage/WebPage.h: 15 * WebProcess/WebPage/mac/WebPageMac.mm: 16 (WebKit::WebPage::platformHasLocalDataForURL): Moved the cross-platform code from here to WebPage::hasLocalDataForURL. 17 * WebProcess/WebPage/qt/WebPageQt.cpp: 18 (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL. 19 * WebProcess/WebPage/win/WebPageWin.cpp: 20 (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL and implemented with CFNetwork calls. This is the 21 CFNetwork equivalent of the code in WebPageMac::platformHasLocalDataForURL. 22 (WebKit::WebPage::canHandleRequest): Copied the line of code from WebView::canHandleRequest in WebKit1, with a FIXME saying 23 this might not be enough (although it was in WebKit1 on Windows). 24 1 25 2010-12-15 Sheriff Bot <webkit.review.bot@gmail.com> 2 26 -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r74041 r74131 59 59 #include "WebProcessProxyMessages.h" 60 60 #include <WebCore/AbstractDatabase.h> 61 #include <WebCore/ArchiveResource.h> 61 62 #include <WebCore/Chrome.h> 62 63 #include <WebCore/ContextMenuController.h> 64 #include <WebCore/DocumentLoader.h> 63 65 #include <WebCore/EventHandler.h> 64 66 #include <WebCore/FocusController.h> … … 1265 1267 } 1266 1268 1269 bool WebPage::hasLocalDataForURL(const KURL& url) 1270 { 1271 if (url.isLocalFile()) 1272 return true; 1273 1274 FrameLoader* frameLoader = m_page->mainFrame()->loader(); 1275 DocumentLoader* documentLoader = frameLoader ? frameLoader->documentLoader() : 0; 1276 if (documentLoader && documentLoader->subresource(url)) 1277 return true; 1278 1279 return platformHasLocalDataForURL(url); 1280 } 1281 1267 1282 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r74046 r74131 268 268 void loadData(PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::KURL& baseURL, const WebCore::KURL& failingURL); 269 269 270 bool platformHasLocalDataForURL(const WebCore::KURL&); 271 270 272 // Actions 271 273 void tryClose(); -
trunk/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r74046 r74131 31 31 #include "WebPageProxyMessages.h" 32 32 #include "WebProcess.h" 33 #include <WebCore/ArchiveResource.h>34 #include <WebCore/DocumentLoader.h>35 33 #include <WebCore/FocusController.h> 36 34 #include <WebCore/Frame.h> … … 343 341 } 344 342 345 bool WebPage::hasLocalDataForURL(const WebCore::KURL& url) 346 { 347 if (url.isLocalFile()) 348 return true; 349 350 FrameLoader* frameLoader = m_page->mainFrame()->loader(); 351 DocumentLoader* documentLoader = frameLoader ? frameLoader->documentLoader() : 0; 352 if (documentLoader && documentLoader->subresource(url)) 353 return true; 354 343 bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url) 344 { 355 345 NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url]; 356 346 [request setValue:(NSString*)userAgent() forHTTPHeaderField:@"User-Agent"]; -
trunk/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
r73941 r74131 265 265 } 266 266 267 bool WebPage:: hasLocalDataForURL(const WebCore::KURL&)267 bool WebPage::platformHasLocalDataForURL(const WebCore::KURL&) 268 268 { 269 269 // FIXME: Implement -
trunk/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
r73952 r74131 41 41 #include <WinUser.h> 42 42 43 #if USE(CFNETWORK) 44 #include <CFNetwork/CFURLCachePriv.h> 45 #include <CFNetwork/CFURLProtocolPriv.h> 46 #include <CFNetwork/CFURLRequestPriv.h> 47 #endif 48 43 49 using namespace WebCore; 44 50 … … 237 243 } 238 244 239 bool WebPage::hasLocalDataForURL(const WebCore::KURL&) 240 { 241 // FIXME <rdar://problem/8608754>: Implement 245 bool WebPage::platformHasLocalDataForURL(const WebCore::KURL& url) 246 { 247 #if USE(CFNETWORK) 248 RetainPtr<CFURLRef> cfURL(AdoptCF, url.createCFURL()); 249 RetainPtr<CFMutableURLRequestRef> request(AdoptCF, CFURLRequestCreateMutable(0, cfURL.get(), kCFURLRequestCachePolicyReloadIgnoringCache, 60, 0)); 250 251 RetainPtr<CFStringRef> userAgent(AdoptCF, userAgent().createCFString()); 252 CFURLRequestSetHTTPHeaderFieldValue(request.get(), CFSTR("User-Agent"), userAgent.get()); 253 254 RetainPtr<CFURLCacheRef> cache(AdoptCF, CFURLCacheCopySharedURLCache()); 255 256 RetainPtr<CFCachedURLResponseRef> response(AdoptCF, CFURLCacheCopyResponseForRequest(cache.get(), request.get())); 257 return response; 258 #else 242 259 return false; 243 } 244 245 bool WebPage::canHandleRequest(const WebCore::ResourceRequest&) 246 { 247 // FIXME <rdar://problem/8608754>: Implement 248 return true; 260 #endif 261 } 262 263 bool WebPage::canHandleRequest(const WebCore::ResourceRequest& request) 264 { 265 // FIXME: Are there other requests we need to be able to handle? WebKit1's WebView.cpp has a FIXME here as well. 266 return CFURLProtocolCanHandleRequest(request.cfURLRequest()); 249 267 } 250 268
Note: See TracChangeset
for help on using the changeset viewer.