Reviewed by Brady.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 06:59:52 +0000 (06:59 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 06:59:52 +0000 (06:59 +0000)
        - remove "loading" flag from WebDataSource and code that manages it; it is redundat.

        * Loader/WebFrameLoader.m:
        (-[WebFrameLoader addPlugInStreamLoader:]):
        (-[WebFrameLoader removePlugInStreamLoader:]):
        (-[WebFrameLoader addSubresourceLoader:]):
        (-[WebFrameLoader removeSubresourceLoader:]):
        * WebView/WebDataSource.m:
        (-[WebDataSourcePrivate dealloc]):
        (-[WebDataSource _setPrimaryLoadComplete:]):
        (-[WebDataSource _stopLoading]):
        (-[WebDataSource _prepareForLoadStart]):
        (-[WebDataSource _startLoading]):
        (-[WebDataSource isLoading]):
        * WebView/WebDataSourceInternal.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15986 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Loader/WebFrameLoader.m
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebDataSourceInternal.h

index 77cde4961aabf8ca9ad401c9192d4a316387d7dd..c4ec0d28a50345bfb556c0a74ee358023c1cffa1 100644 (file)
@@ -1,3 +1,23 @@
+2006-08-22  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Brady.
+        
+        - remove "loading" flag from WebDataSource and code that manages it; it is redundat.
+
+        * Loader/WebFrameLoader.m:
+        (-[WebFrameLoader addPlugInStreamLoader:]):
+        (-[WebFrameLoader removePlugInStreamLoader:]):
+        (-[WebFrameLoader addSubresourceLoader:]):
+        (-[WebFrameLoader removeSubresourceLoader:]):
+        * WebView/WebDataSource.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _setPrimaryLoadComplete:]):
+        (-[WebDataSource _stopLoading]):
+        (-[WebDataSource _prepareForLoadStart]):
+        (-[WebDataSource _startLoading]):
+        (-[WebDataSource isLoading]):
+        * WebView/WebDataSourceInternal.h:
+
 2006-08-22  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Eric.
index d73491a23ff8cd4351848f2dae177b3017054dd1..2309a4c9ad766f0ebef5c907a46cd19b0c055d89 100644 (file)
     if (!plugInStreamLoaders)
         plugInStreamLoaders = [[NSMutableArray alloc] init];
     [plugInStreamLoaders addObject:loader];
-    [[self activeDataSource] _setLoading:YES];
 }
 
 - (void)removePlugInStreamLoader:(WebLoader *)loader
 {
     [plugInStreamLoaders removeObject:loader];
-    [[self activeDataSource] _updateLoading];
 }    
 
 - (void)setDefersCallbacks:(BOOL)defers
     if (subresourceLoaders == nil)
         subresourceLoaders = [[NSMutableArray alloc] init];
     [subresourceLoaders addObject:loader];
-    [[self activeDataSource] _setLoading:YES];
 }
 
 - (void)removeSubresourceLoader:(WebLoader *)loader
 {
     [subresourceLoaders removeObject:loader];
-    [[self activeDataSource] _updateLoading];
 }
 
 - (NSData *)mainResourceData
index 191ddd83a6d5ab3c111694e1e77ddea35e4d431b..dab9c22361fd36d5a4f731a0278f0f3b218d4486 100644 (file)
     // Error associated with main document.
     NSError *mainDocumentError;
     
-    BOOL loading; // self and webView are retained while loading
-    
     BOOL gotFirstByte; // got first byte
     BOOL committed; // This data source has been committed
     BOOL representationFinishedLoading;
 
 - (void)dealloc
 {
-    ASSERT(!loading);
+    ASSERT(![[webFrame _frameLoader] isLoading]);
 
     [resourceData release];
     [representation release];
     _private->representationFinishedLoading = NO;
 }
 
-- (void)_setLoading:(BOOL)loading
-{
-    _private->loading = loading;
-}
-
-- (void)_updateLoading
-{
-    WebFrameLoader *frameLoader = [_private->webFrame _frameLoader];
-    ASSERT(self == [frameLoader activeDataSource]);
-
-    [self _setLoading:[frameLoader isLoading]];
-}
-
 - (void)_setData:(NSData *)data
 {
     [data retain];
             [[_private->webFrame _frameLoader] releaseMainResourceLoader];
         }
         
-        [self _updateLoading];
-
         if ([WebScriptDebugServer listenerCount])
             [[WebScriptDebugServer sharedScriptDebugServer] webView:[[self webFrame] webView] didLoadMainResourceForDataSource:self];
     }
     if (_private->committed)
         [[self _bridge] stopLoading];
 
-    if (!_private->loading)
+    if (![[_private->webFrame _frameLoader] isLoading])
         return;
 
     [self retain];
     // Mark the start loading time.
     _private->loadingStartedTime = CFAbsoluteTimeGetCurrent();
     
-    [self _setLoading:YES];
     [[self _webView] _progressStarted:[self webFrame]];
     [[self _webView] _didStartProvisionalLoadForFrame:[self webFrame]];
     [[[self _webView] _frameLoadDelegateForwarder] webView:[self _webView]
     else
         identifier = [[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate] webView:[self _webView] identifierForInitialRequest:_private->originalRequest fromDataSource:self];
     
-    if (![[_private->webFrame _frameLoader] startLoadingMainResourceWithRequest:_private->request identifier:identifier])
-        [self _updateLoading];
+    [[_private->webFrame _frameLoader] startLoadingMainResourceWithRequest:_private->request identifier:identifier];
 }
 
 - (BOOL)_isStopping
@@ -1107,7 +1088,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     // Once a frame has loaded, we no longer need to consider subresources,
     // but we still need to consider subframes.
     if ([[[self webFrame] _frameLoader] state] != WebFrameStateComplete) {
-        if (!_private->primaryLoadComplete && _private->loading)
+        if (!_private->primaryLoadComplete && [[_private->webFrame _frameLoader] isLoading])
             return YES;
         if ([[_private->webFrame _frameLoader] isLoadingSubresources])
             return YES;
index 7c0a06b67bd000146d850f0e5c157ac7eda1e22c..3dce6e117b0d4132594646126d14cb5324007920 100644 (file)
 - (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r proxy:(WKNSURLConnectionDelegateProxyPtr) proxy;
 - (BOOL)_privateBrowsingEnabled;
 - (void)_decidePolicyForMIMEType:(NSString *)MIMEType decisionListener:(WebPolicyDecisionListener *)listener;
-- (void)_setLoading:(BOOL)loading;
-- (void)_updateLoading;
 @end