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; | |
202 if (request.reportRawHeaders()) | 200 if (request.reportRawHeaders()) |
203 load_flags |= net::LOAD_REPORT_RAW_HEADERS; | 201 load_flags |= net::LOAD_REPORT_RAW_HEADERS; |
204 | 202 |
205 if (!request.allowStoredCredentials()) { | 203 if (!request.allowStoredCredentials()) { |
206 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; | 204 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; |
207 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; | 205 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; |
208 } | 206 } |
209 | 207 |
210 if (!request.allowStoredCredentials()) | 208 if (!request.allowStoredCredentials()) |
211 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; | 209 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; |
212 | 210 |
213 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && | 211 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && |
214 (url.has_username() || url.has_password())) { | 212 (url.has_username() || url.has_password())) { |
215 load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; | 213 load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; |
216 } | 214 } |
217 return load_flags; | 215 return load_flags; |
218 } | 216 } |
219 | 217 |
220 } // namespace content | 218 } // namespace content |
OLD | NEW |