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 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class Document; | 45 class Document; |
46 class Event; | 46 class Event; |
47 class FormData; | 47 class FormData; |
48 struct FrameLoadRequest; | 48 struct FrameLoadRequest; |
49 class HTMLFormElement; | 49 class HTMLFormElement; |
50 | 50 |
51 class FormSubmission : public RefCounted<FormSubmission> { | 51 class FormSubmission : public RefCountedWillBeGarbageCollectedFinalized<FormSubm
ission> { |
52 public: | 52 public: |
53 enum Method { GetMethod, PostMethod, DialogMethod }; | 53 enum Method { GetMethod, PostMethod, DialogMethod }; |
54 | 54 |
55 class Attributes { | 55 class Attributes { |
56 WTF_MAKE_NONCOPYABLE(Attributes); | 56 WTF_MAKE_NONCOPYABLE(Attributes); |
57 public: | 57 public: |
58 Attributes() | 58 Attributes() |
59 : m_method(GetMethod) | 59 : m_method(GetMethod) |
60 , m_isMultiPartForm(false) | 60 , m_isMultiPartForm(false) |
61 , m_encodingType("application/x-www-form-urlencoded", AtomicString::
ConstructFromLiteral) | 61 , m_encodingType("application/x-www-form-urlencoded", AtomicString::
ConstructFromLiteral) |
(...skipping 24 matching lines...) Expand all Loading... |
86 private: | 86 private: |
87 Method m_method; | 87 Method m_method; |
88 bool m_isMultiPartForm; | 88 bool m_isMultiPartForm; |
89 | 89 |
90 KURL m_action; | 90 KURL m_action; |
91 AtomicString m_target; | 91 AtomicString m_target; |
92 AtomicString m_encodingType; | 92 AtomicString m_encodingType; |
93 String m_acceptCharset; | 93 String m_acceptCharset; |
94 }; | 94 }; |
95 | 95 |
96 static PassRefPtr<FormSubmission> create(HTMLFormElement*, const Attributes&
, PassRefPtrWillBeRawPtr<Event>, FormSubmissionTrigger); | 96 static PassRefPtrWillBeRawPtr<FormSubmission> create(HTMLFormElement*, const
Attributes&, PassRefPtrWillBeRawPtr<Event>, FormSubmissionTrigger); |
| 97 void trace(Visitor*); |
97 | 98 |
98 void populateFrameLoadRequest(FrameLoadRequest&); | 99 void populateFrameLoadRequest(FrameLoadRequest&); |
99 | 100 |
100 KURL requestURL() const; | 101 KURL requestURL() const; |
101 | 102 |
102 Method method() const { return m_method; } | 103 Method method() const { return m_method; } |
103 const KURL& action() const { return m_action; } | 104 const KURL& action() const { return m_action; } |
104 const AtomicString& target() const { return m_target; } | 105 const AtomicString& target() const { return m_target; } |
105 void clearTarget() { m_target = nullAtom; } | 106 void clearTarget() { m_target = nullAtom; } |
106 FormState* state() const { return m_formState.get(); } | 107 FormState* state() const { return m_formState.get(); } |
107 FormData* data() const { return m_formData.get(); } | 108 FormData* data() const { return m_formData.get(); } |
108 Event* event() const { return m_event.get(); } | 109 Event* event() const { return m_event.get(); } |
109 | 110 |
110 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | 111 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
111 void setOrigin(const String& origin) { m_origin = origin; } | 112 void setOrigin(const String& origin) { m_origin = origin; } |
112 | 113 |
113 const String& result() const { return m_result; } | 114 const String& result() const { return m_result; } |
114 | 115 |
115 private: | 116 private: |
116 FormSubmission(Method, const KURL& action, const AtomicString& target, const
AtomicString& contentType, PassRefPtrWillBeRawPtr<FormState>, PassRefPtr<FormDa
ta>, const String& boundary, PassRefPtrWillBeRawPtr<Event>); | 117 FormSubmission(Method, const KURL& action, const AtomicString& target, const
AtomicString& contentType, PassRefPtrWillBeRawPtr<FormState>, PassRefPtr<FormDa
ta>, const String& boundary, PassRefPtrWillBeRawPtr<Event>); |
117 // FormSubmission for DialogMethod | 118 // FormSubmission for DialogMethod |
118 FormSubmission(const String& result); | 119 FormSubmission(const String& result); |
119 | 120 |
120 // FIXME: Hold an instance of Attributes instead of individual members. | 121 // FIXME: Hold an instance of Attributes instead of individual members. |
121 Method m_method; | 122 Method m_method; |
122 KURL m_action; | 123 KURL m_action; |
123 AtomicString m_target; | 124 AtomicString m_target; |
124 AtomicString m_contentType; | 125 AtomicString m_contentType; |
125 RefPtrWillBePersistent<FormState> m_formState; | 126 RefPtrWillBeMember<FormState> m_formState; |
126 RefPtr<FormData> m_formData; | 127 RefPtr<FormData> m_formData; |
127 String m_boundary; | 128 String m_boundary; |
128 RefPtrWillBePersistent<Event> m_event; | 129 RefPtrWillBeMember<Event> m_event; |
129 Referrer m_referrer; | 130 Referrer m_referrer; |
130 String m_origin; | 131 String m_origin; |
131 String m_result; | 132 String m_result; |
132 }; | 133 }; |
133 | 134 |
134 } | 135 } |
135 | 136 |
136 #endif // FormSubmission_h | 137 #endif // FormSubmission_h |
OLD | NEW |