- wean WebFrameLoader from WebDataSource private stuff
(actually just tweaks tot he above to make merging my future
patches easier since Darin did a lot of the same stuff)
* Loader/WebDocumentLoader.h:
* Loader/WebDocumentLoader.m:
(-[WebDocumentLoader URLForHistory]):
* Loader/WebFrameLoader.m:
(-[WebFrameLoader _loadRequest:archive:]):
(-[WebFrameLoader revertToProvisionalWithDocumentLoader:]):
(-[WebFrameLoader documentLoader:setMainDocumentError:]):
(-[WebFrameLoader finalSetupForReplaceWithDocumentLoader:]):
(-[WebFrameLoader didChangeTitleForDocument:]):
(-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]):
* Loader/WebFrameLoaderClient.h:
* WebView/WebDataSource.m:
(-[WebDataSource _URLForHistory]):
* WebView/WebFrame.m:
(-[WebFrame _addDocumentLoader:toUnarchiveState:]):
(-[WebFrame _revertToProvisionalStateForDocumentLoader:]):
(-[WebFrame _setMainDocumentError:forDocumentLoader:]):
(-[WebFrame _clearUnarchivingStateForLoader:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16936
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-09 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin.
+
+ - wean WebFrameLoader from WebDataSource private stuff
+
+ (actually just tweaks tot he above to make merging my future
+ patches easier since Darin did a lot of the same stuff)
+
+ * Loader/WebDocumentLoader.h:
+ * Loader/WebDocumentLoader.m:
+ (-[WebDocumentLoader URLForHistory]):
+ * Loader/WebFrameLoader.m:
+ (-[WebFrameLoader _loadRequest:archive:]):
+ (-[WebFrameLoader revertToProvisionalWithDocumentLoader:]):
+ (-[WebFrameLoader documentLoader:setMainDocumentError:]):
+ (-[WebFrameLoader finalSetupForReplaceWithDocumentLoader:]):
+ (-[WebFrameLoader didChangeTitleForDocument:]):
+ (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]):
+ * Loader/WebFrameLoaderClient.h:
+ * WebView/WebDataSource.m:
+ (-[WebDataSource _URLForHistory]):
+ * WebView/WebFrame.m:
+ (-[WebFrame _addDocumentLoader:toUnarchiveState:]):
+ (-[WebFrame _revertToProvisionalStateForDocumentLoader:]):
+ (-[WebFrame _setMainDocumentError:forDocumentLoader:]):
+ (-[WebFrame _clearUnarchivingStateForLoader:]):
+
2006-10-09 Darin Adler <darin@apple.com>
Reviewed by Brady.
2006-10-09 Maciej Stachowiak <mjs@apple.com>
+>>>>>>> .r16935
Reviewed by Alice.
- - moved WebFormState into Loader directory and tweaked to void WebKit dependencies
+ - moved WebFormState into Loader directory and tweaked to avoid WebKit dependencies
* Loader/WebDocumentLoader.h:
* Loader/WebFormState.h: Added.
- (NSURLRequest *)lastCheckedRequest;
- (void)stopRecordingResponses;
- (NSString *)title;
+- (NSURL *)URLForHistory;
@end
[trimmed release];
}
+- (NSURL *)URLForHistory
+{
+ // Return the URL to be used for history and B/F list.
+ // Returns nil for WebDataProtocol URLs that aren't alternates
+ // for unreachable URLs, because these can't be stored in history.
+ NSURL *URL = [originalRequestCopy URL];
+ if ([WebDataProtocol _webIsDataProtocolURL:URL])
+ URL = [originalRequestCopy _webDataRequestUnreachableURL];
+
+ return URL;
+}
+
@end
- (void)revertToProvisionalWithDocumentLoader:(WebDocumentLoader *)loader
{
- [client _revertToProvisionalWithDocumentLoader:loader];
+ [client _revertToProvisionalStateForDocumentLoader:loader];
}
- (void)documentLoader:(WebDocumentLoader *)loader setMainDocumentError:(NSError *)error
{
- [client _documentLoader:loader setMainDocumentError:error];
+ [client _setMainDocumentError:error forDocumentLoader:loader];
}
- (void)documentLoader:(WebDocumentLoader *)loader mainReceivedCompleteError:(NSError *)error
- (void)finalSetupForReplaceWithDocumentLoader:(WebDocumentLoader *)loader
{
- [client _finalSetupForReplaceWithDocumentLoader:loader];
+ [client _clearUnarchivingStateForLoader:loader];
}
- (void)prepareForLoadStart
// The title doesn't get communicated to the WebView until we are committed.
if ([loader isCommitted]) {
- NSURL *URLForHistory = [client _URLForHistoryForDocumentLoader:loader];
+ NSURL *URLForHistory = [[loader URLForHistory] _webkit_canonicalize];
if (URLForHistory != nil) {
// 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.
- (void)_dispatchDidLoadMainResourceForDocumentLoader:(WebDocumentLoader *)loader;
- (void)_clearLoadingFromPageCacheForDocumentLoader:(WebDocumentLoader *)loader;
-- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebDocumentLoader *)documentLoader;
+- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebDocumentLoader *)loader;
+- (void)_addDocumentLoader:(WebDocumentLoader *)loader toUnarchiveState:(WebArchive *)archive;
+- (void)_revertToProvisionalStateForDocumentLoader:(WebDocumentLoader *)loader;
+- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebDocumentLoader *)loader;
+- (void)_clearUnarchivingStateForLoader:(WebDocumentLoader *)loader;
- (void)_progressStarted;
- (void)_progressCompleted;
- (void)_willChangeTitleForDocument:(WebDocumentLoader *)loader;
- (void)_didChangeTitleForDocument:(WebDocumentLoader *)loader;
-- (void)_revertToProvisionalWithDocumentLoader:(WebDocumentLoader *)loader;
- (void)_committedLoadWithDocumentLoader:(WebDocumentLoader *)loader data:(NSData *)data;
- (void)_finishedLoadingDocument:(WebDocumentLoader *)loader;
- (void)_documentLoader:(WebDocumentLoader *)loader setMainDocumentError:(NSError *)error;
- (void)_finalSetupForReplaceWithDocumentLoader:(WebDocumentLoader *)loader;
-- (NSURL *)_URLForHistoryForDocumentLoader:(WebDocumentLoader *)loader;
- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request;
- (NSError *)_cannotShowURLErrorWithRequest:(NSURLRequest *)request;
- (NSURL *)_URLForHistory
{
- // Return the URL to be used for history and B/F list.
- // Returns nil for WebDataProtocol URLs that aren't alternates
- // for unreachable URLs, because these can't be stored in history.
- NSURL *URL = [[_private->loader originalRequestCopy] URL];
- if ([WebDataProtocol _webIsDataProtocolURL:URL])
- URL = [[_private->loader originalRequestCopy] _webDataRequestUnreachableURL];
-
- return [URL _webkit_canonicalize];
+ return [[_private->loader URLForHistory] _webkit_canonicalize];
}
- (void)_addToUnarchiveState:(WebArchive *)archive
[dataSource(loader) _makeRepresentation];
}
+- (void)_addDocumentLoader:(WebDocumentLoader *)loader toUnarchiveState:(WebArchive *)archive
+{
+ [dataSource(loader) _addToUnarchiveState:archive];
+}
+
+- (void)_revertToProvisionalStateForDocumentLoader:(WebDocumentLoader *)loader
+{
+ [dataSource(loader) _revertToProvisionalState];
+}
+
+- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebDocumentLoader *)loader
+{
+ [dataSource(loader) _setMainDocumentError:error];
+}
+
+- (void)_clearUnarchivingStateForLoader:(WebDocumentLoader *)loader
+{
+ [dataSource(loader) _clearUnarchivingState];
+}
+
- (void)_progressStarted
{
[[self webView] _progressStarted:self];
[dataSource(loader) _receivedData:data];
}
-- (void)_revertToProvisionalWithDocumentLoader:(WebDocumentLoader *)loader
-{
- [dataSource(loader) _revertToProvisionalState];
-}
-
- (void)_documentLoader:(WebDocumentLoader *)loader setMainDocumentError:(NSError *)error
{
[dataSource(loader) _setMainDocumentError:error];
[dataSource(loader) _clearUnarchivingState];
}
-- (NSURL *)_URLForHistoryForDocumentLoader:(WebDocumentLoader *)loader
-{
- return [dataSource(loader) _URLForHistory];
-}
-
- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request
{
return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:[request URL]];