OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 namespace WTF { template <typename T> class PassRefPtr; } | 41 namespace WTF { template <typename T> class PassRefPtr; } |
42 #endif | 42 #endif |
43 | 43 |
44 namespace WebKit { | 44 namespace WebKit { |
45 | 45 |
46 class WebHTTPBodyPrivate; | 46 class WebHTTPBodyPrivate; |
47 | 47 |
48 class WebHTTPBody { | 48 class WebHTTPBody { |
49 public: | 49 public: |
50 struct Element { | 50 struct Element { |
51 enum Type { TypeData, TypeFile, TypeBlob, TypeURL } type; | 51 // TypeURL is DEPRECATED |
| 52 enum Type { TypeData, TypeFile, TypeBlob, TypeFileSystemURL, TypeURL = T
ypeFileSystemURL } type; |
52 WebData data; | 53 WebData data; |
53 WebString filePath; | 54 WebString filePath; |
54 long long fileStart; | 55 long long fileStart; |
55 long long fileLength; // -1 means to the end of the file. | 56 long long fileLength; // -1 means to the end of the file. |
56 double modificationTime; | 57 double modificationTime; |
57 WebURL url; // For TypeBlob or TypeURL. | 58 WebURL fileSystemURL; |
58 | 59 |
59 // FIXME: deprecate this. | 60 // DEPRECATED, use fileSystemURL |
| 61 WebURL url; |
| 62 |
| 63 // FIXME: deprecate url and use uuid |
60 WebURL blobURL; | 64 WebURL blobURL; |
| 65 WebString blobUUID; |
61 }; | 66 }; |
62 | 67 |
63 ~WebHTTPBody() { reset(); } | 68 ~WebHTTPBody() { reset(); } |
64 | 69 |
65 WebHTTPBody() : m_private(0) { } | 70 WebHTTPBody() : m_private(0) { } |
66 WebHTTPBody(const WebHTTPBody& b) : m_private(0) { assign(b); } | 71 WebHTTPBody(const WebHTTPBody& b) : m_private(0) { assign(b); } |
67 WebHTTPBody& operator=(const WebHTTPBody& b) | 72 WebHTTPBody& operator=(const WebHTTPBody& b) |
68 { | 73 { |
69 assign(b); | 74 assign(b); |
70 return *this; | 75 return *this; |
(...skipping 10 matching lines...) Expand all Loading... |
81 | 86 |
82 // Sets the values of the element at the given index. Returns false if | 87 // Sets the values of the element at the given index. Returns false if |
83 // index is out of bounds. | 88 // index is out of bounds. |
84 WEBKIT_EXPORT bool elementAt(size_t index, Element&) const; | 89 WEBKIT_EXPORT bool elementAt(size_t index, Element&) const; |
85 | 90 |
86 // Append to the list of elements. | 91 // Append to the list of elements. |
87 WEBKIT_EXPORT void appendData(const WebData&); | 92 WEBKIT_EXPORT void appendData(const WebData&); |
88 WEBKIT_EXPORT void appendFile(const WebString&); | 93 WEBKIT_EXPORT void appendFile(const WebString&); |
89 // Passing -1 to fileLength means to the end of the file. | 94 // Passing -1 to fileLength means to the end of the file. |
90 WEBKIT_EXPORT void appendFileRange(const WebString&, long long fileStart, lo
ng long fileLength, double modificationTime); | 95 WEBKIT_EXPORT void appendFileRange(const WebString&, long long fileStart, lo
ng long fileLength, double modificationTime); |
91 WEBKIT_EXPORT void appendBlob(const WebURL&); | 96 WEBKIT_EXPORT void appendBlob(const WebURL&); // FIXME: deprecate this |
92 | 97 |
93 // Append a resource which is identified by URL. Currently we only support F
ileSystem URL. | 98 // Append a resource which is identified by the FileSystem URL. |
94 WEBKIT_EXPORT void appendURLRange(const WebURL&, long long start, long long
length, double modificationTime); | 99 WEBKIT_EXPORT void appendFileSystemURLRange(const WebURL&, long long start,
long long length, double modificationTime); |
| 100 WEBKIT_EXPORT void appendURLRange(const WebURL&, long long start, long long
length, double modificationTime); // DEPRECATED |
95 | 101 |
96 // Identifies a particular form submission instance. A value of 0 is | 102 // Identifies a particular form submission instance. A value of 0 is |
97 // used to indicate an unspecified identifier. | 103 // used to indicate an unspecified identifier. |
98 WEBKIT_EXPORT long long identifier() const; | 104 WEBKIT_EXPORT long long identifier() const; |
99 WEBKIT_EXPORT void setIdentifier(long long); | 105 WEBKIT_EXPORT void setIdentifier(long long); |
100 | 106 |
101 WEBKIT_EXPORT bool containsPasswordData() const; | 107 WEBKIT_EXPORT bool containsPasswordData() const; |
102 WEBKIT_EXPORT void setContainsPasswordData(bool); | 108 WEBKIT_EXPORT void setContainsPasswordData(bool); |
103 | 109 |
104 #if WEBKIT_IMPLEMENTATION | 110 #if WEBKIT_IMPLEMENTATION |
105 WebHTTPBody(const WTF::PassRefPtr<WebCore::FormData>&); | 111 WebHTTPBody(const WTF::PassRefPtr<WebCore::FormData>&); |
106 WebHTTPBody& operator=(const WTF::PassRefPtr<WebCore::FormData>&); | 112 WebHTTPBody& operator=(const WTF::PassRefPtr<WebCore::FormData>&); |
107 operator WTF::PassRefPtr<WebCore::FormData>() const; | 113 operator WTF::PassRefPtr<WebCore::FormData>() const; |
108 #endif | 114 #endif |
109 | 115 |
110 private: | 116 private: |
111 void assign(WebHTTPBodyPrivate*); | 117 void assign(WebHTTPBodyPrivate*); |
112 void ensureMutable(); | 118 void ensureMutable(); |
113 WebHTTPBodyPrivate* m_private; | 119 WebHTTPBodyPrivate* m_private; |
114 }; | 120 }; |
115 | 121 |
116 } // namespace WebKit | 122 } // namespace WebKit |
117 | 123 |
118 #endif | 124 #endif |
OLD | NEW |