Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: content/child/web_url_loader_impl.cc

Issue 877323009: Extracted media mime type checks from net/base/ into media/base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fixes #1 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/child/child_thread_impl.h" 18 #include "content/child/child_thread_impl.h"
19 #include "content/child/ftp_directory_listing_response_delegate.h" 19 #include "content/child/ftp_directory_listing_response_delegate.h"
20 #include "content/child/multipart_response_delegate.h" 20 #include "content/child/multipart_response_delegate.h"
21 #include "content/child/request_extra_data.h" 21 #include "content/child/request_extra_data.h"
22 #include "content/child/request_info.h" 22 #include "content/child/request_info.h"
23 #include "content/child/resource_dispatcher.h" 23 #include "content/child/resource_dispatcher.h"
24 #include "content/child/sync_load_response.h" 24 #include "content/child/sync_load_response.h"
25 #include "content/child/web_data_consumer_handle_impl.h" 25 #include "content/child/web_data_consumer_handle_impl.h"
26 #include "content/child/web_url_request_util.h" 26 #include "content/child/web_url_request_util.h"
27 #include "content/child/weburlresponse_extradata_impl.h" 27 #include "content/child/weburlresponse_extradata_impl.h"
28 #include "content/common/mime_util.h"
28 #include "content/common/resource_messages.h" 29 #include "content/common/resource_messages.h"
29 #include "content/common/resource_request_body.h" 30 #include "content/common/resource_request_body.h"
30 #include "content/common/service_worker/service_worker_types.h" 31 #include "content/common/service_worker/service_worker_types.h"
31 #include "content/public/child/request_peer.h" 32 #include "content/public/child/request_peer.h"
32 #include "content/public/common/content_switches.h" 33 #include "content/public/common/content_switches.h"
33 #include "net/base/data_url.h" 34 #include "net/base/data_url.h"
34 #include "net/base/filename_util.h" 35 #include "net/base/filename_util.h"
35 #include "net/base/mime_util.h"
36 #include "net/base/net_errors.h" 36 #include "net/base/net_errors.h"
37 #include "net/http/http_response_headers.h" 37 #include "net/http/http_response_headers.h"
38 #include "net/http/http_util.h" 38 #include "net/http/http_util.h"
39 #include "net/url_request/redirect_info.h" 39 #include "net/url_request/redirect_info.h"
40 #include "net/url_request/url_request_data_job.h" 40 #include "net/url_request/url_request_data_job.h"
41 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" 41 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h"
42 #include "third_party/WebKit/public/platform/WebURL.h" 42 #include "third_party/WebKit/public/platform/WebURL.h"
43 #include "third_party/WebKit/public/platform/WebURLError.h" 43 #include "third_party/WebKit/public/platform/WebURLError.h"
44 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" 44 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h"
45 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" 45 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel) 794 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel)
795 return false; 795 return false;
796 #endif 796 #endif
797 797
798 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel && 798 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel &&
799 request_.frameType() != WebURLRequest::FrameTypeNested) 799 request_.frameType() != WebURLRequest::FrameTypeNested)
800 return true; 800 return true;
801 801
802 std::string mime_type, unused_charset; 802 std::string mime_type, unused_charset;
803 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && 803 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) &&
804 net::IsSupportedMimeType(mime_type)) 804 content::IsSupportedMimeType(mime_type))
805 return true; 805 return true;
806 806
807 return false; 807 return false;
808 } 808 }
809 809
810 void WebURLLoaderImpl::Context::HandleDataURL() { 810 void WebURLLoaderImpl::Context::HandleDataURL() {
811 DCHECK_NE(defers_loading_, DEFERRED_DATA); 811 DCHECK_NE(defers_loading_, DEFERRED_DATA);
812 if (defers_loading_ == SHOULD_DEFER) { 812 if (defers_loading_ == SHOULD_DEFER) {
813 defers_loading_ = DEFERRED_DATA; 813 defers_loading_ = DEFERRED_DATA;
814 return; 814 return;
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 int intra_priority_value) { 1138 int intra_priority_value) {
1139 context_->DidChangePriority(new_priority, intra_priority_value); 1139 context_->DidChangePriority(new_priority, intra_priority_value);
1140 } 1140 }
1141 1141
1142 bool WebURLLoaderImpl::attachThreadedDataReceiver( 1142 bool WebURLLoaderImpl::attachThreadedDataReceiver(
1143 blink::WebThreadedDataReceiver* threaded_data_receiver) { 1143 blink::WebThreadedDataReceiver* threaded_data_receiver) {
1144 return context_->AttachThreadedDataReceiver(threaded_data_receiver); 1144 return context_->AttachThreadedDataReceiver(threaded_data_receiver);
1145 } 1145 }
1146 1146
1147 } // namespace content 1147 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698