Commit d3da1eb3 authored by mjs's avatar mjs

Reviewed by Alice.

        
        - take away direct knowledge of WebFrame from WebDataSource

        * Loader/WebDocumentLoadState.h:
        * Loader/WebDocumentLoadState.m:
        (-[WebDocumentLoadState setFrameLoader:]):
        (-[WebDocumentLoadState detachFromFrameLoader]):
        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader _setDocumentLoadState:]):
        (-[WebFrameLoader _setProvisionalDocumentLoadState:]):
        * WebView/WebDataSource.m:
        * WebView/WebDataSourceInternal.h:
        * WebView/WebDocumentLoadStateMac.m:
        (-[WebDocumentLoadStateMac detachFromFrameLoader]):
        * WebView/WebFrame.m:
        (-[WebFrame _loadDataSource:withLoadType:formState:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b3bfc62f
2006-10-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Alice.
- take away direct knowledge of WebFrame from WebDataSource
* Loader/WebDocumentLoadState.h:
* Loader/WebDocumentLoadState.m:
(-[WebDocumentLoadState setFrameLoader:]):
(-[WebDocumentLoadState detachFromFrameLoader]):
* Loader/WebFrameLoader.m:
(-[WebFrameLoader _setDocumentLoadState:]):
(-[WebFrameLoader _setProvisionalDocumentLoadState:]):
* WebView/WebDataSource.m:
* WebView/WebDataSourceInternal.h:
* WebView/WebDocumentLoadStateMac.m:
(-[WebDocumentLoadStateMac detachFromFrameLoader]):
* WebView/WebFrame.m:
(-[WebFrame _loadDataSource:withLoadType:formState:]):
2006-10-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
......
......@@ -89,5 +89,6 @@
- (NSError *)mainDocumentError;
- (void)mainReceivedError:(NSError *)error complete:(BOOL)isComplete;
- (void)setResponse:(NSURLResponse *)resp;
- (void)detachFromFrameLoader;
@end
......@@ -65,7 +65,8 @@ - (void)dealloc
- (void)setFrameLoader:(WebFrameLoader *)fl
{
ASSERT(!fl || !frameLoader);
ASSERT(fl);
ASSERT(!frameLoader);
frameLoader = fl;
}
......@@ -344,4 +345,9 @@ - (NSURLResponse *)response
return response;
}
- (void)detachFromFrameLoader
{
frameLoader = nil;
}
@end
......@@ -231,7 +231,7 @@ - (void)_setDocumentLoadState:(WebDocumentLoadState *)loadState
ASSERT(loadState != documentLoadState);
[webFrame _prepareForDataSourceReplacement];
[[self dataSource] _setWebFrame:nil];
[documentLoadState detachFromFrameLoader];
[loadState retain];
[documentLoadState release];
......@@ -275,7 +275,7 @@ - (void)_setProvisionalDocumentLoadState:(WebDocumentLoadState *)loadState
ASSERT(!loadState || !provisionalDocumentLoadState);
if (provisionalDocumentLoadState != documentLoadState)
[[self provisionalDataSource] _setWebFrame:nil];
[provisionalDocumentLoadState detachFromFrameLoader];
[loadState retain];
[provisionalDocumentLoadState release];
......
......@@ -513,17 +513,6 @@ - (NSString *)_title
return _private->pageTitle;
}
- (void)_setWebFrame:(WebFrame *)frame
{
[self retain];
[_private->loadState setFrameLoader:[frame _frameLoader]];
if (frame)
[_private->loadState setDataSource:self];
[self release];
}
// May return nil if not initialized with a URL.
- (NSURL *)_URL
{
......
......@@ -74,7 +74,6 @@
- (WebArchive *)_popSubframeArchiveWithName:(NSString *)frameName;
- (void)_loadFromPageCache:(NSDictionary *)pageCache;
- (NSURL *)_URL;
- (void)_setWebFrame:(WebFrame *)frame;
- (NSString *)_title;
- (DOMElement *)_imageElementWithImageResource:(WebResource *)resource;
- (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource;
......
......@@ -60,11 +60,10 @@ - (WebDataSource *)dataSource
return dataSource;
}
- (void)setFrameLoader:(WebFrameLoader *)fl
- (void)detachFromFrameLoader
{
[super setFrameLoader:fl];
if (!fl)
[self setDataSource:nil];
[super detachFromFrameLoader];
[self setDataSource:nil];
}
@end
......
......@@ -2078,7 +2078,10 @@ - (void)_loadDataSource:(WebDataSource *)newDataSource withLoadType:(WebFrameLoa
WebFrame *parentFrame = [self parentFrame];
if (parentFrame)
[newDataSource _setOverrideEncoding:[[parentFrame dataSource] _overrideEncoding]];
[newDataSource _setWebFrame:self];
WebDocumentLoadStateMac *loadState = (WebDocumentLoadStateMac *)[newDataSource _documentLoadState];
[loadState setFrameLoader:_private->frameLoader];
[loadState setDataSource:newDataSource];
[self _invalidatePendingPolicyDecisionCallingDefaultAction:YES];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment