OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_url_loader.h" | 10 #include "ppapi/c/ppb_url_loader.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 void PPB_URLLoader_Impl::didDownloadData(WebURLLoader* loader, | 417 void PPB_URLLoader_Impl::didDownloadData(WebURLLoader* loader, |
418 int data_length) { | 418 int data_length) { |
419 bytes_received_ += data_length; | 419 bytes_received_ += data_length; |
420 UpdateStatus(); | 420 UpdateStatus(); |
421 } | 421 } |
422 | 422 |
423 void PPB_URLLoader_Impl::didReceiveData(WebURLLoader* loader, | 423 void PPB_URLLoader_Impl::didReceiveData(WebURLLoader* loader, |
424 const char* data, | 424 const char* data, |
425 int data_length, | 425 int data_length, |
426 int length_received) { | 426 int raw_data_length) { |
427 bytes_received_ += data_length; | 427 bytes_received_ += data_length; |
428 | 428 |
429 buffer_.insert(buffer_.end(), data, data + data_length); | 429 buffer_.insert(buffer_.end(), data, data + data_length); |
430 if (user_buffer_) { | 430 if (user_buffer_) { |
431 RunCallback(FillUserBuffer()); | 431 RunCallback(FillUserBuffer()); |
432 } else { | 432 } else { |
433 DCHECK(!pending_callback_.get() || pending_callback_->completed()); | 433 DCHECK(!pending_callback_.get() || pending_callback_->completed()); |
434 } | 434 } |
435 } | 435 } |
436 | 436 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { | 540 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { |
541 return request_info_ && request_info_->record_download_progress(); | 541 return request_info_ && request_info_->record_download_progress(); |
542 } | 542 } |
543 | 543 |
544 bool PPB_URLLoader_Impl::RecordUploadProgress() const { | 544 bool PPB_URLLoader_Impl::RecordUploadProgress() const { |
545 return request_info_ && request_info_->record_upload_progress(); | 545 return request_info_ && request_info_->record_upload_progress(); |
546 } | 546 } |
547 | 547 |
548 } // namespace ppapi | 548 } // namespace ppapi |
549 } // namespace webkit | 549 } // namespace webkit |
OLD | NEW |