Commit c98850bc authored by simonjam@chromium.org's avatar simonjam@chromium.org

Consolidate FrameLoader::load() into one function taking a FrameLoadRequest

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

Reviewed by Adam Barth.

Source/WebCore:

There's a FIXME that we have too many FrameLoader::load*() functions. This patch consolidates 3 into 1.
There are still a few more load functions that will be consolidated later. Using FrameLoadRequest as
the interface into FrameLoader will also provide a place to pass in the initiator. Finally, this matches
the refactoring done with CachedResourceRequest and CachedResourceLoader.

No new tests. No change in functionality.

* WebCore.exp.in:
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::setLockHistory): These are former arguments to load().
(WebCore::FrameLoadRequest::lockHistory): Ditto.
(FrameLoadRequest):
(WebCore::FrameLoadRequest::setShouldCheckNewWindowPolicy): Ditto.
(WebCore::FrameLoadRequest::shouldCheckNewWindowPolicy): Ditto.
(WebCore::FrameLoadRequest::substituteData): Ditto.
(WebCore::FrameLoadRequest::setSubstituteData): Ditto.
(WebCore::FrameLoadRequest::hasSubstituteData): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load): No change in behavior, just merged it all into one function.
* loader/FrameLoader.h:
(FrameLoader):
* page/DragController.cpp:
(WebCore::DragController::performDrag):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::load):
(BlackBerry::WebKit::WebPagePrivate::loadString):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad):

Source/WebKit/chromium:

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::loadRequest):
(WebKit::WebFrameImpl::loadData):
* src/WebSharedWorkerImpl.cpp:
(WebKit::WebSharedWorkerImpl::initializeLoader):

Source/WebKit/efl:

* ewk/ewk_frame.cpp:
(_ewk_frame_contents_set_internal):

Source/WebKit/gtk:

* webkit/webkitwebframe.cpp:
(webkit_web_frame_load_uri):
(webkit_web_frame_load_data):
(webkit_web_frame_load_request):

Source/WebKit/mac:

* Plugins/WebPluginController.mm:
* WebView/WebFrame.mm:
(-[WebFrame loadRequest:]):
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):

Source/WebKit/qt:

* Api/qwebframe.cpp:
(QWebFrame::QWebFrame):
(QWebFrame::load):
(QWebFrame::setHtml):
(QWebFrame::setContent):
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setAlternateHtml):
(qt_dump_set_accepts_editing):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::callErrorPageExtension):

Source/WebKit/win:

* WebFrame.cpp:
(WebFrame::loadRequest):
(WebFrame::loadData):

Source/WebKit/wince:

* WebView.cpp:
(WebView::load):

Source/WebKit/wx:

