Commit f261ddf9 authored by dimich@chromium.org's avatar dimich@chromium.org
Browse files

FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters

https://bugs.webkit.org/show_bug.cgi?id=66165

Reviewed by Darin Fisher.

Source/WebCore:

No new tests since no change in behavior.
The original issue is only reproducible on Chromium in multi-process mode
and is tested there by a browsertest.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::transferLoadingResourcesFromPage):
Passing ResourceLoader* into the FrameLoaderClient notification.
Also, fixed the bug where the same ResourceRequest was passed for all subresources.
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::transferLoadingResourceFromPage):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchTransferLoadingResourceFromPage):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchTransferLoadingResourceFromPage):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::originalRequest): Added the originalRequest() accessor that
returns the request as it existed before redirects (but after client's will SendRequest).
This is to be able to pass the original request for loading subresources into
FrameLoaderClient::transferLoadingResourceFromPage, since that one is used to invoke
assignIdentifierToInitialRequest, which needs original request.

Source/WebKit/chromium:

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::transferLoadingResourceFromPage):
* src/FrameLoaderClientImpl.h:

Source/WebKit/efl:

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientGtk.h:

Source/WebKit/haiku:

* WebCoreSupport/FrameLoaderClientHaiku.cpp:
(WebCore::FrameLoaderClientHaiku::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientHaiku.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::transferLoadingResourceFromPage):

Source/WebKit/qt:

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientQt.h:

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::transferLoadingResourceFromPage):
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit/wince:

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientWinCE.h:

Source/WebKit/wx:

* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::transferLoadingResourceFromPage):
* WebKitSupport/FrameLoaderClientWx.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transferLoadingResourceFromPage):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 36deedac
2011-08-15 Dmitry Titov <dimich@chromium.org>
FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters
https://bugs.webkit.org/show_bug.cgi?id=66165
Reviewed by Darin Fisher.
No new tests since no change in behavior.
The original issue is only reproducible on Chromium in multi-process mode
and is tested there by a browsertest.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::transferLoadingResourcesFromPage):
Passing ResourceLoader* into the FrameLoaderClient notification.
Also, fixed the bug where the same ResourceRequest was passed for all subresources.
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::transferLoadingResourceFromPage):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchTransferLoadingResourceFromPage):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchTransferLoadingResourceFromPage):
* loader/ResourceLoadNotifier.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::originalRequest): Added the originalRequest() accessor that
returns the request as it existed before redirects (but after client's will SendRequest).
This is to be able to pass the original request for loading subresources into
FrameLoaderClient::transferLoadingResourceFromPage, since that one is used to invoke
assignIdentifierToInitialRequest, which needs original request.
2011-08-15 Mark Hahnenberg <mhahnenberg@apple.com>
 
Refactor JS objects to allocate in static create methods rather than constructors
......@@ -859,19 +859,14 @@ void DocumentLoader::transferLoadingResourcesFromPage(Page* oldPage)
FrameLoader* loader = frameLoader();
ASSERT(loader);
const ResourceRequest& request = originalRequest();
if (isLoadingMainResource()) {
loader->dispatchTransferLoadingResourceFromPage(
m_mainResourceLoader->identifier(), this, request, oldPage);
}
if (isLoadingMainResource())
loader->dispatchTransferLoadingResourceFromPage(m_mainResourceLoader.get(), originalRequest(), oldPage);
if (isLoadingSubresources()) {
ResourceLoaderSet::const_iterator it = m_subresourceLoaders.begin();
ResourceLoaderSet::const_iterator end = m_subresourceLoaders.end();
for (; it != end; ++it) {
loader->dispatchTransferLoadingResourceFromPage(
(*it)->identifier(), this, request, oldPage);
}
for (; it != end; ++it)
loader->dispatchTransferLoadingResourceFromPage((*it).get(), (*it)->originalRequest(), oldPage);
}
}
......
......@@ -379,7 +379,7 @@ public:
virtual void didRunInsecureContent(SecurityOrigin*, const KURL&) { }
virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) { return 0; }
virtual void didTransferChildFrameToNewDocument(Page*) { }
virtual void transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) { }
virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*) { }
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) { return 0; }
virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) { return 0; }
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
......
......@@ -1648,9 +1648,9 @@ void FrameLoader::transferLoadingResourcesFromPage(Page* oldPage)
}
}
void FrameLoader::dispatchTransferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* docLoader, const ResourceRequest& request, Page* oldPage)
void FrameLoader::dispatchTransferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
{
notifier()->dispatchTransferLoadingResourceFromPage(identifier, docLoader, request, oldPage);
notifier()->dispatchTransferLoadingResourceFromPage(loader, request, oldPage);
}
void FrameLoader::setDocumentLoader(DocumentLoader* loader)
......
......@@ -132,7 +132,7 @@ public:
bool isLoading() const;
bool frameHasLoaded() const;
void transferLoadingResourcesFromPage(Page*);
void dispatchTransferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*);
void dispatchTransferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
int numPendingOrLoadingRequests(bool recurse) const;
String referrer() const;
......
......@@ -253,7 +253,7 @@ namespace WebCore {
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0;
virtual void didTransferChildFrameToNewDocument(Page* oldPage) = 0;
virtual void transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader*, const ResourceRequest&, Page* oldPage) = 0;
virtual void transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page* oldPage) = 0;
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
virtual void redirectDataToPlugin(Widget* pluginWidget) = 0;
......
......@@ -144,12 +144,12 @@ void ResourceLoadNotifier::dispatchDidFinishLoading(DocumentLoader* loader, unsi
InspectorInstrumentation::didFinishLoading(m_frame, loader, identifier, finishTime);
}
void ResourceLoadNotifier::dispatchTransferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage)
void ResourceLoadNotifier::dispatchTransferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
{
ASSERT(oldPage != m_frame->page());
m_frame->loader()->client()->transferLoadingResourceFromPage(identifier, loader, request, oldPage);
m_frame->loader()->client()->transferLoadingResourceFromPage(loader, request, oldPage);
oldPage->progress()->completeProgress(identifier);
oldPage->progress()->completeProgress(loader->identifier());
}
void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const char* data, int dataLength, int encodedDataLength, const ResourceError& error)
......
......@@ -62,7 +62,7 @@ public:
void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
void dispatchTransferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*);
void dispatchTransferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*);
void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, const char* data, int dataLength, int encodedDataLength, const ResourceError&);
......
......@@ -136,7 +136,7 @@ bool ResourceLoader::init(const ResourceRequest& r)
return false;
}
m_request = clientRequest;
m_originalRequest = m_request = clientRequest;
return true;
}
......
......@@ -56,6 +56,7 @@ namespace WebCore {
FrameLoader* frameLoader() const;
DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
const ResourceRequest& originalRequest() const { return m_originalRequest; }
virtual void cancel(const ResourceError&);
ResourceError cancelledError();
......@@ -166,6 +167,7 @@ namespace WebCore {
virtual void didCancel(const ResourceError&) = 0;
ResourceRequest m_request;
ResourceRequest m_originalRequest; // Before redirects.
RefPtr<SharedBuffer> m_resourceData;
unsigned long m_identifier;
......
2011-08-15 Dmitry Titov <dimich@chromium.org>
FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters
https://bugs.webkit.org/show_bug.cgi?id=66165
Reviewed by Darin Fisher.
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::transferLoadingResourceFromPage):
* src/FrameLoaderClientImpl.h:
2011-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r93060.
......
......@@ -54,6 +54,7 @@
#include "PluginData.h"
#include "PluginDataChromium.h"
#include "ProgressTracker.h"
#include "ResourceLoader.h"
#include "Settings.h"
#include "StringExtras.h"
#include "WebDataSourceImpl.h"
......@@ -1459,13 +1460,13 @@ void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*)
m_webFrame->setClient(newParent->client());
}
void FrameLoaderClientImpl::transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage)
void FrameLoaderClientImpl::transferLoadingResourceFromPage(ResourceLoader* loader, const ResourceRequest& request, Page* oldPage)
{
assignIdentifierToInitialRequest(identifier, loader, request);
assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request);
WebFrameImpl* oldWebFrame = WebFrameImpl::fromFrame(oldPage->mainFrame());
if (oldWebFrame && oldWebFrame->client())
oldWebFrame->client()->removeIdentifierForRequest(identifier);
oldWebFrame->client()->removeIdentifierForRequest(loader->identifier());
}
PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
......
......@@ -187,7 +187,7 @@ public:
const WTF::String& referrer, bool allowsScrolling,
int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(
const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&,
const Vector<WTF::String>&, const Vector<WTF::String>&,
......
2011-08-15 Dmitry Titov <dimich@chromium.org>
FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters
https://bugs.webkit.org/show_bug.cgi?id=66165
Reviewed by Darin Fisher.
* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientEfl.h:
2011-08-10 Adam Roben <aroben@apple.com>
Clear up scale factor terminology
......
......@@ -368,7 +368,7 @@ void FrameLoaderClientEfl::didTransferChildFrameToNewDocument(Page*)
{
}
void FrameLoaderClientEfl::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*)
void FrameLoaderClientEfl::transferLoadingResourceFromPage(ResourceLoader*, const ResourceRequest&, Page*)
{
}
......
......@@ -136,7 +136,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
virtual PassRefPtr<Frame> createFrame(const KURL&, const String& name, HTMLFrameOwnerElement*,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(Page*);
virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const ResourceRequest&, WebCore::Page*);
virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const ResourceRequest&, WebCore::Page*);
virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool);
virtual void redirectDataToPlugin(Widget* pluginWidget);
......
2011-08-15 Dmitry Titov <dimich@chromium.org>
FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters
https://bugs.webkit.org/show_bug.cgi?id=66165
Reviewed by Darin Fisher.
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientGtk.h:
2011-08-10 Adam Roben <aroben@apple.com>
 
