Changeset 24365 in webkit
- Timestamp:
- Jul 17, 2007 11:24:36 AM (17 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r24347 r24365 1 2007-07-17 Tristan O'Tierney <tristan@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 <rdar://problem/5294691> Source of file is misrepresented if downloaded by typing in URL in Safari address bar 6 7 * WebCoreSupport/WebFrameLoaderClient.h: 8 * WebCoreSupport/WebFrameLoaderClient.mm: 9 (WebFrameLoaderClient::download): 10 Revised code to check the initial request's referrer before assuming it has a history to check. 11 1 12 2007-07-16 Brady Eidson <beidson@apple.com> 2 13 -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.h
r21793 r24365 76 76 virtual void detachedFromParent4(); 77 77 78 virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRe sponse&);78 virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); 79 79 80 80 virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&); -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r24281 r24365 239 239 } 240 240 241 void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRe sponse& response)241 void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest& initialRequest, const ResourceResponse& response) 242 242 { 243 243 id proxy = handle->releaseProxy(); … … 245 245 246 246 WebView *webView = getWebView(m_webFrame.get()); 247 NSURLRequest *initialURLRequest = initialRequest.nsURLRequest(); 247 248 WebDownload *download = [WebDownload _downloadWithLoadingConnection:handle->connection() 248 249 request:request.nsURLRequest() … … 250 251 delegate:[webView downloadDelegate] 251 252 proxy:proxy]; 253 252 254 NSURL *originalURL = nil; 253 255 WebBackForwardList *history = [webView backForwardList]; … … 256 258 int backCount = 0; 257 259 258 // find the first item in the history that was originated 259 // by the user 260 while (backListCount > 0 && !originalURL) { 261 currentItem = [history itemAtIndex:backCount--]; 262 263 if (![currentItem respondsToSelector:@selector(_wasUserGesture)] || [currentItem _wasUserGesture]) 264 originalURL = [currentItem URL]; 265 } 266 267 if (originalURL && [download respondsToSelector:@selector(_setOriginatingURL:)]) 260 // if there was no referrer, don't traverse the backforward history 261 // since this download was initiated directly 262 // <rdar://problem/5294691> 263 if ([initialURLRequest valueForHTTPHeaderField:@"Referer"]) { 264 // find the first item in the history that was originated 265 // by the user 266 while (backListCount > 0 && !originalURL) { 267 currentItem = [history itemAtIndex:backCount--]; 268 269 if ([currentItem respondsToSelector:@selector(_wasUserGesture)] && [currentItem _wasUserGesture]) 270 originalURL = [currentItem URL]; 271 } 272 } 273 274 if (!originalURL) 275 originalURL = [initialURLRequest URL]; 276 277 if ([download respondsToSelector:@selector(_setOriginatingURL:)]) 268 278 [download _setOriginatingURL:originalURL]; 269 279 }
Note: See TracChangeset
for help on using the changeset viewer.