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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |