Commit c4766347 authored by beidson's avatar beidson
Browse files

WebKit:

        Reviewed by Maciej, landed by Brady

        Update URL request associated with provisional data source on redirect.
        Notify IWebFrameLoadDelegate of redirects for the provisional load.
        Notify IWebFrameLoadDelegate of a provisional load being commited.

        * COM/WebDataSource.cpp:
        (WebDataSource::replaceRequest):
        * COM/WebDataSource.h:
        * COM/WebFrame.cpp:
        (WebFrame::receivedRedirect):
        (WebFrame::receivedResponse):
        (WebFrame::receivedData):

WebKitTools:

        Reviewed by Maciej, landed by Brady

        Fix URL bar updating.

        * Spinneret/Spinneret/Spinneret.h:
        (SpinneretWebHost::didStartProvisionalLoadForFrame):
        (SpinneretWebHost::didCommitLoadForFrame):
        (SpinneretWebHost::didFinishLoadForFrame):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b8a16d03
......@@ -65,6 +65,13 @@ WebDataSource* WebDataSource::createInstance(WebFrame* frame)
return instance;
}
void WebDataSource::replaceRequest(IWebMutableURLRequest* request) {
if (m_request)
m_request->Release();
m_request = request;
m_request->AddRef();
}
// IUnknown -------------------------------------------------------------------
HRESULT STDMETHODCALLTYPE WebDataSource::QueryInterface(REFIID riid, void** ppvObject)
......
......@@ -35,6 +35,10 @@ class WebDataSource : public IWebDataSource
{
public:
static WebDataSource* createInstance(WebFrame* frame);
// Replace the request associated with this data source
void replaceRequest(IWebMutableURLRequest* request);
protected:
WebDataSource();
~WebDataSource();
......
......@@ -464,9 +464,27 @@ int WebFrame::getObjectCacheSize()
// ResourceLoaderClient
void WebFrame::receivedRedirect(ResourceLoader*, const KURL&)
void WebFrame::receivedRedirect(ResourceLoader*, const KURL& url)
{
//FIXME
DeprecatedString urlStr(url.url());
urlStr.append('\0');
// FIXME: is this the correct way to handle a redirect?
IWebMutableURLRequest* request = WebMutableURLRequest::createInstance();
BSTR urlBStr = SysAllocString((LPCTSTR)urlStr.unicode());
if (SUCCEEDED(request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 0))) {
_ASSERT(m_provisionalDataSource);
static_cast<WebDataSource*>(m_provisionalDataSource)->replaceRequest(request);
}
SysFreeString(urlBStr);
request->Release();
IWebFrameLoadDelegate* frameLoadDelegate;
if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
frameLoadDelegate->didReceiveServerRedirectForProvisionalLoadForFrame(d->webView, this);
frameLoadDelegate->Release();
}
}
void WebFrame::receivedResponse(ResourceLoader*, PlatformResponse)
......@@ -475,10 +493,22 @@ void WebFrame::receivedResponse(ResourceLoader*, PlatformResponse)
m_dataSource = m_provisionalDataSource;
m_provisionalDataSource = 0;
}
// FIXME: pass mime type of response to frame. perhaps the Frame::begin()
// should be made from here.
IWebFrameLoadDelegate* frameLoadDelegate;
if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
frameLoadDelegate->didCommitLoadForFrame(d->webView, this);
frameLoadDelegate->Release();
}
}
void WebFrame::receivedData(ResourceLoader*, const char* data, int length)
{
// Ensure that WebFrame::receivedResponse was called.
_ASSERT(m_dataSource && !m_provisionalDataSource);
d->frame->write(data, length);
}
......
2006-09-27 MorganL <morganl.webkit@yahoo.com>
Reviewed by Maciej, landed by Brady
Update URL request associated with provisional data source on redirect.
Notify IWebFrameLoadDelegate of redirects for the provisional load.
Notify IWebFrameLoadDelegate of a provisional load being commited.
* COM/WebDataSource.cpp:
(WebDataSource::replaceRequest):
* COM/WebDataSource.h:
* COM/WebFrame.cpp:
(WebFrame::receivedRedirect):
(WebFrame::receivedResponse):
(WebFrame::receivedData):
2006-09-26 John Sullivan <sullivan@apple.com>
Reviewed by Darin
......
2006-09-27 MorganL <morganl.webkit@yahoo.com>
Reviewed by Maciej, landed by Brady
Fix URL bar updating.
* Spinneret/Spinneret/Spinneret.h:
(SpinneretWebHost::didStartProvisionalLoadForFrame):
(SpinneretWebHost::didCommitLoadForFrame):
(SpinneretWebHost::didFinishLoadForFrame):
2006-09-23 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Eric.
......
......@@ -40,7 +40,7 @@ public:
// IWebFrameLoadDelegate
virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
/* [in] */ IWebView* webView,
/* [in] */ IWebFrame* /*frame*/) { return updateAddressBar(webView); }
/* [in] */ IWebFrame* /*frame*/) { return S_OK; }
virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
/* [in] */ IWebView *webView,
......@@ -53,7 +53,7 @@ public:
virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
/* [in] */ IWebView *webView,
/* [in] */ IWebFrame *frame) { return S_OK; }
/* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }
virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
/* [in] */ IWebView *webView,
......@@ -67,7 +67,7 @@ public:
virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
/* [in] */ IWebView* webView,
/* [in] */ IWebFrame* /*frame*/) { return updateAddressBar(webView); }
/* [in] */ IWebFrame* /*frame*/) { return S_OK; }
virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
/* [in] */ IWebView *webView,
......@@ -104,4 +104,4 @@ protected:
protected:
ULONG m_refCount;
};
\ No newline at end of file
};
Supports Markdown
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