summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/FormState.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/loader/FormState.h')
-rw-r--r--Source/WebCore/loader/FormState.h51
1 files changed, 22 insertions, 29 deletions
diff --git a/Source/WebCore/loader/FormState.h b/Source/WebCore/loader/FormState.h
index 6f55943fe..2dedd09be 100644
--- a/Source/WebCore/loader/FormState.h
+++ b/Source/WebCore/loader/FormState.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,7 +10,7 @@
* 2. 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,42 +26,35 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FormState_h
-#define FormState_h
+#pragma once
-#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
- class Document;
- class HTMLFormElement;
+class Document;
+class HTMLFormElement;
- enum FormSubmissionTrigger {
- SubmittedByJavaScript,
- NotSubmittedByJavaScript
- };
-
- typedef Vector<std::pair<String, String>> StringPairVector;
+enum FormSubmissionTrigger { SubmittedByJavaScript, NotSubmittedByJavaScript };
- class FormState : public RefCounted<FormState> {
- public:
- static PassRefPtr<FormState> create(PassRefPtr<HTMLFormElement>, StringPairVector& textFieldValuesToAdopt, PassRefPtr<Document>, FormSubmissionTrigger);
+using StringPairVector = Vector<std::pair<String, String>>;
- HTMLFormElement* form() const { return m_form.get(); }
- const StringPairVector& textFieldValues() const { return m_textFieldValues; }
- Document* sourceDocument() const { return m_sourceDocument.get(); }
- FormSubmissionTrigger formSubmissionTrigger() const { return m_formSubmissionTrigger; }
+class FormState : public RefCounted<FormState> {
+public:
+ static Ref<FormState> create(HTMLFormElement&, StringPairVector&& textFieldValues, Document&, FormSubmissionTrigger);
- private:
- FormState(PassRefPtr<HTMLFormElement>, StringPairVector& textFieldValuesToAdopt, PassRefPtr<Document>, FormSubmissionTrigger);
+ HTMLFormElement& form() const { return m_form; }
+ const StringPairVector& textFieldValues() const { return m_textFieldValues; }
+ Document& sourceDocument() const { return m_sourceDocument; }
+ FormSubmissionTrigger formSubmissionTrigger() const { return m_formSubmissionTrigger; }
- RefPtr<HTMLFormElement> m_form;
- StringPairVector m_textFieldValues;
- RefPtr<Document> m_sourceDocument;
- FormSubmissionTrigger m_formSubmissionTrigger;
- };
+private:
+ FormState(HTMLFormElement&, StringPairVector&& textFieldValues, Document&, FormSubmissionTrigger);
-}
+ Ref<HTMLFormElement> m_form;
+ StringPairVector m_textFieldValues;
+ Ref<Document> m_sourceDocument;
+ FormSubmissionTrigger m_formSubmissionTrigger;
+};
-#endif // FormState_h
+} // namespace WebCore