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/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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 WebKitPlatformSupportImpl* platform); | 339 WebKitPlatformSupportImpl* platform); |
| 340 | 340 |
| 341 // ResourceLoaderBridge::Peer methods: | 341 // ResourceLoaderBridge::Peer methods: |
| 342 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 342 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
| 343 virtual bool OnReceivedRedirect( | 343 virtual bool OnReceivedRedirect( |
| 344 const GURL& new_url, | 344 const GURL& new_url, |
| 345 const ResourceResponseInfo& info, | 345 const ResourceResponseInfo& info, |
| 346 bool* has_new_first_party_for_cookies, | 346 bool* has_new_first_party_for_cookies, |
| 347 GURL* new_first_party_for_cookies) OVERRIDE; | 347 GURL* new_first_party_for_cookies) OVERRIDE; |
| 348 virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE; | 348 virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE; |
| 349 virtual void OnDownloadedData(int len) OVERRIDE; | 349 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; |
| 350 virtual void OnReceivedData(const char* data, | 350 virtual void OnReceivedData(const char* data, |
| 351 int data_length, | 351 int data_length, |
| 352 int encoded_data_length) OVERRIDE; | 352 int encoded_data_length) OVERRIDE; |
| 353 virtual void OnReceivedCachedMetadata(const char* data, int len) OVERRIDE; | 353 virtual void OnReceivedCachedMetadata(const char* data, int len) OVERRIDE; |
| 354 virtual void OnCompletedRequest( | 354 virtual void OnCompletedRequest( |
| 355 int error_code, | 355 int error_code, |
| 356 bool was_ignored_by_handler, | 356 bool was_ignored_by_handler, |
| 357 const std::string& security_info, | 357 const std::string& security_info, |
| 358 const base::TimeTicks& completion_time) OVERRIDE; | 358 const base::TimeTicks& completion_time) OVERRIDE; |
| 359 | 359 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 663 multipart_delegate_.reset( | 663 multipart_delegate_.reset( |
| 664 new MultipartResponseDelegate(client_, loader_, response, boundary)); | 664 new MultipartResponseDelegate(client_, loader_, response, boundary)); |
| 665 } | 665 } |
| 666 } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && | 666 } else if (info.mime_type == "text/vnd.chromium.ftp-dir" && |
| 667 !show_raw_listing) { | 667 !show_raw_listing) { |
| 668 ftp_listing_delegate_.reset( | 668 ftp_listing_delegate_.reset( |
| 669 new FtpDirectoryListingResponseDelegate(client_, loader_, response)); | 669 new FtpDirectoryListingResponseDelegate(client_, loader_, response)); |
| 670 } | 670 } |
| 671 } | 671 } |
| 672 | 672 |
| 673 void WebURLLoaderImpl::Context::OnDownloadedData(int len) { | 673 void WebURLLoaderImpl::Context::OnDownloadedData(int len, |
| 674 int encoded_data_length) { | |
| 674 if (client_) | 675 if (client_) |
| 675 client_->didDownloadData(loader_, len); | 676 client_->didDownloadData(loader_, len, encoded_data_length); |
|
michaeln
2013/08/29 20:19:05
need to do the two-sided patch dance here
yusukesuzuki
2013/08/30 01:13:23
Right. This patch will become green after Blink is
| |
| 676 } | 677 } |
| 677 | 678 |
| 678 void WebURLLoaderImpl::Context::OnReceivedData(const char* data, | 679 void WebURLLoaderImpl::Context::OnReceivedData(const char* data, |
| 679 int data_length, | 680 int data_length, |
| 680 int encoded_data_length) { | 681 int encoded_data_length) { |
| 681 if (!client_) | 682 if (!client_) |
| 682 return; | 683 return; |
| 683 | 684 |
| 684 if (ftp_listing_delegate_) { | 685 if (ftp_listing_delegate_) { |
| 685 // The FTP listing delegate will make the appropriate calls to | 686 // The FTP listing delegate will make the appropriate calls to |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 | 845 |
| 845 void WebURLLoaderImpl::setDefersLoading(bool value) { | 846 void WebURLLoaderImpl::setDefersLoading(bool value) { |
| 846 context_->SetDefersLoading(value); | 847 context_->SetDefersLoading(value); |
| 847 } | 848 } |
| 848 | 849 |
| 849 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 850 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
| 850 context_->DidChangePriority(new_priority); | 851 context_->DidChangePriority(new_priority); |
| 851 } | 852 } |
| 852 | 853 |
| 853 } // namespace webkit_glue | 854 } // namespace webkit_glue |
| OLD | NEW |