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 16 matching lines...) Expand all Loading... |
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 BlobBuilder_h | 31 #ifndef BlobBuilder_h |
32 #define BlobBuilder_h | 32 #define BlobBuilder_h |
33 | 33 |
34 #include "platform/blob/BlobData.h" | 34 #include "platform/blob/BlobData.h" |
35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
36 | 36 |
37 namespace WTF{ | |
38 class TextEncoding; | |
39 } | |
40 | |
41 namespace WebCore { | 37 namespace WebCore { |
42 | 38 |
43 class Blob; | 39 class Blob; |
44 | 40 class File; |
45 typedef int ExceptionCode; | |
46 | 41 |
47 class BlobBuilder { | 42 class BlobBuilder { |
48 public: | 43 public: |
49 BlobBuilder(); | 44 BlobBuilder(); |
50 | 45 |
51 void append(Blob*); | 46 void append(Blob*); |
52 void append(const String& text, const String& ending); | 47 void append(const String& text, const String& ending); |
53 void append(ArrayBuffer*); | 48 void append(ArrayBuffer*); |
54 void append(ArrayBufferView*); | 49 void append(ArrayBufferView*); |
55 | 50 |
56 PassRefPtr<Blob> getBlob(const String& contentType); | 51 PassRefPtr<Blob> createBlob(const String& contentType); |
| 52 PassRefPtr<File> createFile(const String& contentType, const String& fileNam
e, double modificationTime); |
57 | 53 |
58 private: | 54 private: |
59 void appendBytesData(const void*, size_t); | 55 void appendBytesData(const void*, size_t); |
60 | 56 |
61 Vector<char>& getBuffer(); | 57 Vector<char>& getBuffer(); |
62 | 58 |
63 long long m_size; | 59 long long m_size; |
64 BlobDataItemList m_items; | 60 BlobDataItemList m_items; |
65 }; | 61 }; |
66 | 62 |
67 } // namespace WebCore | 63 } // namespace WebCore |
68 | 64 |
69 #endif // BlobBuilder_h | 65 #endif // BlobBuilder_h |
OLD | NEW |