Reviewed by Alice.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 02:00:41 +0000 (02:00 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 02:00:41 +0000 (02:00 +0000)
        - 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: https://svn.webkit.org/repository/webkit/trunk@16730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Loader/WebDocumentLoadState.h
WebKit/Loader/WebDocumentLoadState.m
WebKit/Loader/WebFrameLoader.m
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebDataSourceInternal.h
WebKit/WebView/WebDocumentLoadStateMac.m
WebKit/WebView/WebFrame.m

index 52c617b75798ee74490a5d4e416eec03783b1359..19df6f663ac3a2781f82d681d3e9de518650ab06 100644 (file)
@@ -1,3 +1,23 @@
+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.
index ef536e7576e3391c9be4b865339301ae9ff1717b..77a7c88859f8a62f9893ec28c8377971a80a3f9d 100644 (file)
@@ -89,5 +89,6 @@
 - (NSError *)mainDocumentError;
 - (void)mainReceivedError:(NSError *)error complete:(BOOL)isComplete;
 - (void)setResponse:(NSURLResponse *)resp;
+- (void)detachFromFrameLoader;
 
 @end
index be2b2b4e9a59f94c3013ee01af0366ff3233d3ca..52169617786a0c44bd8472489a8b9146b936d8cc 100644 (file)
@@ -65,7 +65,8 @@
 
 - (void)setFrameLoader:(WebFrameLoader *)fl
 {
-    ASSERT(!fl || !frameLoader);
+    ASSERT(fl);
+    ASSERT(!frameLoader);
     
     frameLoader = fl;
 }
     return response;
 }
 
+- (void)detachFromFrameLoader
+{
+    frameLoader = nil;
+}
+
 @end
index 8ca9d6584b9ee1919c8fb41f738a678205b58aec..bf4543d8cb8b84349314e589c26f451c1d9b1a3a 100644 (file)
     ASSERT(loadState != documentLoadState);
     
     [webFrame _prepareForDataSourceReplacement];
-    [[self dataSource] _setWebFrame:nil];
+    [documentLoadState detachFromFrameLoader];
     
     [loadState retain];
     [documentLoadState release];
     ASSERT(!loadState || !provisionalDocumentLoadState);
 
     if (provisionalDocumentLoadState != documentLoadState)
-        [[self provisionalDataSource] _setWebFrame:nil];
+        [provisionalDocumentLoadState detachFromFrameLoader];
 
     [loadState retain];
     [provisionalDocumentLoadState release];
index 9d17c7f3b29c2d81a3fbed9df7aed4ecf495842b..4074461c2cafb7fba39ead2fec5677982294a839 100644 (file)
@@ -513,17 +513,6 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     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
 {
index 2cee0581d5472775b2eec2d57d6ccec713a3b363..a9233a7afbf676ec24e550fda99d7313f76e0254 100644 (file)
@@ -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;
index ba8fdf8355bf8ff79cf607e27917f2d09b0bdb0c..72fe3a05c41b9b044b0deafbc86e87e4ade87989 100644 (file)
     return dataSource;
 }
 
-- (void)setFrameLoader:(WebFrameLoader *)fl
+- (void)detachFromFrameLoader
 {
-    [super setFrameLoader:fl];
-    if (!fl)
-        [self setDataSource:nil];
+    [super detachFromFrameLoader];
+    [self setDataSource:nil];
 }
 
 @end
index 41dc90312fb2a2f7053dfc02ca7c1176bcf701c7..5ec0f5f7dd18a6aa65382594ed3548e414044e71 100644 (file)
@@ -2078,7 +2078,10 @@ exit:
     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];