* WebFrame.cpp:
(WebKit::WebFrame::SetPageSource):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performFrameLoadURLRequest):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURLRequest):
(WebKit::WebPage::loadData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9eaf1179
......@@ -1633,6 +1633,7 @@ SET(WebCore_SOURCES
loader/FTPDirectoryParser.cpp
loader/FormState.cpp
loader/FormSubmission.cpp
loader/FrameLoadRequest.cpp
loader/FrameLoader.cpp
loader/FrameLoaderStateMachine.cpp
loader/HistoryController.cpp
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
There's a FIXME that we have too many FrameLoader::load*() functions. This patch consolidates 3 into 1.
There are still a few more load functions that will be consolidated later. Using FrameLoadRequest as
the interface into FrameLoader will also provide a place to pass in the initiator. Finally, this matches
the refactoring done with CachedResourceRequest and CachedResourceLoader.
No new tests. No change in functionality.
* WebCore.exp.in:
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::setLockHistory): These are former arguments to load().
(WebCore::FrameLoadRequest::lockHistory): Ditto.
(FrameLoadRequest):
(WebCore::FrameLoadRequest::setShouldCheckNewWindowPolicy): Ditto.
(WebCore::FrameLoadRequest::shouldCheckNewWindowPolicy): Ditto.
(WebCore::FrameLoadRequest::substituteData): Ditto.
(WebCore::FrameLoadRequest::setSubstituteData): Ditto.
(WebCore::FrameLoadRequest::hasSubstituteData): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load): No change in behavior, just merged it all into one function.
* loader/FrameLoader.h:
(FrameLoader):
* page/DragController.cpp:
(WebCore::DragController::performDrag):
2012-11-27 Jer Noble <jer.noble@apple.com>
Unreviewed build fix; NSSize is not a CGSize in 32-bit.
......@@ -3874,13 +3874,14 @@ webcore_sources += \
Source/WebCore/loader/FormState.h \
Source/WebCore/loader/FormSubmission.cpp \
Source/WebCore/loader/FormSubmission.h \
Source/WebCore/loader/FrameLoadRequest.cpp \
Source/WebCore/loader/FrameLoadRequest.h \
Source/WebCore/loader/FrameLoaderClient.h \
Source/WebCore/loader/FrameLoader.cpp \
Source/WebCore/loader/FrameLoader.h \
Source/WebCore/loader/FrameLoaderStateMachine.cpp \
Source/WebCore/loader/FrameLoaderStateMachine.h \
Source/WebCore/loader/FrameLoaderTypes.h \
Source/WebCore/loader/FrameLoadRequest.h \
Source/WebCore/loader/FrameNetworkingContext.h \
Source/WebCore/loader/FTPDirectoryParser.cpp \
Source/WebCore/loader/FTPDirectoryParser.h \
......
......@@ -831,6 +831,7 @@ SOURCES += \
loader/EmptyClients.cpp \
loader/FormState.cpp \
loader/FormSubmission.cpp \
loader/FrameLoadRequest.cpp \
loader/FrameLoader.cpp \
loader/FrameLoaderStateMachine.cpp \
loader/HistoryController.cpp \
......
......@@ -107,9 +107,7 @@ __ZN7WebCore11FrameLoader23timeOfLastCompletedLoadEv
__ZN7WebCore11FrameLoader26reloadWithOverrideEncodingERKN3WTF6StringE
__ZN7WebCore11FrameLoader32setOriginalURLForDownloadRequestERNS_15ResourceRequestE
__ZN7WebCore11FrameLoader4initEv
__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKN3WTF6StringEb
__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_14SubstituteDataEb
__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestEb
__ZN7WebCore11FrameLoader4loadERKNS_16FrameLoadRequestE
__ZN7WebCore11FrameLoader6reloadEb
__ZN7WebCore11FrameLoader9setOpenerEPNS_5FrameE
__ZN7WebCore11HistoryItem10targetItemEv
......@@ -431,6 +429,7 @@ __ZN7WebCore16DeviceMotionData12RotationRate6createEbdbdbd
__ZN7WebCore16DeviceMotionData6createEN3WTF10PassRefPtrINS0_12AccelerationEEES4_NS2_INS0_12RotationRateEEEbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataD1Ev
__ZN7WebCore16FrameLoadRequestC1EPNS_5FrameERKNS_15ResourceRequestERKNS_14SubstituteDataE
__ZN7WebCore16HTMLInputElement8setValueERKN3WTF6StringENS_22TextFieldEventBehaviorE
__ZN7WebCore16HTMLInputElement13setAutofilledEb
__ZN7WebCore16HTMLInputElement15setEditingValueERKN3WTF6StringE
......
......@@ -2949,6 +2949,7 @@
'loader/FTPDirectoryParser.h',
'loader/FormState.cpp',
'loader/FormSubmission.cpp',
'loader/FrameLoadRequest.cpp',
'loader/FrameLoader.cpp',
'loader/FrameLoaderStateMachine.cpp',
'loader/HistoryController.cpp',
......
......@@ -27645,6 +27645,10 @@
RelativePath="..\loader\FrameLoaderTypes.h"
>
</File>
<File
RelativePath="..\loader\FrameLoadRequest.cpp"
>
</File>
<File
RelativePath="..\loader\FrameLoadRequest.h"
>
......@@ -2997,6 +2997,7 @@
86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */; };
86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */; };
86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */; };
86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */; };
86BE340015058CB200CE0FD8 /* PerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */; };
86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; };
86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */; };
......@@ -10244,6 +10245,7 @@
86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceResourceTiming.cpp; sourceTree = "<group>"; };
86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceResourceTiming.h; sourceTree = "<group>"; };
86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceResourceTiming.idl; sourceTree = "<group>"; };
86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoadRequest.cpp; sourceTree = "<group>"; };
86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntry.cpp; sourceTree = "<group>"; };
86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntry.h; sourceTree = "<group>"; };
86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntry.idl; sourceTree = "<group>"; };
......@@ -20842,6 +20844,7 @@
D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */,
D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */,
93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */,
86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */,
658436850AE01B7400E53753 /* FrameLoadRequest.h */,
628D214D12131EF40055DCFC /* FrameNetworkingContext.h */,
51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */,
......@@ -28935,6 +28938,7 @@
CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */,
447958051643B4B2001E0A7F /* ParsedContentType.cpp in Sources */,
15B8B7C81652C5220036EF55 /* JSWebKitCSSMixFunctionValue.cpp in Sources */,
86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "FrameLoadRequest.h"
#include "Document.h"
#include "Frame.h"
namespace WebCore {
FrameLoadRequest::FrameLoadRequest(Frame* frame, const ResourceRequest& resourceRequest, const SubstituteData& substituteData)
: m_requester(frame->document()->securityOrigin())
, m_resourceRequest(resourceRequest)
, m_lockHistory(false)
, m_shouldCheckNewWindowPolicy(false)
, m_substituteData(substituteData)
{
}
} // namespace WebCore
......@@ -28,19 +28,25 @@
#include "ResourceRequest.h"
#include "SecurityOrigin.h"
#include "SubstituteData.h"
namespace WebCore {
class Frame;
struct FrameLoadRequest {
public:
explicit FrameLoadRequest(SecurityOrigin* requester)
: m_requester(requester)
, m_lockHistory(false)
, m_shouldCheckNewWindowPolicy(false)
{
}
FrameLoadRequest(SecurityOrigin* requester, const ResourceRequest& resourceRequest)
: m_requester(requester)
, m_resourceRequest(resourceRequest)
, m_lockHistory(false)
, m_shouldCheckNewWindowPolicy(false)
{
}
......@@ -48,9 +54,13 @@ public:
: m_requester(requester)
, m_resourceRequest(resourceRequest)
, m_frameName(frameName)
, m_lockHistory(false)
, m_shouldCheckNewWindowPolicy(false)
{
}
FrameLoadRequest(Frame*, const ResourceRequest&, const SubstituteData& = SubstituteData());
bool isEmpty() const { return m_resourceRequest.isEmpty(); }
const SecurityOrigin* requester() const { return m_requester.get(); }
......@@ -61,10 +71,23 @@ public:
const String& frameName() const { return m_frameName; }
void setFrameName(const String& frameName) { m_frameName = frameName; }
void setLockHistory(bool lockHistory) { m_lockHistory = lockHistory; }
bool lockHistory() const { return m_lockHistory; }
void setShouldCheckNewWindowPolicy(bool checkPolicy) { m_shouldCheckNewWindowPolicy = checkPolicy; }
bool shouldCheckNewWindowPolicy() const { return m_shouldCheckNewWindowPolicy; }
const SubstituteData& substituteData() const { return m_substituteData; }
void setSubstituteData(const SubstituteData& data) { m_substituteData = data; }
bool hasSubstituteData() { return m_substituteData.isValid(); }
private:
RefPtr<SecurityOrigin> m_requester;
ResourceRequest m_resourceRequest;
String m_frameName;
bool m_lockHistory;
bool m_shouldCheckNewWindowPolicy;
SubstituteData m_substituteData;
};
}
......
......@@ -1252,36 +1252,36 @@ SubstituteData FrameLoader::defaultSubstituteDataForURL(const KURL& url)
return SubstituteData(SharedBuffer::create(encodedSrcdoc.data(), encodedSrcdoc.length()), "text/html", "UTF-8", KURL());
}
void FrameLoader::load(const ResourceRequest& request, bool lockHistory)
void FrameLoader::load(const FrameLoadRequest& passedRequest)
{
load(request, defaultSubstituteDataForURL(request.url()), lockHistory);
}
FrameLoadRequest request(passedRequest);
void FrameLoader::load(const ResourceRequest& request, const SubstituteData& substituteData, bool lockHistory)
{
if (m_inStopAllLoaders)
return;
RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, substituteData);
if (lockHistory && m_documentLoader)
loader->setClientRedirectSourceForHistory(m_documentLoader->didCreateGlobalHistoryEntry() ? m_documentLoader->urlForHistory().string() : m_documentLoader->clientRedirectSourceForHistory());
load(loader.get());
}
void FrameLoader::load(const ResourceRequest& request, const String& frameName, bool lockHistory)
{
if (frameName.isEmpty()) {
load(request, lockHistory);
return;
if (!request.frameName().isEmpty()) {
Frame* frame = findFrameForNavigation(request.frameName());
if (frame) {
request.setShouldCheckNewWindowPolicy(false);
if (frame->loader() != this) {
frame->loader()->load(request);
return;
}
}
}
Frame* frame = findFrameForNavigation(frameName);
if (frame) {
frame->loader()->load(request, lockHistory);
if (request.shouldCheckNewWindowPolicy()) {
policyChecker()->checkNewWindowPolicy(NavigationAction(request.resourceRequest(), NavigationTypeOther), FrameLoader::callContinueLoadAfterNewWindowPolicy, request.resourceRequest(), 0, request.frameName(), this);
return;
}
policyChecker()->checkNewWindowPolicy(NavigationAction(request, NavigationTypeOther), FrameLoader::callContinueLoadAfterNewWindowPolicy, request, 0, frameName, this);
if (!request.hasSubstituteData())
request.setSubstituteData(defaultSubstituteDataForURL(request.resourceRequest().url()));
RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request.resourceRequest(), request.substituteData());
if (request.lockHistory() && m_documentLoader)
loader->setClientRedirectSourceForHistory(m_documentLoader->didCreateGlobalHistoryEntry() ? m_documentLoader->urlForHistory().string() : m_documentLoader->clientRedirectSourceForHistory());
load(loader.get());
}
void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const NavigationAction& action, bool lockHistory, FrameLoadType type, PassRefPtr<FormState> formState)
......
......@@ -104,9 +104,8 @@ public:
void loadFrameRequest(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest and loadURL.
PassRefPtr<Event>, PassRefPtr<FormState>, ShouldSendReferrer);
void load(const ResourceRequest&, bool lockHistory); // Called by WebFrame, calls load(ResourceRequest, SubstituteData).
void load(const ResourceRequest&, const SubstituteData&, bool lockHistory); // Called both by WebFrame and internally, calls load(DocumentLoader*).
void load(const ResourceRequest&, const String& frameName, bool lockHistory); // Called by WebPluginController.
void load(const FrameLoadRequest&);
#if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
void loadArchive(PassRefPtr<Archive>);
#endif
......
......@@ -42,6 +42,7 @@
#include "EventHandler.h"
#include "FloatRect.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameSelection.h"
#include "FrameView.h"
......@@ -237,7 +238,7 @@ bool DragController::performDrag(DragData* dragData)
return false;
m_client->willPerformDragDestinationAction(DragDestinationActionLoad, dragData);
m_page->mainFrame()->loader()->load(ResourceRequest(dragData->asURL(m_page->mainFrame())), false);
m_page->mainFrame()->loader()->load(FrameLoadRequest(m_page->mainFrame(), ResourceRequest(dragData->asURL(m_page->mainFrame()))));
return true;
}
......
......@@ -440,7 +440,10 @@ void PluginView::performRequest(PluginRequest* request)
// PluginView, so we protect it. <rdar://problem/6991251>
RefPtr<PluginView> protect(this);
m_parentFrame->loader()->load(request->frameLoadRequest().resourceRequest(), targetFrameName, false);
FrameLoadRequest frameRequest(m_parentFrame.get(), request->frameLoadRequest().resourceRequest());
frameRequest.setFrameName(targetFrameName);
frameRequest.setShouldCheckNewWindowPolicy(true);
m_parentFrame->loader()->load(frameRequest);
// FIXME: <rdar://problem/4807469> This should be sent when the document has finished loading
if (request->sendNotification()) {
......
......@@ -56,6 +56,7 @@
#include "EditorClientBlackBerry.h"
#include "FocusController.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoaderClientBlackBerry.h"
#if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
#include "GeolocationClientMock.h"
......@@ -702,7 +703,10 @@ void WebPagePrivate::load(const BlackBerry::Platform::String& url, const BlackBe
request.setSuggestedSaveName(suggestedSaveName);
m_mainFrame->loader()->load(request, "" /* name */, false);
FrameLoadRequest frameRequest(m_mainFrame, request);
frameRequest.setFrameName("");
frameRequest.setShouldCheckNewWindowPolicy(true);
m_mainFrame->loader()->load(frameRequest);
}
void WebPage::load(const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& networkToken, bool isInitial)
......@@ -747,7 +751,7 @@ void WebPagePrivate::loadString(const BlackBerry::Platform::String& string, cons
extractMIMETypeFromMediaType(contentType),
extractCharsetFromMediaType(contentType),
!failingURL.empty() ? parseUrl(failingURL) : KURL());
m_mainFrame->loader()->load(request, substituteData, false);
m_mainFrame->loader()->load(FrameLoadRequest(m_mainFrame, request, substituteData));
}
void WebPage::loadString(const BlackBerry::Platform::String& string, const BlackBerry::Platform::String& baseURL, const BlackBerry::Platform::String& mimeType, const BlackBerry::Platform::String& failingURL)
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::load):
(BlackBerry::WebKit::WebPagePrivate::loadString):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad):
2012-11-27 Jacky Jiang <zhajiang@rim.com>
[BlackBerry] http:// origins can navigate to privileged local:// origins
......
......@@ -34,6 +34,7 @@
#include "CredentialTransformData.h"
#include "DumpRenderTreeClient.h"
#include "ExternalExtension.h"
#include "FrameLoadRequest.h"
#include "FrameNetworkingContextBlackBerry.h"
#include "FrameView.h"
#include "HTMLFormElement.h"
......@@ -750,7 +751,7 @@ void FrameLoaderClientBlackBerry::dispatchDidFailProvisionalLoad(const ResourceE
}
m_loadingErrorPage = true;
m_frame->loader()->load(originalRequest, errorData, false);
m_frame->loader()->load(FrameLoadRequest(m_frame, originalRequest, errorData));
}
void FrameLoaderClientBlackBerry::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState>)
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::loadRequest):
(WebKit::WebFrameImpl::loadData):
* src/WebSharedWorkerImpl.cpp:
(WebKit::WebSharedWorkerImpl::initializeLoader):
2012-11-27 Eberhard Graether <egraether@google.com>
[chromium] Add WebLayerTreeViewClient API to request font atlas
......
......@@ -957,7 +957,7 @@ void WebFrameImpl::loadRequest(const WebURLRequest& request)
return;
}
frame()->loader()->load(resourceRequest, false);
frame()->loader()->load(FrameLoadRequest(frame(), resourceRequest));
}
void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
......@@ -976,8 +976,6 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL, bool replace)
{
ASSERT(frame());
SubstituteData substData(data, mimeType, textEncoding, unreachableURL);
ASSERT(substData.isValid());
// If we are loading substitute data to replace an existing load, then
// inherit all of the properties of that original request. This way,
......@@ -990,7 +988,9 @@ void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, cons
request = frame()->loader()->originalRequest();
request.setURL(baseURL);
frame()->loader()->load(request, substData, false);
FrameLoadRequest frameRequest(frame(), request, SubstituteData(data, mimeType, textEncoding, unreachableURL));
ASSERT(frameRequest.substituteData().isValid());
frame()->loader()->load(frameRequest);
if (replace) {
// Do this to force WebKit to treat the load as replacing the currently
// loaded page.
......
......@@ -34,6 +34,7 @@
#include "CrossThreadTask.h"
#include "DatabaseTask.h"
#include "Document.h"
#include "FrameLoadRequest.h"
#include "GroupSettings.h"
#include "KURL.h"
#include "MessageEvent.h"
......@@ -130,10 +131,9 @@ void WebSharedWorkerImpl::initializeLoader(const WebURL& url)
// Construct substitute data source for the 'shadow page'. We only need it
// to have same origin as the worker so the loading checks work correctly.
CString content("");
int len = static_cast<int>(content.length());
RefPtr<SharedBuffer> buf(SharedBuffer::create(content.data(), len));
SubstituteData substData(buf, String("text/html"), String("UTF-8"), KURL());
webFrame->frame()->loader()->load(ResourceRequest(url), substData, false);
int length = static_cast<int>(content.length());
RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length));
webFrame->frame()->loader()->load(FrameLoadRequest(webFrame->frame(), ResourceRequest(url), SubstituteData(buffer, "text/html", "UTF-8", KURL())));
// This document will be used as 'loading context' for the worker.
m_loadingDocument = webFrame->frame()->document();
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
* ewk/ewk_frame.cpp:
(_ewk_frame_contents_set_internal):
2012-11-27 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r135786.
......
......@@ -30,6 +30,7 @@
#include "DocumentMarkerController.h"
#include "EventHandler.h"
#include "FocusController.h"
#include "FrameLoadRequest.h"
#include "FrameLoaderClientEfl.h"
#include "FrameView.h"
#include "HTMLCollection.h"
......@@ -338,7 +339,7 @@ Eina_Bool ewk_frame_uri_set(Evas_Object* ewkFrame, const char* uri)
WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(uri));
WebCore::ResourceRequest req(kurl);
WebCore::FrameLoader* loader = smartData->frame->loader();
loader->load(req, false);
loader->load(WebCore::FrameLoadRequest(smartData->frame, req));
return true;
}
......@@ -416,7 +417,7 @@ static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data* smartDat
baseKURL, unreachableKURL);
WebCore::ResourceRequest request(baseKURL);
smartData->frame->loader()->load(request, substituteData, false);
smartData->frame->loader()->load(WebCore::FrameLoadRequest(smartData->frame, request, substituteData));
return true;
}
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
* webkit/webkitwebframe.cpp:
(webkit_web_frame_load_uri):
(webkit_web_frame_load_data):
(webkit_web_frame_load_request):
2012-11-27 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r135786.
......
......@@ -33,6 +33,7 @@
#include "DocumentFragment.h"
#include "DocumentLoader.h"
#include "DocumentLoaderGtk.h"
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGtk.h"
#include "FrameSelection.h"
......@@ -674,7 +675,7 @@ void webkit_web_frame_load_uri(WebKitWebFrame* frame, const gchar* uri)
if (!coreFrame)
return;
coreFrame->loader()->load(ResourceRequest(KURL(KURL(), String::fromUTF8(uri))), false);
coreFrame->loader()->load(FrameLoadRequest(coreFrame, ResourceRequest(KURL(KURL(), String::fromUTF8(uri)))));
}
static void webkit_web_frame_load_data(WebKitWebFrame* frame, const gchar* content, const gchar* mimeType, const gchar* encoding, const gchar* baseURL, const gchar* unreachableURL)
......@@ -693,7 +694,7 @@ static void webkit_web_frame_load_data(WebKitWebFrame* frame, const gchar* conte
KURL(KURL(), String::fromUTF8(unreachableURL)),
KURL(KURL(), String::fromUTF8(unreachableURL)));
coreFrame->loader()->load(request, substituteData, false);
coreFrame->loader()->load(FrameLoadRequest(coreFrame, request, substituteData));
}
/**
......@@ -762,7 +763,7 @@ void webkit_web_frame_load_request(WebKitWebFrame* frame, WebKitNetworkRequest*
if (!coreFrame)
return;
coreFrame->loader()->load(core(request), false);
coreFrame->loader()->load(FrameLoadRequest(coreFrame->document()->securityOrigin(), core(request)));
}
/**
......
2012-11-27 James Simonsen <simonjam@chromium.org>
Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
https://bugs.webkit.org/show_bug.cgi?id=102151
Reviewed by Adam Barth.
* Plugins/WebPluginController.mm:
* WebView/WebFrame.mm:
(-[WebFrame loadRequest:]):
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
2012-11-27 Pratik Solanki <psolanki@apple.com>
objc/objc-runtime.h does not exist on all PLATFORM(MAC)
......
......@@ -50,6 +50,7 @@
#import <Foundation/NSURLRequest.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoadRequest.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/HTMLMediaElement.h>
#import <WebCore/HTMLNames.h>
......@@ -401,7 +402,10 @@ static void cancelOutstandingCheck(const void *item, void *context)
LOG_ERROR("could not load URL %@", [request URL]);
return;
}
core(frame)->loader()->load(request, target, false);
FrameLoadRequest frameRequest(core(frame), request);
frameRequest.setFrameName(target);
frameRequest.setShouldCheckNewWindowPolicy(true);
core(frame)->loader()->load(frameRequest);
}
}
......
......@@ -67,6 +67,7 @@
#import <WebCore/EventHandler.h>
#import <WebCore/EventNames.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoadRequest.h>
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameLoaderStateMachine.h>
#import <WebCore/FrameTree.h>