blob: 7d3e4daaf79f59f908d5f87d75242dfb1054f819 [file] [log] [blame]
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +01001/*
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
Ben Murdoch02772c62013-07-26 10:21:05 +010023 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010024 */
25
26#ifndef FrameLoadRequest_h
27#define FrameLoadRequest_h
28
Ben Murdoche69819b2013-07-17 14:56:49 +010029#include "core/dom/Event.h"
30#include "core/html/HTMLFormElement.h"
31#include "core/loader/FrameLoaderTypes.h"
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010032#include "core/loader/SubstituteData.h"
Torne (Richard Coles)e5249552013-05-15 11:35:13 +010033#include "weborigin/SecurityOrigin.h"
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010034#include "core/platform/network/ResourceRequest.h"
35
36namespace WebCore {
37class Frame;
38
39struct FrameLoadRequest {
40public:
41 explicit FrameLoadRequest(SecurityOrigin* requester)
42 : m_requester(requester)
Ben Murdoche69819b2013-07-17 14:56:49 +010043 , m_lockBackForwardList(false)
44 , m_clientRedirect(false)
45 , m_shouldSendReferrer(MaybeSendReferrer)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010046 {
47 }
48
49 FrameLoadRequest(SecurityOrigin* requester, const ResourceRequest& resourceRequest)
50 : m_requester(requester)
51 , m_resourceRequest(resourceRequest)
Ben Murdoche69819b2013-07-17 14:56:49 +010052 , m_lockBackForwardList(false)
53 , m_clientRedirect(false)
54 , m_shouldSendReferrer(MaybeSendReferrer)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010055 {
56 }
57
58 FrameLoadRequest(SecurityOrigin* requester, const ResourceRequest& resourceRequest, const String& frameName)
59 : m_requester(requester)
60 , m_resourceRequest(resourceRequest)
61 , m_frameName(frameName)
Ben Murdoche69819b2013-07-17 14:56:49 +010062 , m_lockBackForwardList(false)
63 , m_clientRedirect(false)
64 , m_shouldSendReferrer(MaybeSendReferrer)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010065 {
66 }
67
Ben Murdoche69819b2013-07-17 14:56:49 +010068 FrameLoadRequest(SecurityOrigin* requester, const ResourceRequest& resourceRequest, const SubstituteData& substituteData)
69 : m_requester(requester)
70 , m_resourceRequest(resourceRequest)
71 , m_substituteData(substituteData)
72 , m_lockBackForwardList(false)
73 , m_clientRedirect(false)
74 , m_shouldSendReferrer(MaybeSendReferrer)
75 {
76 }
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010077
78 const SecurityOrigin* requester() const { return m_requester.get(); }
79
80 ResourceRequest& resourceRequest() { return m_resourceRequest; }
81 const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
82
83 const String& frameName() const { return m_frameName; }
84 void setFrameName(const String& frameName) { m_frameName = frameName; }
85
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010086 const SubstituteData& substituteData() const { return m_substituteData; }
Ben Murdoche69819b2013-07-17 14:56:49 +010087
88 bool lockBackForwardList() const { return m_lockBackForwardList; }
89 void setLockBackForwardList(bool lockBackForwardList) { m_lockBackForwardList = lockBackForwardList; }
90
91 bool clientRedirect() const { return m_clientRedirect; }
92 void setClientRedirect(bool clientRedirect) { m_clientRedirect = clientRedirect; }
93
94 Event* triggeringEvent() const { return m_triggeringEvent.get(); }
95 void setTriggeringEvent(PassRefPtr<Event> triggeringEvent) { m_triggeringEvent = triggeringEvent; }
96
97 FormState* formState() const { return m_formState.get(); }
98 void setFormState(PassRefPtr<FormState> formState) { m_formState = formState; }
99
100 ShouldSendReferrer shouldSendReferrer() const { return m_shouldSendReferrer; }
101 void setShouldSendReferrer(ShouldSendReferrer shouldSendReferrer) { m_shouldSendReferrer = shouldSendReferrer; }
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100102
103private:
104 RefPtr<SecurityOrigin> m_requester;
105 ResourceRequest m_resourceRequest;
106 String m_frameName;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100107 SubstituteData m_substituteData;
Ben Murdoche69819b2013-07-17 14:56:49 +0100108 bool m_lockBackForwardList;
109 bool m_clientRedirect;
110 RefPtr<Event> m_triggeringEvent;
111 RefPtr<FormState> m_formState;
112 ShouldSendReferrer m_shouldSendReferrer;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100113};
114
115}
116
117#endif // FrameLoadRequest_h