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..a37a163f444bb06b9e2a062e18764fa9ec0b3ae8 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,24 @@ namespace WebCore { |
| class FormDataList { |
| public: |
| + // This class is only allocated as part of vectors, this class' |
|
Mads Ager (chromium)
2014/02/26 11:00:29
class's
|
| + // heap-allocated member is visited as part of tracing the vector. |
| class Item { |
|
Mads Ager (chromium)
2014/02/26 11:00:29
Until Gustav's change to automatically detect that
sof
2014/02/26 21:51:25
Done.
sof
2014/02/26 21:58:42
Forgot to add..I'm intruiged by how that can/will
|
| + 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,27 +70,29 @@ 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 |