2006-10-05 MorganL <morganl.webkit@yahoo.com>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Oct 2006 21:43:22 +0000 (21:43 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Oct 2006 21:43:22 +0000 (21:43 +0000)
        Reviewed by Darin.

        Fixes http://bugs.webkit.org/show_bug.cgi?id=11162

        * COM/WebFrame.cpp:
        (WebFrame::loadDataSource):
        (WebFrame::receivedResponse):

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

WebKit/COM/WebFrame.cpp
WebKit/ChangeLog

index 3ebbbfec5ee9d7e59fd013a4a29b1ce20f838eee..0b9d5b0e521a7a1d4757fbfab292aed5815e9394 100644 (file)
@@ -372,7 +372,6 @@ HRESULT WebFrame::loadDataSource(WebDataSource* dataSource)
             if (SUCCEEDED(hr)) {
                 KURL kurl(DeprecatedString((DeprecatedChar*)url, SysStringLen(url)));
                 d->frame->didOpenURL(kurl);
-                d->frame->begin(kurl);
                 String methodString(method, SysStringLen(method));
                 const FormData* formData = 0;
                 if (wcscmp(method, TEXT("GET"))) {
@@ -487,13 +486,32 @@ void WebFrame::receivedRedirect(ResourceLoader*, const KURL& url)
 
 void WebFrame::receivedResponse(ResourceLoader*, PlatformResponse)
 {
+    // Commit the provisional data source
+
     if (m_provisionalDataSource) {
         m_dataSource = m_provisionalDataSource;
         m_provisionalDataSource = 0;
     }
 
-    // FIXME: pass mime type of response to frame.  perhaps the Frame::begin() 
-    // should be made from here.
+    // Tell the Frame to expect new data.  We use the URL of the data source in
+    // order to account for redirects.
+
+    IWebMutableURLRequest* request;
+    m_dataSource->request(&request);
+
+    BSTR url;
+    request->URL(&url);
+    request->Release();
+
+    KURL kurl(DeprecatedString((DeprecatedChar*)url, SysStringLen(url)));
+    SysFreeString(url);
+
+    // Update MIME info
+    ResourceRequest r(d->frame->resourceRequest());    
+    r.m_responseMIMEType = "text/html";  // FIXME: get from PlatformResponse
+    d->frame->setResourceRequest(r);
+
+    d->frame->begin(kurl);
 
     IWebFrameLoadDelegate* frameLoadDelegate;
     if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
index 4fc342e02ae14ea244caec5ed01a05786cd0f893..397b0acfc4991f075feffc331df07c99543a40cc 100644 (file)
@@ -1,3 +1,13 @@
+2006-10-05  MorganL  <morganl.webkit@yahoo.com>
+
+        Reviewed by Darin.
+
+        Fixes http://bugs.webkit.org/show_bug.cgi?id=11162
+
+        * COM/WebFrame.cpp:
+        (WebFrame::loadDataSource):
+        (WebFrame::receivedResponse):
+
 2006-10-05  Don Gibson  <dgibson77@gmail.com>
 
         Reviewed by Darin, landed by Adam.