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

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

Issue 1987413002: Add link preload as=document support Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: crash fix 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>
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 DCHECK(requestContext == WebURLRequest::RequestContextForm || 72 DCHECK(requestContext == WebURLRequest::RequestContextForm ||
73 requestContext == WebURLRequest::RequestContextFrame || 73 requestContext == WebURLRequest::RequestContextFrame ||
74 requestContext == WebURLRequest::RequestContextHyperlink || 74 requestContext == WebURLRequest::RequestContextHyperlink ||
75 requestContext == WebURLRequest::RequestContextIframe || 75 requestContext == WebURLRequest::RequestContextIframe ||
76 requestContext == WebURLRequest::RequestContextInternal || 76 requestContext == WebURLRequest::RequestContextInternal ||
77 requestContext == WebURLRequest::RequestContextLocation); 77 requestContext == WebURLRequest::RequestContextLocation);
78 if (request.getFrameType() == WebURLRequest::FrameTypeTopLevel || 78 if (request.getFrameType() == WebURLRequest::FrameTypeTopLevel ||
79 request.getFrameType() == WebURLRequest::FrameTypeAuxiliary) { 79 request.getFrameType() == WebURLRequest::FrameTypeAuxiliary) {
80 return RESOURCE_TYPE_MAIN_FRAME; 80 return RESOURCE_TYPE_MAIN_FRAME;
81 } 81 }
82 if (request.getFrameType() == WebURLRequest::FrameTypeNested) 82 if (request.getFrameType() == WebURLRequest::FrameTypeNested ||
83 request.getFrameType() == WebURLRequest::FrameTypePreload) {
83 return RESOURCE_TYPE_SUB_FRAME; 84 return RESOURCE_TYPE_SUB_FRAME;
85 }
84 NOTREACHED(); 86 NOTREACHED();
85 return RESOURCE_TYPE_SUB_RESOURCE; 87 return RESOURCE_TYPE_SUB_RESOURCE;
86 } 88 }
87 89
88 switch (requestContext) { 90 switch (requestContext) {
89 // CSP report 91 // CSP report
90 case WebURLRequest::RequestContextCSPReport: 92 case WebURLRequest::RequestContextCSPReport:
91 return RESOURCE_TYPE_CSP_REPORT; 93 return RESOURCE_TYPE_CSP_REPORT;
92 94
93 // Favicon 95 // Favicon
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 bool stale_copy_in_cache, 495 bool stale_copy_in_cache,
494 int reason, 496 int reason,
495 bool was_ignored_by_handler) { 497 bool was_ignored_by_handler) {
496 blink::WebURLError error = 498 blink::WebURLError error =
497 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); 499 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason);
498 error.wasIgnoredByHandler = was_ignored_by_handler; 500 error.wasIgnoredByHandler = was_ignored_by_handler;
499 return error; 501 return error;
500 } 502 }
501 503
502 } // namespace content 504 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/public/common/request_context_frame_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698