Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 TargetIsSharedWorker = 10, | 81 TargetIsSharedWorker = 10, |
| 82 TargetIsPrefetch = 11, | 82 TargetIsPrefetch = 11, |
| 83 TargetIsFavicon = 12, | 83 TargetIsFavicon = 12, |
| 84 TargetIsXHR = 13, | 84 TargetIsXHR = 13, |
| 85 TargetIsTextTrack = 14, | 85 TargetIsTextTrack = 14, |
| 86 TargetIsPing = 15, | 86 TargetIsPing = 15, |
| 87 TargetIsServiceWorker = 16, | 87 TargetIsServiceWorker = 16, |
| 88 TargetIsUnspecified = 17, | 88 TargetIsUnspecified = 17, |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 // FIXME: Drop the TargetType enum once embedders are updated upstream. | |
| 92 enum RequestContext { | |
| 93 UnspecifiedContext = 0, | |
|
abarth-chromium
2014/07/01 14:50:54
The normal naming we use in the API would be:
Req
Mike West
2014/07/01 15:00:20
Find and replace to the rescue!
| |
| 94 AudioContext, | |
| 95 ConnectContext, | |
| 96 DownloadContext, | |
| 97 FaviconContext, | |
| 98 FontContext, | |
| 99 FormContext, | |
| 100 ImageContext, | |
| 101 MainFrameContext, | |
| 102 ManifestContext, | |
| 103 ObjectContext, | |
| 104 ObjectRequestContext, | |
| 105 PingContext, | |
| 106 PopupContext, | |
| 107 PrefetchContext, | |
| 108 ScriptContext, | |
| 109 ServiceWorkerContext, | |
| 110 SharedWorkerContext, | |
| 111 StyleContext, | |
| 112 SubFrameContext, | |
| 113 SubresourceContext, | |
| 114 TextTrackContext, | |
| 115 VideoContext, | |
| 116 WorkerContext | |
| 117 }; | |
| 118 | |
| 91 class ExtraData { | 119 class ExtraData { |
| 92 public: | 120 public: |
| 93 virtual ~ExtraData() { } | 121 virtual ~ExtraData() { } |
| 94 }; | 122 }; |
| 95 | 123 |
| 96 ~WebURLRequest() { reset(); } | 124 ~WebURLRequest() { reset(); } |
| 97 | 125 |
| 98 WebURLRequest() : m_private(0) { } | 126 WebURLRequest() : m_private(0) { } |
| 99 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } | 127 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } |
| 100 WebURLRequest& operator=(const WebURLRequest& r) | 128 WebURLRequest& operator=(const WebURLRequest& r) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // Controls whether upload progress events are generated when a request | 175 // Controls whether upload progress events are generated when a request |
| 148 // has a body. | 176 // has a body. |
| 149 BLINK_PLATFORM_EXPORT bool reportUploadProgress() const; | 177 BLINK_PLATFORM_EXPORT bool reportUploadProgress() const; |
| 150 BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool); | 178 BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool); |
| 151 | 179 |
| 152 // Controls whether actual headers sent and received for request are | 180 // Controls whether actual headers sent and received for request are |
| 153 // collected and reported. | 181 // collected and reported. |
| 154 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const; | 182 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const; |
| 155 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool); | 183 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool); |
| 156 | 184 |
| 185 // FIXME: Remove these once content/ and net/ are updated. | |
| 157 BLINK_PLATFORM_EXPORT TargetType targetType() const; | 186 BLINK_PLATFORM_EXPORT TargetType targetType() const; |
| 158 BLINK_PLATFORM_EXPORT void setTargetType(TargetType); | 187 BLINK_PLATFORM_EXPORT void setTargetType(TargetType); |
| 159 | 188 |
| 189 BLINK_PLATFORM_EXPORT RequestContext requestContext() const; | |
| 190 BLINK_PLATFORM_EXPORT void setRequestContext(RequestContext); | |
| 191 | |
| 160 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; | 192 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; |
| 161 | 193 |
| 162 // Adds an HTTP origin header if it is empty and the HTTP method of the | 194 // Adds an HTTP origin header if it is empty and the HTTP method of the |
| 163 // request requires it. | 195 // request requires it. |
| 164 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin); | 196 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin); |
| 165 | 197 |
| 166 // True if the request was user initiated. | 198 // True if the request was user initiated. |
| 167 BLINK_PLATFORM_EXPORT bool hasUserGesture() const; | 199 BLINK_PLATFORM_EXPORT bool hasUserGesture() const; |
| 168 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool); | 200 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool); |
| 169 | 201 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 196 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); | 228 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
| 197 | 229 |
| 198 BLINK_PLATFORM_EXPORT Priority priority() const; | 230 BLINK_PLATFORM_EXPORT Priority priority() const; |
| 199 BLINK_PLATFORM_EXPORT void setPriority(Priority); | 231 BLINK_PLATFORM_EXPORT void setPriority(Priority); |
| 200 | 232 |
| 201 #if INSIDE_BLINK | 233 #if INSIDE_BLINK |
| 202 BLINK_PLATFORM_EXPORT WebCore::ResourceRequest& toMutableResourceRequest(); | 234 BLINK_PLATFORM_EXPORT WebCore::ResourceRequest& toMutableResourceRequest(); |
| 203 BLINK_PLATFORM_EXPORT const WebCore::ResourceRequest& toResourceRequest() co nst; | 235 BLINK_PLATFORM_EXPORT const WebCore::ResourceRequest& toResourceRequest() co nst; |
| 204 #endif | 236 #endif |
| 205 | 237 |
| 238 // FIXME: Drop these once we replace TargetType upstream. | |
| 239 static RequestContext requestContextFromTargetType(TargetType); | |
| 240 static TargetType targetTypeFromRequestContext(RequestContext); | |
| 206 protected: | 241 protected: |
| 207 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); | 242 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); |
| 208 | 243 |
| 209 private: | 244 private: |
| 210 WebURLRequestPrivate* m_private; | 245 WebURLRequestPrivate* m_private; |
| 211 }; | 246 }; |
| 212 | 247 |
| 213 } // namespace blink | 248 } // namespace blink |
| 214 | 249 |
| 215 #endif | 250 #endif |
| OLD | NEW |