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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "components/mime_util/mime_util.h" |
18 #include "content/child/child_thread_impl.h" | 19 #include "content/child/child_thread_impl.h" |
19 #include "content/child/ftp_directory_listing_response_delegate.h" | 20 #include "content/child/ftp_directory_listing_response_delegate.h" |
20 #include "content/child/multipart_response_delegate.h" | 21 #include "content/child/multipart_response_delegate.h" |
21 #include "content/child/request_extra_data.h" | 22 #include "content/child/request_extra_data.h" |
22 #include "content/child/request_info.h" | 23 #include "content/child/request_info.h" |
23 #include "content/child/resource_dispatcher.h" | 24 #include "content/child/resource_dispatcher.h" |
24 #include "content/child/sync_load_response.h" | 25 #include "content/child/sync_load_response.h" |
25 #include "content/child/web_data_consumer_handle_impl.h" | 26 #include "content/child/web_data_consumer_handle_impl.h" |
26 #include "content/child/web_url_request_util.h" | 27 #include "content/child/web_url_request_util.h" |
27 #include "content/child/weburlresponse_extradata_impl.h" | 28 #include "content/child/weburlresponse_extradata_impl.h" |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel) | 797 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel) |
797 return false; | 798 return false; |
798 #endif | 799 #endif |
799 | 800 |
800 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel && | 801 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel && |
801 request_.frameType() != WebURLRequest::FrameTypeNested) | 802 request_.frameType() != WebURLRequest::FrameTypeNested) |
802 return true; | 803 return true; |
803 | 804 |
804 std::string mime_type, unused_charset; | 805 std::string mime_type, unused_charset; |
805 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && | 806 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && |
806 net::IsSupportedMimeType(mime_type)) | 807 mime_util::IsSupportedMimeType(mime_type)) |
807 return true; | 808 return true; |
808 | 809 |
809 return false; | 810 return false; |
810 } | 811 } |
811 | 812 |
812 void WebURLLoaderImpl::Context::HandleDataURL() { | 813 void WebURLLoaderImpl::Context::HandleDataURL() { |
813 DCHECK_NE(defers_loading_, DEFERRED_DATA); | 814 DCHECK_NE(defers_loading_, DEFERRED_DATA); |
814 if (defers_loading_ == SHOULD_DEFER) { | 815 if (defers_loading_ == SHOULD_DEFER) { |
815 defers_loading_ = DEFERRED_DATA; | 816 defers_loading_ = DEFERRED_DATA; |
816 return; | 817 return; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 int intra_priority_value) { | 1118 int intra_priority_value) { |
1118 context_->DidChangePriority(new_priority, intra_priority_value); | 1119 context_->DidChangePriority(new_priority, intra_priority_value); |
1119 } | 1120 } |
1120 | 1121 |
1121 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 1122 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
1122 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 1123 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
1123 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 1124 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
1124 } | 1125 } |
1125 | 1126 |
1126 } // namespace content | 1127 } // namespace content |
OLD | NEW |