OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "webkit/child/weburlloader_impl.h" | 7 #include "webkit/child/weburlloader_impl.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 if (info.headers.get() && info.mime_type == "multipart/x-mixed-replace") { | 540 if (info.headers.get() && info.mime_type == "multipart/x-mixed-replace") { |
541 std::string content_type; | 541 std::string content_type; |
542 info.headers->EnumerateHeader(NULL, "content-type", &content_type); | 542 info.headers->EnumerateHeader(NULL, "content-type", &content_type); |
543 | 543 |
544 std::string mime_type; | 544 std::string mime_type; |
545 std::string charset; | 545 std::string charset; |
546 bool had_charset = false; | 546 bool had_charset = false; |
547 std::string boundary; | 547 std::string boundary; |
548 net::HttpUtil::ParseContentType(content_type, &mime_type, &charset, | 548 net::HttpUtil::ParseContentType(content_type, &mime_type, &charset, |
549 &had_charset, &boundary); | 549 &had_charset, &boundary); |
550 TrimString(boundary, " \"", &boundary); | 550 base::TrimString(boundary, " \"", &boundary); |
551 | 551 |
552 // If there's no boundary, just handle the request normally. In the gecko | 552 // If there's no boundary, just handle the request normally. In the gecko |
553 // code, nsMultiMixedConv::OnStartRequest throws an exception. | 553 // code, nsMultiMixedConv::OnStartRequest throws an exception. |
554 if (!boundary.empty()) { | 554 if (!boundary.empty()) { |
555 multipart_delegate_.reset( | 555 multipart_delegate_.reset( |
556 new MultipartResponseDelegate(client_, loader_, response, boundary)); | 556 new MultipartResponseDelegate(client_, loader_, response, boundary)); |
557 } | 557 } |
558 } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && | 558 } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && |
559 !show_raw_listing) { | 559 !show_raw_listing) { |
560 ftp_listing_delegate_.reset( | 560 ftp_listing_delegate_.reset( |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 | 848 |
849 void WebURLLoaderImpl::setDefersLoading(bool value) { | 849 void WebURLLoaderImpl::setDefersLoading(bool value) { |
850 context_->SetDefersLoading(value); | 850 context_->SetDefersLoading(value); |
851 } | 851 } |
852 | 852 |
853 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 853 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
854 context_->DidChangePriority(new_priority); | 854 context_->DidChangePriority(new_priority); |
855 } | 855 } |
856 | 856 |
857 } // namespace webkit_glue | 857 } // namespace webkit_glue |
OLD | NEW |