| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/weburlloader_impl.h" | 7 #include "webkit/glue/weburlloader_impl.h" | 
| 8 | 8 | 
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" | 
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" | 
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 555   // without a client and therefore without much need to do further handling. | 555   // without a client and therefore without much need to do further handling. | 
| 556   if (!client_) | 556   if (!client_) | 
| 557     return; | 557     return; | 
| 558 | 558 | 
| 559   DCHECK(!ftp_listing_delegate_.get()); | 559   DCHECK(!ftp_listing_delegate_.get()); | 
| 560   DCHECK(!multipart_delegate_.get()); | 560   DCHECK(!multipart_delegate_.get()); | 
| 561   if (info.headers && info.mime_type == "multipart/x-mixed-replace") { | 561   if (info.headers && info.mime_type == "multipart/x-mixed-replace") { | 
| 562     std::string content_type; | 562     std::string content_type; | 
| 563     info.headers->EnumerateHeader(NULL, "content-type", &content_type); | 563     info.headers->EnumerateHeader(NULL, "content-type", &content_type); | 
| 564 | 564 | 
| 565     std::string boundary = net::GetHeaderParamValue(content_type, "boundary"); | 565     std::string boundary = net::GetHeaderParamValue( | 
|  | 566         content_type, "boundary", net::QuoteRule::REMOVE_OUTER_QUOTES); | 
| 566     TrimString(boundary, " \"", &boundary); | 567     TrimString(boundary, " \"", &boundary); | 
| 567 | 568 | 
| 568     // If there's no boundary, just handle the request normally.  In the gecko | 569     // If there's no boundary, just handle the request normally.  In the gecko | 
| 569     // code, nsMultiMixedConv::OnStartRequest throws an exception. | 570     // code, nsMultiMixedConv::OnStartRequest throws an exception. | 
| 570     if (!boundary.empty()) { | 571     if (!boundary.empty()) { | 
| 571       multipart_delegate_.reset( | 572       multipart_delegate_.reset( | 
| 572           new MultipartResponseDelegate(client_, loader_, response, boundary)); | 573           new MultipartResponseDelegate(client_, loader_, response, boundary)); | 
| 573     } | 574     } | 
| 574   } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && | 575   } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && | 
| 575              !show_raw_listing) { | 576              !show_raw_listing) { | 
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 718 | 719 | 
| 719 void WebURLLoaderImpl::cancel() { | 720 void WebURLLoaderImpl::cancel() { | 
| 720   context_->Cancel(); | 721   context_->Cancel(); | 
| 721 } | 722 } | 
| 722 | 723 | 
| 723 void WebURLLoaderImpl::setDefersLoading(bool value) { | 724 void WebURLLoaderImpl::setDefersLoading(bool value) { | 
| 724   context_->SetDefersLoading(value); | 725   context_->SetDefersLoading(value); | 
| 725 } | 726 } | 
| 726 | 727 | 
| 727 }  // namespace webkit_glue | 728 }  // namespace webkit_glue | 
| OLD | NEW | 
|---|