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

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 TODO 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
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 210 }
210 211
211 if (!request.allowStoredCredentials()) { 212 if (!request.allowStoredCredentials()) {
212 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; 213 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES;
213 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; 214 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES;
214 } 215 }
215 216
216 if (!request.allowStoredCredentials()) 217 if (!request.allowStoredCredentials())
217 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; 218 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA;
218 219
220 if (request.getExtraData()) {
221 RequestExtraData* extra_data =
222 static_cast<RequestExtraData*>(request.getExtraData());
223 if (extra_data->is_prefetch())
224 load_flags |= net::LOAD_PREFETCH;
225 }
226
219 return load_flags; 227 return load_flags;
220 } 228 }
221 229
222 WebHTTPBody GetWebHTTPBodyForRequestBody( 230 WebHTTPBody GetWebHTTPBodyForRequestBody(
223 const scoped_refptr<ResourceRequestBodyImpl>& input) { 231 const scoped_refptr<ResourceRequestBodyImpl>& input) {
224 WebHTTPBody http_body; 232 WebHTTPBody http_body;
225 http_body.initialize(); 233 http_body.initialize();
226 http_body.setIdentifier(input->identifier()); 234 http_body.setIdentifier(input->identifier());
227 for (const auto& element : *input->elements()) { 235 for (const auto& element : *input->elements()) {
228 switch (element.type()) { 236 switch (element.type()) {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 bool stale_copy_in_cache, 500 bool stale_copy_in_cache,
493 int reason, 501 int reason,
494 bool was_ignored_by_handler) { 502 bool was_ignored_by_handler) {
495 blink::WebURLError error = 503 blink::WebURLError error =
496 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); 504 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason);
497 error.wasIgnoredByHandler = was_ignored_by_handler; 505 error.wasIgnoredByHandler = was_ignored_by_handler;
498 return error; 506 return error;
499 } 507 }
500 508
501 } // namespace content 509 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698