OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/child/web_url_request_util.h" | 5 #include "content/child/web_url_request_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
10 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" | 10 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 break; | 190 break; |
191 case WebURLRequest::ReturnCacheDataDontLoad: | 191 case WebURLRequest::ReturnCacheDataDontLoad: |
192 load_flags |= net::LOAD_ONLY_FROM_CACHE; | 192 load_flags |= net::LOAD_ONLY_FROM_CACHE; |
193 break; | 193 break; |
194 case WebURLRequest::UseProtocolCachePolicy: | 194 case WebURLRequest::UseProtocolCachePolicy: |
195 break; | 195 break; |
196 default: | 196 default: |
197 NOTREACHED(); | 197 NOTREACHED(); |
198 } | 198 } |
199 | 199 |
| 200 if (request.reportUploadProgress()) |
| 201 load_flags |= net::LOAD_ENABLE_UPLOAD_PROGRESS; |
200 if (request.reportRawHeaders()) | 202 if (request.reportRawHeaders()) |
201 load_flags |= net::LOAD_REPORT_RAW_HEADERS; | 203 load_flags |= net::LOAD_REPORT_RAW_HEADERS; |
202 | 204 |
203 if (!request.allowStoredCredentials()) { | 205 if (!request.allowStoredCredentials()) { |
204 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; | 206 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; |
205 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; | 207 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; |
206 } | 208 } |
207 | 209 |
208 if (!request.allowStoredCredentials()) | 210 if (!request.allowStoredCredentials()) |
209 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; | 211 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; |
210 | 212 |
211 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && | 213 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && |
212 (url.has_username() || url.has_password())) { | 214 (url.has_username() || url.has_password())) { |
213 load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; | 215 load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; |
214 } | 216 } |
215 return load_flags; | 217 return load_flags; |
216 } | 218 } |
217 | 219 |
218 } // namespace content | 220 } // namespace content |
OLD | NEW |