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

Side by Side Diff: webkit/glue/media/buffered_resource_loader.cc

Issue 8349009: Support playback & seeking in media files over 2G. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | webkit/glue/multipart_response_delegate.h » ('j') | 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/glue/media/buffered_resource_loader.h" 5 #include "webkit/glue/media/buffered_resource_loader.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "media/base/media_log.h" 10 #include "media/base/media_log.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 // Then do the read. 727 // Then do the read.
728 int read = static_cast<int>(buffer_->Read(read_buffer_, read_size_)); 728 int read = static_cast<int>(buffer_->Read(read_buffer_, read_size_));
729 offset_ += first_offset_ + read; 729 offset_ += first_offset_ + read;
730 730
731 // And report with what we have read. 731 // And report with what we have read.
732 DoneRead(read); 732 DoneRead(read);
733 } 733 }
734 734
735 bool BufferedResourceLoader::VerifyPartialResponse( 735 bool BufferedResourceLoader::VerifyPartialResponse(
736 const WebURLResponse& response) { 736 const WebURLResponse& response) {
737 int first_byte_position, last_byte_position, instance_size; 737 int64 first_byte_position, last_byte_position, instance_size;
738 738
739 if (!MultipartResponseDelegate::ReadContentRanges(response, 739 if (!MultipartResponseDelegate::ReadContentRanges(response,
740 &first_byte_position, 740 &first_byte_position,
741 &last_byte_position, 741 &last_byte_position,
742 &instance_size)) { 742 &instance_size)) {
743 return false; 743 return false;
744 } 744 }
745 745
746 if (instance_size != kPositionNotSpecified) { 746 if (instance_size != kPositionNotSpecified) {
747 instance_size_ = instance_size; 747 instance_size_ = instance_size;
748 } 748 }
749 749
750 if (first_byte_position_ != kPositionNotSpecified && 750 if (first_byte_position_ != kPositionNotSpecified &&
751 first_byte_position_ != first_byte_position) { 751 first_byte_position_ != first_byte_position) {
752 return false; 752 return false;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 if (buffer_.get()) { 811 if (buffer_.get()) {
812 media_log_->AddEvent( 812 media_log_->AddEvent(
813 media_log_->CreateBufferedExtentsChangedEvent( 813 media_log_->CreateBufferedExtentsChangedEvent(
814 offset_ - buffer_->backward_bytes(), 814 offset_ - buffer_->backward_bytes(),
815 offset_, 815 offset_,
816 offset_ + buffer_->forward_bytes())); 816 offset_ + buffer_->forward_bytes()));
817 } 817 }
818 } 818 }
819 819
820 } // namespace webkit_glue 820 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/multipart_response_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698