| OLD | NEW |
| 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/ftp_directory_listing_response_delegate.h" | 5 #include "content/child/ftp_directory_listing_response_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 namespace content { | 58 namespace content { |
| 59 | 59 |
| 60 FtpDirectoryListingResponseDelegate::FtpDirectoryListingResponseDelegate( | 60 FtpDirectoryListingResponseDelegate::FtpDirectoryListingResponseDelegate( |
| 61 WebURLLoaderClient* client, | 61 WebURLLoaderClient* client, |
| 62 WebURLLoader* loader, | 62 WebURLLoader* loader, |
| 63 const WebURLResponse& response) | 63 const WebURLResponse& response) |
| 64 : client_(client), | 64 : client_(client), |
| 65 loader_(loader) { | 65 loader_(loader) { |
| 66 if (response.extraData()) { | 66 if (response.getExtraData()) { |
| 67 // extraData can be NULL during tests. | 67 // extraData can be NULL during tests. |
| 68 WebURLResponseExtraDataImpl* extra_data = | 68 WebURLResponseExtraDataImpl* extra_data = |
| 69 static_cast<WebURLResponseExtraDataImpl*>(response.extraData()); | 69 static_cast<WebURLResponseExtraDataImpl*>(response.getExtraData()); |
| 70 extra_data->set_is_ftp_directory_listing(true); | 70 extra_data->set_is_ftp_directory_listing(true); |
| 71 } | 71 } |
| 72 Init(response.url()); | 72 Init(response.url()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void FtpDirectoryListingResponseDelegate::Cancel() { | 75 void FtpDirectoryListingResponseDelegate::Cancel() { |
| 76 client_ = NULL; | 76 client_ = NULL; |
| 77 loader_ = NULL; | 77 loader_ = NULL; |
| 78 } | 78 } |
| 79 | 79 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 void FtpDirectoryListingResponseDelegate::SendDataToClient( | 129 void FtpDirectoryListingResponseDelegate::SendDataToClient( |
| 130 const std::string& data) { | 130 const std::string& data) { |
| 131 if (client_) | 131 if (client_) |
| 132 client_->didReceiveData(loader_, data.data(), data.length(), -1); | 132 client_->didReceiveData(loader_, data.data(), data.length(), -1); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace content | 135 } // namespace content |
| OLD | NEW |