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 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 WebURLResponse_h | 31 #ifndef WebURLResponse_h |
32 #define WebURLResponse_h | 32 #define WebURLResponse_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebPrivateOwnPtr.h" | 35 #include "WebPrivateOwnPtr.h" |
36 | 36 |
37 #if BLINK_IMPLEMENTATION | 37 #if INSIDE_BLINK |
38 namespace WebCore { class ResourceResponse; } | 38 namespace WebCore { class ResourceResponse; } |
39 #endif | 39 #endif |
40 | 40 |
41 namespace WebKit { | 41 namespace WebKit { |
42 | 42 |
43 class WebCString; | 43 class WebCString; |
44 class WebHTTPHeaderVisitor; | 44 class WebHTTPHeaderVisitor; |
45 class WebHTTPLoadInfo; | 45 class WebHTTPLoadInfo; |
46 class WebString; | 46 class WebString; |
47 class WebURL; | 47 class WebURL; |
(...skipping 18 matching lines...) Expand all Loading... |
66 assign(r); | 66 assign(r); |
67 return *this; | 67 return *this; |
68 } | 68 } |
69 | 69 |
70 explicit WebURLResponse(const WebURL& url) : m_private(0) | 70 explicit WebURLResponse(const WebURL& url) : m_private(0) |
71 { | 71 { |
72 initialize(); | 72 initialize(); |
73 setURL(url); | 73 setURL(url); |
74 } | 74 } |
75 | 75 |
76 BLINK_EXPORT void initialize(); | 76 BLINK_PLATFORM_EXPORT void initialize(); |
77 BLINK_EXPORT void reset(); | 77 BLINK_PLATFORM_EXPORT void reset(); |
78 BLINK_EXPORT void assign(const WebURLResponse&); | 78 BLINK_PLATFORM_EXPORT void assign(const WebURLResponse&); |
79 | 79 |
80 BLINK_EXPORT bool isNull() const; | 80 BLINK_PLATFORM_EXPORT bool isNull() const; |
81 | 81 |
82 BLINK_EXPORT WebURL url() const; | 82 BLINK_PLATFORM_EXPORT WebURL url() const; |
83 BLINK_EXPORT void setURL(const WebURL&); | 83 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); |
84 | 84 |
85 BLINK_EXPORT unsigned connectionID() const; | 85 BLINK_PLATFORM_EXPORT unsigned connectionID() const; |
86 BLINK_EXPORT void setConnectionID(unsigned); | 86 BLINK_PLATFORM_EXPORT void setConnectionID(unsigned); |
87 | 87 |
88 BLINK_EXPORT bool connectionReused() const; | 88 BLINK_PLATFORM_EXPORT bool connectionReused() const; |
89 BLINK_EXPORT void setConnectionReused(bool); | 89 BLINK_PLATFORM_EXPORT void setConnectionReused(bool); |
90 | 90 |
91 BLINK_EXPORT WebURLLoadTiming loadTiming(); | 91 BLINK_PLATFORM_EXPORT WebURLLoadTiming loadTiming(); |
92 BLINK_EXPORT void setLoadTiming(const WebURLLoadTiming&); | 92 BLINK_PLATFORM_EXPORT void setLoadTiming(const WebURLLoadTiming&); |
93 | 93 |
94 BLINK_EXPORT WebHTTPLoadInfo httpLoadInfo(); | 94 BLINK_PLATFORM_EXPORT WebHTTPLoadInfo httpLoadInfo(); |
95 BLINK_EXPORT void setHTTPLoadInfo(const WebHTTPLoadInfo&); | 95 BLINK_PLATFORM_EXPORT void setHTTPLoadInfo(const WebHTTPLoadInfo&); |
96 | 96 |
97 BLINK_EXPORT double responseTime() const; | 97 BLINK_PLATFORM_EXPORT double responseTime() const; |
98 BLINK_EXPORT void setResponseTime(double); | 98 BLINK_PLATFORM_EXPORT void setResponseTime(double); |
99 | 99 |
100 BLINK_EXPORT WebString mimeType() const; | 100 BLINK_PLATFORM_EXPORT WebString mimeType() const; |
101 BLINK_EXPORT void setMIMEType(const WebString&); | 101 BLINK_PLATFORM_EXPORT void setMIMEType(const WebString&); |
102 | 102 |
103 BLINK_EXPORT long long expectedContentLength() const; | 103 BLINK_PLATFORM_EXPORT long long expectedContentLength() const; |
104 BLINK_EXPORT void setExpectedContentLength(long long); | 104 BLINK_PLATFORM_EXPORT void setExpectedContentLength(long long); |
105 | 105 |
106 BLINK_EXPORT WebString textEncodingName() const; | 106 BLINK_PLATFORM_EXPORT WebString textEncodingName() const; |
107 BLINK_EXPORT void setTextEncodingName(const WebString&); | 107 BLINK_PLATFORM_EXPORT void setTextEncodingName(const WebString&); |
108 | 108 |
109 BLINK_EXPORT WebString suggestedFileName() const; | 109 BLINK_PLATFORM_EXPORT WebString suggestedFileName() const; |
110 BLINK_EXPORT void setSuggestedFileName(const WebString&); | 110 BLINK_PLATFORM_EXPORT void setSuggestedFileName(const WebString&); |
111 | 111 |
112 BLINK_EXPORT HTTPVersion httpVersion() const; | 112 BLINK_PLATFORM_EXPORT HTTPVersion httpVersion() const; |
113 BLINK_EXPORT void setHTTPVersion(HTTPVersion); | 113 BLINK_PLATFORM_EXPORT void setHTTPVersion(HTTPVersion); |
114 | 114 |
115 BLINK_EXPORT int httpStatusCode() const; | 115 BLINK_PLATFORM_EXPORT int httpStatusCode() const; |
116 BLINK_EXPORT void setHTTPStatusCode(int); | 116 BLINK_PLATFORM_EXPORT void setHTTPStatusCode(int); |
117 | 117 |
118 BLINK_EXPORT WebString httpStatusText() const; | 118 BLINK_PLATFORM_EXPORT WebString httpStatusText() const; |
119 BLINK_EXPORT void setHTTPStatusText(const WebString&); | 119 BLINK_PLATFORM_EXPORT void setHTTPStatusText(const WebString&); |
120 | 120 |
121 BLINK_EXPORT WebString httpHeaderField(const WebString& name) const; | 121 BLINK_PLATFORM_EXPORT WebString httpHeaderField(const WebString& name) const
; |
122 BLINK_EXPORT void setHTTPHeaderField(const WebString& name, const WebString&
value); | 122 BLINK_PLATFORM_EXPORT void setHTTPHeaderField(const WebString& name, const W
ebString& value); |
123 BLINK_EXPORT void addHTTPHeaderField(const WebString& name, const WebString&
value); | 123 BLINK_PLATFORM_EXPORT void addHTTPHeaderField(const WebString& name, const W
ebString& value); |
124 BLINK_EXPORT void clearHTTPHeaderField(const WebString& name); | 124 BLINK_PLATFORM_EXPORT void clearHTTPHeaderField(const WebString& name); |
125 BLINK_EXPORT void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const; | 125 BLINK_PLATFORM_EXPORT void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) cons
t; |
126 | 126 |
127 BLINK_EXPORT double lastModifiedDate() const; | 127 BLINK_PLATFORM_EXPORT double lastModifiedDate() const; |
128 BLINK_EXPORT void setLastModifiedDate(double); | 128 BLINK_PLATFORM_EXPORT void setLastModifiedDate(double); |
129 | 129 |
130 BLINK_EXPORT long long appCacheID() const; | 130 BLINK_PLATFORM_EXPORT long long appCacheID() const; |
131 BLINK_EXPORT void setAppCacheID(long long); | 131 BLINK_PLATFORM_EXPORT void setAppCacheID(long long); |
132 | 132 |
133 BLINK_EXPORT WebURL appCacheManifestURL() const; | 133 BLINK_PLATFORM_EXPORT WebURL appCacheManifestURL() const; |
134 BLINK_EXPORT void setAppCacheManifestURL(const WebURL&); | 134 BLINK_PLATFORM_EXPORT void setAppCacheManifestURL(const WebURL&); |
135 | 135 |
136 // A consumer controlled value intended to be used to record opaque | 136 // A consumer controlled value intended to be used to record opaque |
137 // security info related to this request. | 137 // security info related to this request. |
138 BLINK_EXPORT WebCString securityInfo() const; | 138 BLINK_PLATFORM_EXPORT WebCString securityInfo() const; |
139 BLINK_EXPORT void setSecurityInfo(const WebCString&); | 139 BLINK_PLATFORM_EXPORT void setSecurityInfo(const WebCString&); |
140 | 140 |
141 #if BLINK_IMPLEMENTATION | 141 #if INSIDE_BLINK |
142 WebCore::ResourceResponse& toMutableResourceResponse(); | 142 BLINK_PLATFORM_EXPORT WebCore::ResourceResponse& toMutableResourceResponse()
; |
143 const WebCore::ResourceResponse& toResourceResponse() const; | 143 BLINK_PLATFORM_EXPORT const WebCore::ResourceResponse& toResourceResponse()
const; |
144 #endif | 144 #endif |
145 | 145 |
146 // Flag whether this request was served from the disk cache entry. | 146 // Flag whether this request was served from the disk cache entry. |
147 BLINK_EXPORT bool wasCached() const; | 147 BLINK_PLATFORM_EXPORT bool wasCached() const; |
148 BLINK_EXPORT void setWasCached(bool); | 148 BLINK_PLATFORM_EXPORT void setWasCached(bool); |
149 | 149 |
150 // Flag whether this request was loaded via the SPDY protocol or not. | 150 // Flag whether this request was loaded via the SPDY protocol or not. |
151 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy | 151 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy |
152 BLINK_EXPORT bool wasFetchedViaSPDY() const; | 152 BLINK_PLATFORM_EXPORT bool wasFetchedViaSPDY() const; |
153 BLINK_EXPORT void setWasFetchedViaSPDY(bool); | 153 BLINK_PLATFORM_EXPORT void setWasFetchedViaSPDY(bool); |
154 | 154 |
155 // Flag whether this request was loaded after the TLS/Next-Protocol-Negotiat
ion was used. | 155 // Flag whether this request was loaded after the TLS/Next-Protocol-Negotiat
ion was used. |
156 // This is related to SPDY. | 156 // This is related to SPDY. |
157 BLINK_EXPORT bool wasNpnNegotiated() const; | 157 BLINK_PLATFORM_EXPORT bool wasNpnNegotiated() const; |
158 BLINK_EXPORT void setWasNpnNegotiated(bool); | 158 BLINK_PLATFORM_EXPORT void setWasNpnNegotiated(bool); |
159 | 159 |
160 // Flag whether this request was made when "Alternate-Protocol: xxx" | 160 // Flag whether this request was made when "Alternate-Protocol: xxx" |
161 // is present in server's response. | 161 // is present in server's response. |
162 BLINK_EXPORT bool wasAlternateProtocolAvailable() const; | 162 BLINK_PLATFORM_EXPORT bool wasAlternateProtocolAvailable() const; |
163 BLINK_EXPORT void setWasAlternateProtocolAvailable(bool); | 163 BLINK_PLATFORM_EXPORT void setWasAlternateProtocolAvailable(bool); |
164 | 164 |
165 // Flag whether this request was loaded via an explicit proxy (HTTP, SOCKS,
etc). | 165 // Flag whether this request was loaded via an explicit proxy (HTTP, SOCKS,
etc). |
166 BLINK_EXPORT bool wasFetchedViaProxy() const; | 166 BLINK_PLATFORM_EXPORT bool wasFetchedViaProxy() const; |
167 BLINK_EXPORT void setWasFetchedViaProxy(bool); | 167 BLINK_PLATFORM_EXPORT void setWasFetchedViaProxy(bool); |
168 | 168 |
169 // Flag whether this request is part of a multipart response. | 169 // Flag whether this request is part of a multipart response. |
170 BLINK_EXPORT bool isMultipartPayload() const; | 170 BLINK_PLATFORM_EXPORT bool isMultipartPayload() const; |
171 BLINK_EXPORT void setIsMultipartPayload(bool); | 171 BLINK_PLATFORM_EXPORT void setIsMultipartPayload(bool); |
172 | 172 |
173 // This indicates the location of a downloaded response if the | 173 // This indicates the location of a downloaded response if the |
174 // WebURLRequest had the downloadToFile flag set to true. This file path | 174 // WebURLRequest had the downloadToFile flag set to true. This file path |
175 // remains valid for the lifetime of the WebURLLoader used to create it. | 175 // remains valid for the lifetime of the WebURLLoader used to create it. |
176 BLINK_EXPORT WebString downloadFilePath() const; | 176 BLINK_PLATFORM_EXPORT WebString downloadFilePath() const; |
177 BLINK_EXPORT void setDownloadFilePath(const WebString&); | 177 BLINK_PLATFORM_EXPORT void setDownloadFilePath(const WebString&); |
178 | 178 |
179 // Remote IP address of the socket which fetched this resource. | 179 // Remote IP address of the socket which fetched this resource. |
180 BLINK_EXPORT WebString remoteIPAddress() const; | 180 BLINK_PLATFORM_EXPORT WebString remoteIPAddress() const; |
181 BLINK_EXPORT void setRemoteIPAddress(const WebString&); | 181 BLINK_PLATFORM_EXPORT void setRemoteIPAddress(const WebString&); |
182 | 182 |
183 // Remote port number of the socket which fetched this resource. | 183 // Remote port number of the socket which fetched this resource. |
184 BLINK_EXPORT unsigned short remotePort() const; | 184 BLINK_PLATFORM_EXPORT unsigned short remotePort() const; |
185 BLINK_EXPORT void setRemotePort(unsigned short); | 185 BLINK_PLATFORM_EXPORT void setRemotePort(unsigned short); |
186 | 186 |
187 // Extra data associated with the underlying resource response. Resource | 187 // Extra data associated with the underlying resource response. Resource |
188 // responses can be copied. If non-null, each copy of a resource response | 188 // responses can be copied. If non-null, each copy of a resource response |
189 // holds a pointer to the extra data, and the extra data pointer will be | 189 // holds a pointer to the extra data, and the extra data pointer will be |
190 // deleted when the last resource response is destroyed. Setting the extra | 190 // deleted when the last resource response is destroyed. Setting the extra |
191 // data pointer will cause the underlying resource response to be | 191 // data pointer will cause the underlying resource response to be |
192 // dissociated from any existing non-null extra data pointer. | 192 // dissociated from any existing non-null extra data pointer. |
193 BLINK_EXPORT ExtraData* extraData() const; | 193 BLINK_PLATFORM_EXPORT ExtraData* extraData() const; |
194 BLINK_EXPORT void setExtraData(ExtraData*); | 194 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
195 | 195 |
196 protected: | 196 protected: |
197 void assign(WebURLResponsePrivate*); | 197 BLINK_PLATFORM_EXPORT void assign(WebURLResponsePrivate*); |
198 | 198 |
199 private: | 199 private: |
200 WebURLResponsePrivate* m_private; | 200 WebURLResponsePrivate* m_private; |
201 }; | 201 }; |
202 | 202 |
203 } // namespace WebKit | 203 } // namespace WebKit |
204 | 204 |
205 #endif | 205 #endif |
OLD | NEW |