Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: content/child/web_url_request_util.cc

Issue 2262183002: [NoStatePrefetch] Do not send responses to renderer in prefetch mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefetchProto
Patch Set: remove WebDocument api Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "content/child/request_extra_data.h"
14 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
15 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
16 #include "third_party/WebKit/public/platform/FilePathConversion.h" 17 #include "third_party/WebKit/public/platform/FilePathConversion.h"
17 #include "third_party/WebKit/public/platform/WebCachePolicy.h" 18 #include "third_party/WebKit/public/platform/WebCachePolicy.h"
18 #include "third_party/WebKit/public/platform/WebData.h" 19 #include "third_party/WebKit/public/platform/WebData.h"
19 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" 20 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h"
20 #include "third_party/WebKit/public/platform/WebString.h" 21 #include "third_party/WebKit/public/platform/WebString.h"
21 #include "third_party/WebKit/public/platform/WebURL.h" 22 #include "third_party/WebKit/public/platform/WebURL.h"
22 #include "third_party/WebKit/public/platform/WebURLError.h" 23 #include "third_party/WebKit/public/platform/WebURLError.h"
23 #include "third_party/WebKit/public/platform/WebURLRequest.h" 24 #include "third_party/WebKit/public/platform/WebURLRequest.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 211 }
211 212
212 if (!request.allowStoredCredentials()) { 213 if (!request.allowStoredCredentials()) {
213 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; 214 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES;
214 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; 215 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES;
215 } 216 }
216 217
217 if (!request.allowStoredCredentials()) 218 if (!request.allowStoredCredentials())
218 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; 219 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA;
219 220
221 if (request.getExtraData()) {
222 RequestExtraData* extra_data =
223 static_cast<RequestExtraData*>(request.getExtraData());
224 if (extra_data->is_prefetch())
225 load_flags |= net::LOAD_PREFETCH;
226 }
227
220 return load_flags; 228 return load_flags;
221 } 229 }
222 230
223 WebHTTPBody GetWebHTTPBodyForRequestBody( 231 WebHTTPBody GetWebHTTPBodyForRequestBody(
224 const scoped_refptr<ResourceRequestBodyImpl>& input) { 232 const scoped_refptr<ResourceRequestBodyImpl>& input) {
225 WebHTTPBody http_body; 233 WebHTTPBody http_body;
226 http_body.initialize(); 234 http_body.initialize();
227 http_body.setIdentifier(input->identifier()); 235 http_body.setIdentifier(input->identifier());
228 for (const auto& element : *input->elements()) { 236 for (const auto& element : *input->elements()) {
229 switch (element.type()) { 237 switch (element.type()) {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 bool stale_copy_in_cache, 501 bool stale_copy_in_cache,
494 int reason, 502 int reason,
495 bool was_ignored_by_handler) { 503 bool was_ignored_by_handler) {
496 blink::WebURLError error = 504 blink::WebURLError error =
497 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); 505 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason);
498 error.wasIgnoredByHandler = was_ignored_by_handler; 506 error.wasIgnoredByHandler = was_ignored_by_handler;
499 return error; 507 return error;
500 } 508 }
501 509
502 } // namespace content 510 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698