summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/FormSubmission.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/FormSubmission.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/loader/FormSubmission.h')
-rw-r--r--Source/WebCore/loader/FormSubmission.h56
1 files changed, 20 insertions, 36 deletions
diff --git a/Source/WebCore/loader/FormSubmission.h b/Source/WebCore/loader/FormSubmission.h
index c2f83d53f..252412c0c 100644
--- a/Source/WebCore/loader/FormSubmission.h
+++ b/Source/WebCore/loader/FormSubmission.h
@@ -28,39 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FormSubmission_h
-#define FormSubmission_h
+#pragma once
#include "FormState.h"
+#include "FrameLoaderTypes.h"
#include "URL.h"
namespace WebCore {
-class Document;
class Event;
class FormData;
+
struct FrameLoadRequest;
-class HTMLFormElement;
-class TextEncoding;
class FormSubmission : public RefCounted<FormSubmission> {
public:
- enum Method { GetMethod, PostMethod };
+ enum class Method { Get, Post };
class Attributes {
- WTF_MAKE_NONCOPYABLE(Attributes);
public:
- Attributes()
- : m_method(GetMethod)
- , m_isMultiPartForm(false)
- , m_encodingType("application/x-www-form-urlencoded")
- {
- }
-
Method method() const { return m_method; }
static Method parseMethodType(const String&);
void updateMethodType(const String&);
- static String methodString(Method method) { return method == PostMethod ? "post" : "get"; }
+ static ASCIILiteral methodString(Method method) { return ASCIILiteral { method == Method::Post ? "post" : "get" }; }
const String& action() const { return m_action; }
void parseAction(const String&);
@@ -76,57 +66,51 @@ public:
const String& acceptCharset() const { return m_acceptCharset; }
void setAcceptCharset(const String& value) { m_acceptCharset = value; }
- void copyFrom(const Attributes&);
-
private:
- Method m_method;
- bool m_isMultiPartForm;
-
+ Method m_method { Method::Get };
+ bool m_isMultiPartForm { false };
String m_action;
String m_target;
- String m_encodingType;
+ String m_encodingType { ASCIILiteral { "application/x-www-form-urlencoded" } };
String m_acceptCharset;
};
- static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&, PassRefPtr<Event> event, bool lockHistory, FormSubmissionTrigger);
+ static Ref<FormSubmission> create(HTMLFormElement&, const Attributes&, Event*, LockHistory, FormSubmissionTrigger);
void populateFrameLoadRequest(FrameLoadRequest&);
-
URL requestURL() const;
Method method() const { return m_method; }
const URL& action() const { return m_action; }
const String& target() const { return m_target; }
- void clearTarget() { m_target = String(); }
const String& contentType() const { return m_contentType; }
- FormState* state() const { return m_formState.get(); }
- FormData* data() const { return m_formData.get(); }
+ FormState& state() const { return m_formState; }
+ FormData& data() const { return m_formData; }
const String boundary() const { return m_boundary; }
- bool lockHistory() const { return m_lockHistory; }
+ LockHistory lockHistory() const { return m_lockHistory; }
Event* event() const { return m_event.get(); }
-
const String& referrer() const { return m_referrer; }
- void setReferrer(const String& referrer) { m_referrer = referrer; }
const String& origin() const { return m_origin; }
+
+ void clearTarget() { m_target = { }; }
+ void setReferrer(const String& referrer) { m_referrer = referrer; }
void setOrigin(const String& origin) { m_origin = origin; }
private:
- FormSubmission(Method, const URL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>);
+ FormSubmission(Method, const URL& action, const String& target, const String& contentType, Ref<FormState>&&, Ref<FormData>&&, const String& boundary, LockHistory, Event*);
// FIXME: Hold an instance of Attributes instead of individual members.
Method m_method;
URL m_action;
String m_target;
String m_contentType;
- RefPtr<FormState> m_formState;
- RefPtr<FormData> m_formData;
+ Ref<FormState> m_formState;
+ Ref<FormData> m_formData;
String m_boundary;
- bool m_lockHistory;
+ LockHistory m_lockHistory;
RefPtr<Event> m_event;
String m_referrer;
String m_origin;
};
-}
-
-#endif // FormSubmission_h
+} // namespace WebCore