| 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_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 // skip this for data URLs targetted at frames since those could trigger a | 921 // skip this for data URLs targetted at frames since those could trigger a |
| 922 // download. | 922 // download. |
| 923 // | 923 // |
| 924 // NOTE: We special case MIME types we can render both for performance | 924 // NOTE: We special case MIME types we can render both for performance |
| 925 // reasons as well as to support unit tests. | 925 // reasons as well as to support unit tests. |
| 926 | 926 |
| 927 #if defined(OS_ANDROID) | 927 #if defined(OS_ANDROID) |
| 928 // For compatibility reasons on Android we need to expose top-level data:// | 928 // For compatibility reasons on Android we need to expose top-level data:// |
| 929 // to the browser. In tests resource_dispatcher_ can be null, and test pages | 929 // to the browser. In tests resource_dispatcher_ can be null, and test pages |
| 930 // need to be loaded locally. | 930 // need to be loaded locally. |
| 931 // For PlzNavigate, navigation requests were already checked in the browser. |
| 931 if (resource_dispatcher_ && | 932 if (resource_dispatcher_ && |
| 932 request_.getFrameType() == WebURLRequest::FrameTypeTopLevel) | 933 request_.getFrameType() == WebURLRequest::FrameTypeTopLevel) { |
| 933 return false; | 934 if (!IsBrowserSideNavigationEnabled()) |
| 935 return false; |
| 936 } |
| 934 #endif | 937 #endif |
| 935 | 938 |
| 936 if (request_.getFrameType() != WebURLRequest::FrameTypeTopLevel && | 939 if (request_.getFrameType() != WebURLRequest::FrameTypeTopLevel && |
| 937 request_.getFrameType() != WebURLRequest::FrameTypeNested) | 940 request_.getFrameType() != WebURLRequest::FrameTypeNested) |
| 938 return true; | 941 return true; |
| 939 | 942 |
| 940 std::string mime_type, unused_charset; | 943 std::string mime_type, unused_charset; |
| 941 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && | 944 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && |
| 942 mime_util::IsSupportedMimeType(mime_type)) | 945 mime_util::IsSupportedMimeType(mime_type)) |
| 943 return true; | 946 return true; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 int intra_priority_value) { | 1250 int intra_priority_value) { |
| 1248 context_->DidChangePriority(new_priority, intra_priority_value); | 1251 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1249 } | 1252 } |
| 1250 | 1253 |
| 1251 void WebURLLoaderImpl::setLoadingTaskRunner( | 1254 void WebURLLoaderImpl::setLoadingTaskRunner( |
| 1252 base::SingleThreadTaskRunner* loading_task_runner) { | 1255 base::SingleThreadTaskRunner* loading_task_runner) { |
| 1253 context_->SetTaskRunner(loading_task_runner); | 1256 context_->SetTaskRunner(loading_task_runner); |
| 1254 } | 1257 } |
| 1255 | 1258 |
| 1256 } // namespace content | 1259 } // namespace content |
| OLD | NEW |