Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: webkit/plugins/ppapi/ppb_url_loader_impl.cc

Issue 7810008: Remove incorrect assertion (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "ppapi/c/pp_completion_callback.h" 9 #include "ppapi/c/pp_completion_callback.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 size_t PPB_URLLoader_Impl::FillUserBuffer() { 399 size_t PPB_URLLoader_Impl::FillUserBuffer() {
400 DCHECK(user_buffer_); 400 DCHECK(user_buffer_);
401 DCHECK(user_buffer_size_); 401 DCHECK(user_buffer_size_);
402 402
403 size_t bytes_to_copy = std::min(buffer_.size(), user_buffer_size_); 403 size_t bytes_to_copy = std::min(buffer_.size(), user_buffer_size_);
404 std::copy(buffer_.begin(), buffer_.begin() + bytes_to_copy, user_buffer_); 404 std::copy(buffer_.begin(), buffer_.begin() + bytes_to_copy, user_buffer_);
405 buffer_.erase(buffer_.begin(), buffer_.begin() + bytes_to_copy); 405 buffer_.erase(buffer_.begin(), buffer_.begin() + bytes_to_copy);
406 406
407 // If the buffer is getting too empty, resume asynchronous loading. 407 // If the buffer is getting too empty, resume asynchronous loading.
408 DCHECK(!is_asynchronous_load_suspended_);
409 if (is_asynchronous_load_suspended_ && 408 if (is_asynchronous_load_suspended_ &&
410 buffer_.size() <= static_cast<size_t>( 409 buffer_.size() <= static_cast<size_t>(
411 request_data_.prefetch_buffer_lower_threshold)) { 410 request_data_.prefetch_buffer_lower_threshold)) {
412 DVLOG(1) << "Resuming async load - buffer size: " << buffer_.size(); 411 DVLOG(1) << "Resuming async load - buffer size: " << buffer_.size();
413 loader_->setDefersLoading(false); 412 loader_->setDefersLoading(false);
414 is_asynchronous_load_suspended_ = false; 413 is_asynchronous_load_suspended_ = false;
415 } 414 }
416 415
417 // Reset for next time. 416 // Reset for next time.
418 user_buffer_ = NULL; 417 user_buffer_ = NULL;
(...skipping 28 matching lines...) Expand all
447 bool PPB_URLLoader_Impl::RecordDownloadProgress() const { 446 bool PPB_URLLoader_Impl::RecordDownloadProgress() const {
448 return request_data_.record_download_progress; 447 return request_data_.record_download_progress;
449 } 448 }
450 449
451 bool PPB_URLLoader_Impl::RecordUploadProgress() const { 450 bool PPB_URLLoader_Impl::RecordUploadProgress() const {
452 return request_data_.record_upload_progress; 451 return request_data_.record_upload_progress;
453 } 452 }
454 453
455 } // namespace ppapi 454 } // namespace ppapi
456 } // namespace webkit 455 } // namespace webkit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698