Chromium Code Reviews| Index: Source/core/html/FormDataList.h |
| diff --git a/Source/core/html/FormDataList.h b/Source/core/html/FormDataList.h |
| index 123e566f62133fc13e5ff47d58e128c468ed689e..46bdfe76ab5e68ff9fcdd77042035fc8c41ca7a1 100644 |
| --- a/Source/core/html/FormDataList.h |
| +++ b/Source/core/html/FormDataList.h |
| @@ -22,6 +22,7 @@ |
| #define FormDataList_h |
| #include "core/fileapi/Blob.h" |
| +#include "heap/Handle.h" |
| #include "platform/network/FormData.h" |
| #include "wtf/Forward.h" |
| #include "wtf/text/CString.h" |
| @@ -31,19 +32,25 @@ namespace WebCore { |
| class FormDataList { |
| public: |
| + // This class is only allocated as part of vectors, and its |
| + // heap-allocated member is visited when tracing the vector. |
| + // See also its WTF::NeedsTracing specialization below. |
|
haraken
2014/02/27 01:19:29
Nit: I'd drop this comment, as we don't add this k
sof
2014/02/27 06:48:07
alright, but there is one next to the use in CSSGr
|
| class Item { |
| + ALLOW_ONLY_INLINE_ALLOCATION(); |
| public: |
| Item() { } |
| Item(const WTF::CString& data) : m_data(data) { } |
| - Item(PassRefPtr<Blob> blob, const String& filename) : m_blob(blob), m_filename(filename) { } |
| + Item(PassRefPtrWillBeRawPtr<Blob> blob, const String& filename) : m_blob(blob), m_filename(filename) { } |
| const WTF::CString& data() const { return m_data; } |
| Blob* blob() const { return m_blob.get(); } |
| const String& filename() const { return m_filename; } |
| + void trace(Visitor*); |
| + |
| private: |
| WTF::CString m_data; |
| - RefPtr<Blob> m_blob; |
| + RefPtrWillBeMember<Blob> m_blob; |
| String m_filename; |
| }; |
| @@ -64,29 +71,39 @@ public: |
| appendString(key); |
| appendString(String::number(value)); |
| } |
| - void appendBlob(const String& key, PassRefPtr<Blob> blob, const String& filename = String()) |
| + void appendBlob(const String& key, PassRefPtrWillBeRawPtr<Blob> blob, const String& filename = String()) |
| { |
| appendString(key); |
| appendBlob(blob, filename); |
| } |
| - const Vector<Item>& items() const { return m_items; } |
| + const WillBeHeapVector<Item>& items() const { return m_items; } |
| const WTF::TextEncoding& encoding() const { return m_encoding; } |
| PassRefPtr<FormData> createFormData(const WTF::TextEncoding&, FormData::EncodingType = FormData::FormURLEncoded); |
| PassRefPtr<FormData> createMultiPartFormData(const WTF::TextEncoding&); |
| + void trace(Visitor*); |
| + |
| private: |
| void appendKeyValuePairItemsTo(FormData*, const WTF::TextEncoding&, bool isMultiPartForm, FormData::EncodingType = FormData::FormURLEncoded); |
| void appendString(const CString&); |
| void appendString(const String&); |
| - void appendBlob(PassRefPtr<Blob>, const String& filename); |
| + void appendBlob(PassRefPtrWillBeRawPtr<Blob>, const String& filename); |
| WTF::TextEncoding m_encoding; |
| - Vector<Item> m_items; |
| + WillBeHeapVector<Item> m_items; |
| }; |
| } // namespace WebCore |
| +// FIXME: oilpan: remove once traceability can be derived/inferred. |
| +namespace WTF { |
| +template<> |
| +struct NeedsTracing<WebCore::FormDataList::Item> { |
| + static const bool value = true; |
| +}; |
| +} |
| + |
| #endif // FormDataList_h |