Chromium Code Reviews| 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, only send renderer-initiated requests to 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 request_.checkForBrowserSideNavigation()) { | |
|
clamy
2017/03/06 14:41:06
Can we really get there with request_.checkForBrow
jam
2017/03/06 16:07:07
Ah, I had added that second part of the condition
| |
| 936 return false; | |
| 937 } | |
| 938 } | |
| 934 #endif | 939 #endif |
| 935 | 940 |
| 936 if (request_.getFrameType() != WebURLRequest::FrameTypeTopLevel && | 941 if (request_.getFrameType() != WebURLRequest::FrameTypeTopLevel && |
| 937 request_.getFrameType() != WebURLRequest::FrameTypeNested) | 942 request_.getFrameType() != WebURLRequest::FrameTypeNested) |
| 938 return true; | 943 return true; |
| 939 | 944 |
| 940 std::string mime_type, unused_charset; | 945 std::string mime_type, unused_charset; |
| 941 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && | 946 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && |
| 942 mime_util::IsSupportedMimeType(mime_type)) | 947 mime_util::IsSupportedMimeType(mime_type)) |
| 943 return true; | 948 return true; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1247 int intra_priority_value) { | 1252 int intra_priority_value) { |
| 1248 context_->DidChangePriority(new_priority, intra_priority_value); | 1253 context_->DidChangePriority(new_priority, intra_priority_value); |
| 1249 } | 1254 } |
| 1250 | 1255 |
| 1251 void WebURLLoaderImpl::setLoadingTaskRunner( | 1256 void WebURLLoaderImpl::setLoadingTaskRunner( |
| 1252 base::SingleThreadTaskRunner* loading_task_runner) { | 1257 base::SingleThreadTaskRunner* loading_task_runner) { |
| 1253 context_->SetTaskRunner(loading_task_runner); | 1258 context_->SetTaskRunner(loading_task_runner); |
| 1254 } | 1259 } |
| 1255 | 1260 |
| 1256 } // namespace content | 1261 } // namespace content |
| OLD | NEW |