#ifndef FrameLoadRequest_h
#define FrameLoadRequest_h
#include "core/dom/Document.h"
#include "core/events/Event.h"
#include "core/html/HTMLFormElement.h"
#include "core/loader/FrameLoaderTypes.h"
#include "core/loader/SubstituteData.h"
#include "platform/network/ResourceRequest.h"
namespace WebCore {
class LocalFrame;
struct FrameLoadRequest {
public:
explicit FrameLoadRequest(Document* originDocument)
: m_originDocument(originDocument)
, m_lockBackForwardList(false)
, m_clientRedirect(NotClientRedirect)
, m_shouldSendReferrer(MaybeSendReferrer)
{
}
FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest)
: m_originDocument(originDocument)
, m_resourceRequest(resourceRequest)
, m_lockBackForwardList(false)
, m_clientRedirect(NotClientRedirect)
, m_shouldSendReferrer(MaybeSendReferrer)
{
}
FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest, const AtomicString& frameName)
: m_originDocument(originDocument)
, m_resourceRequest(resourceRequest)
, m_frameName(frameName)
, m_lockBackForwardList(false)
, m_clientRedirect(NotClientRedirect)
, m_shouldSendReferrer(MaybeSendReferrer)
{
}
FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest, const SubstituteData& substituteData)
: m_originDocument(originDocument)
, m_resourceRequest(resourceRequest)
, m_substituteData(substituteData)
, m_lockBackForwardList(false)
, m_clientRedirect(NotClientRedirect)
, m_shouldSendReferrer(MaybeSendReferrer)
{
}
Document* originDocument() const { return m_originDocument.get(); }
ResourceRequest& resourceRequest() { return m_resourceRequest; }
const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
const AtomicString& frameName() const { return m_frameName; }
void setFrameName(const AtomicString& frameName) { m_frameName = frameName; }
const SubstituteData& substituteData() const { return m_substituteData; }
bool lockBackForwardList() const { return m_lockBackForwardList; }
void setLockBackForwardList(bool lockBackForwardList) { m_lockBackForwardList = lockBackForwardList; }
ClientRedirectPolicy clientRedirect() const { return m_clientRedirect; }
void setClientRedirect(ClientRedirectPolicy clientRedirect) { m_clientRedirect = clientRedirect; }
Event* triggeringEvent() const { return m_triggeringEvent.get(); }
void setTriggeringEvent(PassRefPtrWillBeRawPtr<Event> triggeringEvent) { m_triggeringEvent = triggeringEvent; }
FormState* formState() const { return m_formState.get(); }
void setFormState(PassRefPtr<FormState> formState) { m_formState = formState; }
ShouldSendReferrer shouldSendReferrer() const { return m_shouldSendReferrer; }
void setShouldSendReferrer(ShouldSendReferrer shouldSendReferrer) { m_shouldSendReferrer = shouldSendReferrer; }
private:
RefPtr<Document> m_originDocument;
ResourceRequest m_resourceRequest;
AtomicString m_frameName;
SubstituteData m_substituteData;
bool m_lockBackForwardList;
ClientRedirectPolicy m_clientRedirect;
RefPtrWillBePersistent<Event> m_triggeringEvent;
RefPtr<FormState> m_formState;
ShouldSendReferrer m_shouldSendReferrer;
};
}
#endif