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

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

Issue 1110833003: Move the IsSupported* mime functions out of //net and into //components/mime_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 7 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
« no previous file with comments | « content/child/simple_webmimeregistry_impl.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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"
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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel) 796 if (request_.frameType() == WebURLRequest::FrameTypeTopLevel)
797 return false; 797 return false;
798 #endif 798 #endif
799 799
800 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel && 800 if (request_.frameType() != WebURLRequest::FrameTypeTopLevel &&
801 request_.frameType() != WebURLRequest::FrameTypeNested) 801 request_.frameType() != WebURLRequest::FrameTypeNested)
802 return true; 802 return true;
803 803
804 std::string mime_type, unused_charset; 804 std::string mime_type, unused_charset;
805 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) && 805 if (net::DataURL::Parse(request_.url(), &mime_type, &unused_charset, NULL) &&
806 net::IsSupportedMimeType(mime_type)) 806 mime_util::IsSupportedMimeType(mime_type))
807 return true; 807 return true;
808 808
809 return false; 809 return false;
810 } 810 }
811 811
812 void WebURLLoaderImpl::Context::HandleDataURL() { 812 void WebURLLoaderImpl::Context::HandleDataURL() {
813 DCHECK_NE(defers_loading_, DEFERRED_DATA); 813 DCHECK_NE(defers_loading_, DEFERRED_DATA);
814 if (defers_loading_ == SHOULD_DEFER) { 814 if (defers_loading_ == SHOULD_DEFER) {
815 defers_loading_ = DEFERRED_DATA; 815 defers_loading_ = DEFERRED_DATA;
816 return; 816 return;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 int intra_priority_value) { 1117 int intra_priority_value) {
1118 context_->DidChangePriority(new_priority, intra_priority_value); 1118 context_->DidChangePriority(new_priority, intra_priority_value);
1119 } 1119 }
1120 1120
1121 bool WebURLLoaderImpl::attachThreadedDataReceiver( 1121 bool WebURLLoaderImpl::attachThreadedDataReceiver(
1122 blink::WebThreadedDataReceiver* threaded_data_receiver) { 1122 blink::WebThreadedDataReceiver* threaded_data_receiver) {
1123 return context_->AttachThreadedDataReceiver(threaded_data_receiver); 1123 return context_->AttachThreadedDataReceiver(threaded_data_receiver);
1124 } 1124 }
1125 1125
1126 } // namespace content 1126 } // namespace content
OLDNEW
« no previous file with comments | « content/child/simple_webmimeregistry_impl.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698