Chromium Code Reviews| 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/glue/weburlloader_impl.h" | 7 #include "webkit/glue/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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 if (info.mime_type == "text/vnd.chromium.ftp-dir") { | 644 if (info.mime_type == "text/vnd.chromium.ftp-dir") { |
| 645 if (show_raw_listing) { | 645 if (show_raw_listing) { |
| 646 // Set the MIME type to plain text to prevent any active content. | 646 // Set the MIME type to plain text to prevent any active content. |
| 647 response.setMIMEType("text/plain"); | 647 response.setMIMEType("text/plain"); |
| 648 } else { | 648 } else { |
| 649 // We're going to produce a parsed listing in HTML. | 649 // We're going to produce a parsed listing in HTML. |
| 650 response.setMIMEType("text/html"); | 650 response.setMIMEType("text/html"); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 | 653 |
| 654 scoped_refptr<Context> protect(this); | |
|
darin (slow to review)
2013/05/23 14:42:09
This looks like it'll do the trick to me. However
gavinp
2013/05/28 16:25:35
Certainly the caller could, but that would be a bi
| |
| 654 client_->didReceiveResponse(loader_, response); | 655 client_->didReceiveResponse(loader_, response); |
| 655 | 656 |
| 656 // We may have been cancelled after didReceiveResponse, which would leave us | 657 // We may have been cancelled after didReceiveResponse, which would leave us |
| 657 // without a client and therefore without much need to do further handling. | 658 // without a client and therefore without much need to do further handling. |
| 658 if (!client_) | 659 if (!client_) |
| 659 return; | 660 return; |
| 660 | 661 |
| 661 DCHECK(!ftp_listing_delegate_.get()); | 662 DCHECK(!ftp_listing_delegate_.get()); |
| 662 DCHECK(!multipart_delegate_.get()); | 663 DCHECK(!multipart_delegate_.get()); |
| 663 if (info.headers && info.mime_type == "multipart/x-mixed-replace") { | 664 if (info.headers && info.mime_type == "multipart/x-mixed-replace") { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 859 | 860 |
| 860 void WebURLLoaderImpl::setDefersLoading(bool value) { | 861 void WebURLLoaderImpl::setDefersLoading(bool value) { |
| 861 context_->SetDefersLoading(value); | 862 context_->SetDefersLoading(value); |
| 862 } | 863 } |
| 863 | 864 |
| 864 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 865 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
| 865 context_->DidChangePriority(new_priority); | 866 context_->DidChangePriority(new_priority); |
| 866 } | 867 } |
| 867 | 868 |
| 868 } // namespace webkit_glue | 869 } // namespace webkit_glue |
| OLD | NEW |