| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org
/#concept-request-context-frame-type | 105 // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org
/#concept-request-context-frame-type |
| 106 enum FrameType { | 106 enum FrameType { |
| 107 FrameTypeAuxiliary, | 107 FrameTypeAuxiliary, |
| 108 FrameTypeNested, | 108 FrameTypeNested, |
| 109 FrameTypeNone, | 109 FrameTypeNone, |
| 110 FrameTypeTopLevel | 110 FrameTypeTopLevel |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 enum FetchRequestMode { |
| 114 FetchRequestModeSameOrigin, |
| 115 FetchRequestModeNoCORS, |
| 116 FetchRequestModeCORS, |
| 117 FetchRequestModeCORSWithForcedPreflight |
| 118 }; |
| 119 |
| 113 class ExtraData { | 120 class ExtraData { |
| 114 public: | 121 public: |
| 115 virtual ~ExtraData() { } | 122 virtual ~ExtraData() { } |
| 116 }; | 123 }; |
| 117 | 124 |
| 118 ~WebURLRequest() { reset(); } | 125 ~WebURLRequest() { reset(); } |
| 119 | 126 |
| 120 WebURLRequest() : m_private(0) { } | 127 WebURLRequest() : m_private(0) { } |
| 121 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } | 128 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } |
| 122 WebURLRequest& operator=(const WebURLRequest& r) | 129 WebURLRequest& operator=(const WebURLRequest& r) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 215 |
| 209 // If true, the response body will be downloaded to a file managed by the | 216 // If true, the response body will be downloaded to a file managed by the |
| 210 // WebURLLoader. See WebURLResponse::downloadedFilePath. | 217 // WebURLLoader. See WebURLResponse::downloadedFilePath. |
| 211 BLINK_PLATFORM_EXPORT bool downloadToFile() const; | 218 BLINK_PLATFORM_EXPORT bool downloadToFile() const; |
| 212 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool); | 219 BLINK_PLATFORM_EXPORT void setDownloadToFile(bool); |
| 213 | 220 |
| 214 // True if the request should not be handled by the ServiceWorker. | 221 // True if the request should not be handled by the ServiceWorker. |
| 215 BLINK_PLATFORM_EXPORT bool skipServiceWorker() const; | 222 BLINK_PLATFORM_EXPORT bool skipServiceWorker() const; |
| 216 BLINK_PLATFORM_EXPORT void setSkipServiceWorker(bool); | 223 BLINK_PLATFORM_EXPORT void setSkipServiceWorker(bool); |
| 217 | 224 |
| 225 // The request mode which will be passed to the ServiceWorker. |
| 226 BLINK_PLATFORM_EXPORT FetchRequestMode fetchRequestMode() const; |
| 227 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode); |
| 228 |
| 218 // Extra data associated with the underlying resource request. Resource | 229 // Extra data associated with the underlying resource request. Resource |
| 219 // requests can be copied. If non-null, each copy of a resource requests | 230 // requests can be copied. If non-null, each copy of a resource requests |
| 220 // holds a pointer to the extra data, and the extra data pointer will be | 231 // holds a pointer to the extra data, and the extra data pointer will be |
| 221 // deleted when the last resource request is destroyed. Setting the extra | 232 // deleted when the last resource request is destroyed. Setting the extra |
| 222 // data pointer will cause the underlying resource request to be | 233 // data pointer will cause the underlying resource request to be |
| 223 // dissociated from any existing non-null extra data pointer. | 234 // dissociated from any existing non-null extra data pointer. |
| 224 BLINK_PLATFORM_EXPORT ExtraData* extraData() const; | 235 BLINK_PLATFORM_EXPORT ExtraData* extraData() const; |
| 225 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); | 236 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
| 226 | 237 |
| 227 BLINK_PLATFORM_EXPORT Priority priority() const; | 238 BLINK_PLATFORM_EXPORT Priority priority() const; |
| 228 BLINK_PLATFORM_EXPORT void setPriority(Priority); | 239 BLINK_PLATFORM_EXPORT void setPriority(Priority); |
| 229 | 240 |
| 230 #if INSIDE_BLINK | 241 #if INSIDE_BLINK |
| 231 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); | 242 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); |
| 232 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; | 243 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; |
| 233 #endif | 244 #endif |
| 234 | 245 |
| 235 protected: | 246 protected: |
| 236 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); | 247 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); |
| 237 | 248 |
| 238 private: | 249 private: |
| 239 WebURLRequestPrivate* m_private; | 250 WebURLRequestPrivate* m_private; |
| 240 }; | 251 }; |
| 241 | 252 |
| 242 } // namespace blink | 253 } // namespace blink |
| 243 | 254 |
| 244 #endif | 255 #endif |
| OLD | NEW |