- removed some of the WebKit dependencies in WebFrameLoader
* Loader/WebFrameLoader.m:
(-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
(-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
(-[WebFrameLoader reload]):
(-[WebFrameLoader didChangeTitleForDocument:]):
* Loader/WebFrameLoaderClient.h:
* WebView/WebFrame.m:
(-[WebFrame _loadItem:withLoadType:]):
(-[WebFrame _loadURL:referrer:intoChild:]):
(-[WebFrame _setTitle:forURL:]):
(-[WebFrame _downloadWithLoadingConnection:request:response:proxy:]):
* WebView/WebFrameInternal.h:
- some other tweaks
* Misc/WebNSURLRequestExtras.m:
(-[NSMutableURLRequest _web_setHTTPReferrer:]):
(-[NSMutableURLRequest _web_setHTTPUserAgent:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16911
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - removed some of the WebKit dependencies in WebFrameLoader
+
+ * Loader/WebFrameLoader.m:
+ (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]):
+ (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]):
+ (-[WebFrameLoader reload]):
+ (-[WebFrameLoader didChangeTitleForDocument:]):
+ * Loader/WebFrameLoaderClient.h:
+ * WebView/WebFrame.m:
+ (-[WebFrame _loadItem:withLoadType:]):
+ (-[WebFrame _loadURL:referrer:intoChild:]):
+ (-[WebFrame _setTitle:forURL:]):
+ (-[WebFrame _downloadWithLoadingConnection:request:response:proxy:]):
+ * WebView/WebFrameInternal.h:
+
+ - some other tweaks
+
+ * Misc/WebNSURLRequestExtras.m:
+ (-[NSMutableURLRequest _web_setHTTPReferrer:]):
+ (-[NSMutableURLRequest _web_setHTTPUserAgent:]):
+
2006-10-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
#import "WebDataProtocol.h"
#import "WebDocumentLoader.h"
+#import "WebFormDataStream.h"
#import "WebFrameBridge.h"
#import "WebFrameLoaderClient.h"
#import "WebMainResourceLoader.h"
#import "WebDataSourceInternal.h"
#import "WebDefaultUIDelegate.h"
#import "WebDocumentLoaderMac.h"
-#import "WebDownloadInternal.h"
-#import "WebFormDataStream.h"
#import "WebFrameInternal.h"
#import "WebFrameLoadDelegate.h"
#import "WebFrameViewInternal.h"
#import "WebHTMLView.h"
-#import "WebHistory.h"
#import "WebIconDatabasePrivate.h"
#import "WebKitErrorsPrivate.h"
#import "WebKitLogging.h"
-#import "WebKitNSStringExtras.h"
#import "WebNSURLExtras.h"
#import "WebNSURLRequestExtras.h"
#import "WebResourcePrivate.h"
frameName:target
formState:formState
andCall:self
- withSelector:@selector(_continueLoadRequestAfterNewWindowPolicy:frameName:formState:)];
+ withSelector:@selector(continueLoadRequestAfterNewWindowPolicy:frameName:formState:)];
}
[request release];
[formState release];
[[self activeDocumentLoader] setRequest:request];
}
-- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(id)proxy
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection
+ request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy
{
- [WebDownload _downloadWithLoadingConnection:connection
- request:request
- response:r
- delegate:[[client webView] downloadDelegate]
- proxy:proxy];
+ [client _downloadWithLoadingConnection:connection request:request response:response proxy:proxy];
}
- (WebFrameBridge *)bridge
[request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
// If we're about to rePOST, set up action so the app can warn the user
- if ([[request HTTPMethod] _webkit_isCaseInsensitiveEqualToString:@"POST"]) {
+ if ([[request HTTPMethod] compare:@"POST" options:(NSCaseInsensitiveSearch | NSLiteralSearch)] == NSOrderedSame) {
NSDictionary *action = [self actionInformationForNavigationType:WebNavigationTypeFormResubmitted
event:nil originalURL:[request URL]];
[policyDocumentLoader setTriggeringAction:action];
if ([loader isCommitted]) {
NSURL *URLForHistory = [[client _dataSourceForDocumentLoader:loader] _URLForHistory];
if (URLForHistory != nil) {
- WebHistoryItem *entry = [[WebHistory optionalSharedHistory] itemForURL:URLForHistory];
- [entry setTitle:[loader title]];
-
- // Must update the entries in the back-forward list too. This must go through the WebFrame because
- // it has the right notion of the current b/f item.
- [client _setTitle:[loader title]];
-
- [[client webView] setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
+ // Must update the entries in the back-forward list too.
+ // This must go through the WebFrame because it has the right notion of the current b/f item.
+ [client _setTitle:[loader title] forURL:URLForHistory];
+ [[client webView] setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
[[[client webView] _frameLoadDelegateForwarder] webView:[client webView]
- didReceiveTitle:[loader title]
- forFrame:client];
+ didReceiveTitle:[loader title] forFrame:client];
}
}
}
- (void)_loadedFromPageCache;
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
+
- (void)_dispatchDidHandleOnloadEventsForFrame;
- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
- (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)request fromDocumentLoader:(WebDocumentLoader *)loader;
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebKit/WebNSURLRequestExtras.h>
+#import "WebNSURLRequestExtras.h"
-#import <JavaScriptCore/Assertions.h>
-#import <WebKit/WebNSURLExtras.h>
+#import "WebNSURLExtras.h"
#define WebContentType (@"Content-Type")
#define WebUserAgent (@"User-Agent")
@end
-
@implementation NSMutableURLRequest (WebNSURLRequestExtras)
- (void)_web_setHTTPContentType:(NSString *)contentType
[self setValue:contentType forHTTPHeaderField:WebContentType];
}
-- (void)_web_setHTTPReferrer:(NSString *)theReferrer
+- (void)_web_setHTTPReferrer:(NSString *)referrer
{
// Do not set the referrer to a string that refers to a file URL.
// That is a potential security hole.
- if ([theReferrer _webkit_isFileURL]) {
+ if ([referrer _webkit_isFileURL])
return;
- }
// Don't allow empty Referer: headers; some servers refuse them
- if( [theReferrer length] == 0 )
- theReferrer = nil;
+ if ([referrer length] == 0)
+ return;
- [self setValue:theReferrer forHTTPHeaderField:WebReferrer];
+ [self setValue:referrer forHTTPHeaderField:WebReferrer];
}
-- (void)_web_setHTTPUserAgent:(NSString *)theUserAgent
+- (void)_web_setHTTPUserAgent:(NSString *)userAgent
{
- [self setValue:theUserAgent forHTTPHeaderField:WebUserAgent];
+ [self setValue:userAgent forHTTPHeaderField:WebUserAgent];
}
@end
-
#import "WebDefaultUIDelegate.h"
#import "WebDocumentInternal.h"
#import "WebDocumentLoaderMac.h"
+#import "WebDownloadInternal.h"
#import "WebFormDataStream.h"
#import "WebFrameBridge.h"
#import "WebFrameLoadDelegate.h"
NSDictionary *pageCache = [item pageCache];
NSDate *cacheDate = [pageCache objectForKey: WebPageCacheEntryDateKey];
NSTimeInterval delta = [[NSDate date] timeIntervalSinceDate: cacheDate];
-
- if (delta <= [[[self webView] preferences] _backForwardCacheExpirationInterval]){
+ if (delta <= [[[self webView] preferences] _backForwardCacheExpirationInterval]) {
newDataSource = [pageCache objectForKey: WebPageCacheDataSourceKey];
[[self _frameLoader] loadDataSource:newDataSource withLoadType:loadType formState:nil];
inPageCache = YES;
- }
- else {
+ } else {
LOG (PageCache, "Not restoring page from back/forward cache because cache entry has expired, %@ (%3.5f > %3.5f seconds)\n", [_private->provisionalItem URL], delta, [[[self webView] preferences] _backForwardCacheExpirationInterval]);
[item setHasPageCache: NO];
}
}
WebArchive *archive = [[self dataSource] _popSubframeArchiveWithName:[childFrame name]];
- if (archive) {
+ if (archive)
[childFrame loadArchive:archive];
- } else {
+ else
[[childFrame _frameLoader] loadURL:URL referrer:referrer loadType:childLoadType target:nil triggeringEvent:nil form:nil formValues:nil];
- }
}
-- (void)_setTitle:(NSString *)title
+- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL
{
+ [[[WebHistory optionalSharedHistory] itemForURL:URL] setTitle:title];
[_private->currentItem setTitle:title];
}
[_private->currentItem setHasPageCache:NO];
}
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy
+{
+ [WebDownload _downloadWithLoadingConnection:connection
+ request:request
+ response:response
+ delegate:[[self webView] downloadDelegate]
+ proxy:proxy];
+}
+
@end
- (void)_saveDocumentAndScrollState;
-- (void)_setTitle:(NSString *)title;
+- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL;
+ (CFAbsoluteTime)_timeOfLastCompletedLoad;
- (BOOL)_canCachePage;