Reviewed by Geoff.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jul 2006 03:37:14 +0000 (03:37 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jul 2006 03:37:14 +0000 (03:37 +0000)
        - fix <rdar://problem/4609195> Help Viewer loads empty window (not getting didFailLoadingWithError: callback)
        (without re-introducing http://bugzilla.opendarwin.org/show_bug.cgi?id=10062 )

        * WebView/WebLoader.h:
        * WebView/WebMainResourceLoader.m:
        (-[WebMainResourceLoader receivedError:]): Copy in some code from the base class to do it in the proper
        order, surrounding the call to [ds _receivedMainResourceError:error complete:YES].

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

WebKit/ChangeLog
WebKit/WebView/WebLoader.h
WebKit/WebView/WebMainResourceLoader.m

index 66e5b3805a8ee147dd1dec6d17fbccbd8f58690b..acf7a1b1a4318b6febacb3420d244b0fe794b44f 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-24  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Geoff.
+        
+        - fix <rdar://problem/4609195> Help Viewer loads empty window (not getting didFailLoadingWithError: callback)
+        (without re-introducing http://bugzilla.opendarwin.org/show_bug.cgi?id=10062 )
+
+        * WebView/WebLoader.h:
+        * WebView/WebMainResourceLoader.m:
+        (-[WebMainResourceLoader receivedError:]): Copy in some code from the base class to do it in the proper
+        order, surrounding the call to [ds _receivedMainResourceError:error complete:YES].
+
 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Tim O.
index 48ee0f170d363ac7b7aacbcf69510cd7c88f8b50..029dadabd57ffea787d11f764dfe5a0b223ec8bb 100644 (file)
     BOOL reachedTerminalState;
     BOOL loadingMultipartContent;
     BOOL signalledFinish;
+    BOOL cancelledFlag;
+    id identifier;
 @private
     NSURLResponse *response;
-    id identifier;
     NSURLAuthenticationChallenge *currentConnectionChallenge;
     NSURLAuthenticationChallenge *currentWebChallenge;
-    BOOL cancelledFlag;
     BOOL defersCallbacks;
     BOOL waitingToDeliverResource;
     BOOL deliveredResource;
index ee5fdfca33e6c4a4eb9c250f6a87e9d2e8de71f4..8637a4fd752fd700c5af8cac15951955246ecc3f 100644 (file)
 {
     // Calling _receivedMainResourceError will likely result in a call to release, so we must retain.
     [self retain];
-    WebDataSource *ds = [dataSource retain];
-    [dataSource _receivedMainResourceError:error complete:YES];
-    [super didFailWithError:error];
+    WebDataSource *ds = [dataSource retain]; // super's didFailWithError will release the datasource
+
+    if (!cancelledFlag) {
+        ASSERT(!reachedTerminalState);
+        [dataSource _didFailLoadingWithError:error forResource:identifier];
+    }
+
+    [ds _receivedMainResourceError:error complete:YES];
+
+    if (!cancelledFlag)
+        [self releaseResources];
+
+    ASSERT(reachedTerminalState);
+
     [ds release];
     [self release];
 }