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 <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 bool WebURLLoaderImpl::Context::CanHandleDataURLRequestLocally() const { | 771 bool WebURLLoaderImpl::Context::CanHandleDataURLRequestLocally() const { |
772 GURL url = request_.url(); | 772 GURL url = request_.url(); |
773 if (!url.SchemeIs(url::kDataScheme)) | 773 if (!url.SchemeIs(url::kDataScheme)) |
774 return false; | 774 return false; |
775 | 775 |
776 // The fast paths for data URL, Start() and HandleDataURL(), don't support | 776 // The fast paths for data URL, Start() and HandleDataURL(), don't support |
777 // the downloadToFile option. | 777 // the downloadToFile option. |
778 if (request_.downloadToFile()) | 778 if (request_.downloadToFile()) |
779 return false; | 779 return false; |
780 | 780 |
781 // Data url requests from object tags may need to be intercepted as streams | |
782 // and so need to be sent to the browser. | |
783 if (request_.requestContext() == WebURLRequest::RequestContextObject) | |
Sam McNally
2015/04/22 04:05:03
What about WebURLRequest::RequestContextEmbed?
raymes
2015/04/22 04:11:48
It's not used for MimeHandlers so we don't need to
| |
784 return false; | |
785 | |
781 // Optimize for the case where we can handle a data URL locally. We must | 786 // Optimize for the case where we can handle a data URL locally. We must |
782 // skip this for data URLs targetted at frames since those could trigger a | 787 // skip this for data URLs targetted at frames since those could trigger a |
783 // download. | 788 // download. |
784 // | 789 // |
785 // NOTE: We special case MIME types we can render both for performance | 790 // NOTE: We special case MIME types we can render both for performance |
786 // reasons as well as to support unit tests. | 791 // reasons as well as to support unit tests. |
787 | 792 |
788 #if defined(OS_ANDROID) | 793 #if defined(OS_ANDROID) |
789 // For compatibility reasons on Android we need to expose top-level data:// | 794 // For compatibility reasons on Android we need to expose top-level data:// |
790 // to the browser. | 795 // to the browser. |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1112 int intra_priority_value) { | 1117 int intra_priority_value) { |
1113 context_->DidChangePriority(new_priority, intra_priority_value); | 1118 context_->DidChangePriority(new_priority, intra_priority_value); |
1114 } | 1119 } |
1115 | 1120 |
1116 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 1121 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
1117 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 1122 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
1118 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 1123 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
1119 } | 1124 } |
1120 | 1125 |
1121 } // namespace content | 1126 } // namespace content |
OLD | NEW |