Clear up scale factor terminology
......
......@@ -60,6 +60,7 @@
#include "RenderPart.h"
#include "RenderView.h"
#include "ResourceHandle.h"
#include "ResourceLoader.h"
#include "ResourceRequest.h"
#include "ScriptController.h"
#include "Settings.h"
......@@ -583,14 +584,14 @@ void FrameLoaderClient::didTransferChildFrameToNewDocument(WebCore::Page*)
ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page());
}
void FrameLoaderClient::transferLoadingResourceFromPage(unsigned long identifier, WebCore::DocumentLoader* docLoader, const WebCore::ResourceRequest& request, WebCore::Page* oldPage)
void FrameLoaderClient::transferLoadingResourceFromPage(WebCore::ResourceLoader* loader, const WebCore::ResourceRequest& request, WebCore::Page* oldPage)
{
ASSERT(oldPage != core(m_frame)->page());
GOwnPtr<gchar> identifierString(toString(identifier));
GOwnPtr<gchar> identifierString(toString(loader->identifier()));
ASSERT(!webkit_web_view_get_resource(getViewFromFrame(m_frame), identifierString.get()));
assignIdentifierToInitialRequest(identifier, docLoader, request);
assignIdentifierToInitialRequest(loader->identifier(), loader->documentLoader(), request);
webkit_web_view_remove_resource(kit(oldPage), identifierString.get());
}
......
......@@ -115,7 +115,7 @@ namespace WebKit {
virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement,
const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
virtual void didTransferChildFrameToNewDocument(WebCore::Page*);
virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
virtual void transferLoadingResourceFromPage(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, WebCore::Page*);
virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool);
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
......
2011-08-15 Dmitry Titov <dimich@chromium.org>
FrameLoaderClient::transferLoadingResourceFromPage does not have enough parameters
https://bugs.webkit.org/show_bug.cgi?id=66165
Reviewed by Darin Fisher.
* WebCoreSupport/FrameLoaderClientHaiku.cpp:
(WebCore::FrameLoaderClientHaiku::transferLoadingResourceFromPage):
* WebCoreSupport/FrameLoaderClientHaiku.h:
2011-08-10 Adam Roben <aroben@apple.com>
Clear up scale factor terminology
......
Markdown is supported
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