1 /* 2 * Copyright (C) 2003, 2006, 2010 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26 #ifndef FrameLoadRequest_h 27 #define FrameLoadRequest_h 28 29 #include "core/dom/Document.h" 30 #include "core/events/Event.h" 31 #include "core/html/HTMLFormElement.h" 32 #include "core/loader/FrameLoaderTypes.h" 33 #include "core/loader/SubstituteData.h" 34 #include "platform/network/ResourceRequest.h" 35 36 namespace WebCore { 37 class Frame; 38 39 struct FrameLoadRequest { 40 public: FrameLoadRequestFrameLoadRequest41 explicit FrameLoadRequest(Document* originDocument) 42 : m_originDocument(originDocument) 43 , m_lockBackForwardList(false) 44 , m_clientRedirect(NotClientRedirect) 45 , m_shouldSendReferrer(MaybeSendReferrer) 46 { 47 } 48 FrameLoadRequestFrameLoadRequest49 FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest) 50 : m_originDocument(originDocument) 51 , m_resourceRequest(resourceRequest) 52 , m_lockBackForwardList(false) 53 , m_clientRedirect(NotClientRedirect) 54 , m_shouldSendReferrer(MaybeSendReferrer) 55 { 56 } 57 FrameLoadRequestFrameLoadRequest58 FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest, const String& frameName) 59 : m_originDocument(originDocument) 60 , m_resourceRequest(resourceRequest) 61 , m_frameName(frameName) 62 , m_lockBackForwardList(false) 63 , m_clientRedirect(NotClientRedirect) 64 , m_shouldSendReferrer(MaybeSendReferrer) 65 { 66 } 67 FrameLoadRequestFrameLoadRequest68 FrameLoadRequest(Document* originDocument, const ResourceRequest& resourceRequest, const SubstituteData& substituteData) 69 : m_originDocument(originDocument) 70 , m_resourceRequest(resourceRequest) 71 , m_substituteData(substituteData) 72 , m_lockBackForwardList(false) 73 , m_clientRedirect(NotClientRedirect) 74 , m_shouldSendReferrer(MaybeSendReferrer) 75 { 76 } 77 originDocumentFrameLoadRequest78 Document* originDocument() const { return m_originDocument.get(); } 79 resourceRequestFrameLoadRequest80 ResourceRequest& resourceRequest() { return m_resourceRequest; } resourceRequestFrameLoadRequest81 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } 82 frameNameFrameLoadRequest83 const String& frameName() const { return m_frameName; } setFrameNameFrameLoadRequest84 void setFrameName(const String& frameName) { m_frameName = frameName; } 85 substituteDataFrameLoadRequest86 const SubstituteData& substituteData() const { return m_substituteData; } 87 lockBackForwardListFrameLoadRequest88 bool lockBackForwardList() const { return m_lockBackForwardList; } setLockBackForwardListFrameLoadRequest89 void setLockBackForwardList(bool lockBackForwardList) { m_lockBackForwardList = lockBackForwardList; } 90 clientRedirectFrameLoadRequest91 ClientRedirectPolicy clientRedirect() const { return m_clientRedirect; } setClientRedirectFrameLoadRequest92 void setClientRedirect(ClientRedirectPolicy clientRedirect) { m_clientRedirect = clientRedirect; } 93 triggeringEventFrameLoadRequest94 Event* triggeringEvent() const { return m_triggeringEvent.get(); } setTriggeringEventFrameLoadRequest95 void setTriggeringEvent(PassRefPtr<Event> triggeringEvent) { m_triggeringEvent = triggeringEvent; } 96 formStateFrameLoadRequest97 FormState* formState() const { return m_formState.get(); } setFormStateFrameLoadRequest98 void setFormState(PassRefPtr<FormState> formState) { m_formState = formState; } 99 shouldSendReferrerFrameLoadRequest100 ShouldSendReferrer shouldSendReferrer() const { return m_shouldSendReferrer; } setShouldSendReferrerFrameLoadRequest101 void setShouldSendReferrer(ShouldSendReferrer shouldSendReferrer) { m_shouldSendReferrer = shouldSendReferrer; } 102 103 private: 104 RefPtr<Document> m_originDocument; 105 ResourceRequest m_resourceRequest; 106 String m_frameName; 107 SubstituteData m_substituteData; 108 bool m_lockBackForwardList; 109 ClientRedirectPolicy m_clientRedirect; 110 RefPtr<Event> m_triggeringEvent; 111 RefPtr<FormState> m_formState; 112 ShouldSendReferrer m_shouldSendReferrer; 113 }; 114 115 } 116 117 #endif // FrameLoadRequest_h 118