Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FormSubmission_h | 31 #ifndef FormSubmission_h |
| 32 #define FormSubmission_h | 32 #define FormSubmission_h |
| 33 | 33 |
| 34 #include "core/loader/FrameLoadRequest.h" | |
|
Łukasz Anforowicz
2016/06/08 20:32:43
Needed for createFrameLoadRequest, but introduces
| |
| 34 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 35 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
| 36 #include "platform/weborigin/Referrer.h" | 37 #include "platform/weborigin/Referrer.h" |
| 37 #include "wtf/Allocator.h" | 38 #include "wtf/Allocator.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 42 class Document; | |
| 41 class EncodedFormData; | 43 class EncodedFormData; |
| 42 class Event; | 44 class Event; |
| 43 struct FrameLoadRequest; | |
| 44 class HTMLFormElement; | 45 class HTMLFormElement; |
| 45 | 46 |
| 46 class FormSubmission : public GarbageCollectedFinalized<FormSubmission> { | 47 class FormSubmission : public GarbageCollectedFinalized<FormSubmission> { |
| 47 public: | 48 public: |
| 48 enum SubmitMethod { GetMethod, PostMethod, DialogMethod }; | 49 enum SubmitMethod { GetMethod, PostMethod, DialogMethod }; |
| 49 | 50 |
| 50 class Attributes { | 51 class Attributes { |
| 51 DISALLOW_NEW(); | 52 DISALLOW_NEW(); |
| 52 WTF_MAKE_NONCOPYABLE(Attributes); | 53 WTF_MAKE_NONCOPYABLE(Attributes); |
| 53 public: | 54 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 86 |
| 86 String m_action; | 87 String m_action; |
| 87 AtomicString m_target; | 88 AtomicString m_target; |
| 88 AtomicString m_encodingType; | 89 AtomicString m_encodingType; |
| 89 String m_acceptCharset; | 90 String m_acceptCharset; |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 static FormSubmission* create(HTMLFormElement*, const Attributes&, Event*); | 93 static FormSubmission* create(HTMLFormElement*, const Attributes&, Event*); |
| 93 DECLARE_TRACE(); | 94 DECLARE_TRACE(); |
| 94 | 95 |
| 95 void populateFrameLoadRequest(FrameLoadRequest&); | 96 FrameLoadRequest createFrameLoadRequest(Document* originDocument); |
| 96 | 97 |
| 97 KURL requestURL() const; | 98 KURL requestURL() const; |
| 98 | 99 |
| 99 SubmitMethod method() const { return m_method; } | 100 SubmitMethod method() const { return m_method; } |
| 100 const KURL& action() const { return m_action; } | 101 const KURL& action() const { return m_action; } |
| 101 const AtomicString& target() const { return m_target; } | 102 const AtomicString& target() const { return m_target; } |
| 102 void clearTarget() { m_target = nullAtom; } | 103 void clearTarget() { m_target = nullAtom; } |
| 103 HTMLFormElement* form() const { return m_form.get(); } | 104 HTMLFormElement* form() const { return m_form.get(); } |
| 104 EncodedFormData* data() const { return m_formData.get(); } | 105 EncodedFormData* data() const { return m_formData.get(); } |
| 105 Event* event() const { return m_event.get(); } | |
|
Łukasz Anforowicz
2016/06/08 20:32:43
This accessor is no longer needed after folding 2
| |
| 106 | 106 |
| 107 const String& result() const { return m_result; } | 107 const String& result() const { return m_result; } |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 FormSubmission(SubmitMethod, const KURL& action, const AtomicString& target, const AtomicString& contentType, HTMLFormElement*, PassRefPtr<EncodedFormData>, const String& boundary, Event*); | 110 FormSubmission(SubmitMethod, const KURL& action, const AtomicString& target, const AtomicString& contentType, HTMLFormElement*, PassRefPtr<EncodedFormData>, const String& boundary, Event*); |
| 111 // FormSubmission for DialogMethod | 111 // FormSubmission for DialogMethod |
| 112 FormSubmission(const String& result); | 112 FormSubmission(const String& result); |
| 113 | 113 |
| 114 // FIXME: Hold an instance of Attributes instead of individual members. | 114 // FIXME: Hold an instance of Attributes instead of individual members. |
| 115 SubmitMethod m_method; | 115 SubmitMethod m_method; |
| 116 KURL m_action; | 116 KURL m_action; |
| 117 AtomicString m_target; | 117 AtomicString m_target; |
| 118 AtomicString m_contentType; | 118 AtomicString m_contentType; |
| 119 Member<HTMLFormElement> m_form; | 119 Member<HTMLFormElement> m_form; |
| 120 RefPtr<EncodedFormData> m_formData; | 120 RefPtr<EncodedFormData> m_formData; |
| 121 String m_boundary; | 121 String m_boundary; |
| 122 Member<Event> m_event; | 122 Member<Event> m_event; |
| 123 String m_result; | 123 String m_result; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| 127 | 127 |
| 128 #endif // FormSubmission_h | 128 #endif // FormSubmission_h |
| OLD | NEW |