OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/blink/resource_multibuffer.h" |
| 6 |
| 7 #include "media/blink/resource_multibuffer_data_provider.h" |
| 8 |
| 9 namespace media { |
| 10 |
| 11 const int kBlockSizeShift = 15; // 1<<15 == 32kb |
| 12 |
| 13 ResourceMultiBuffer::ResourceMultiBuffer(blink::WebFrame* frame) |
| 14 : MultiBuffer(kBlockSizeShift), frame_(frame) {} |
| 15 ResourceMultiBuffer::~ResourceMultiBuffer() {} |
| 16 |
| 17 MultiBuffer::DataProvider* ResourceMultiBuffer::CreateWriter( |
| 18 const MultiBufferBlockId& pos) { |
| 19 ResourceMultiBufferDataProvider* ret = |
| 20 new ResourceMultiBufferDataProvider(pos, this); |
| 21 ret->Start(); |
| 22 return ret; |
| 23 } |
| 24 |
| 25 void ResourceMultiBuffer::OnRedirect(const scoped_refptr<UrlData>& from, |
| 26 const scoped_refptr<UrlData>& to) { |
| 27 UpdateUrlData(from, to); |
| 28 } |
| 29 |
| 30 void ResourceMultiBuffer::Fail(const scoped_refptr<UrlData>& from) { |
| 31 // Or possibly just register a failure in the urldata class? |
| 32 UpdateUrlData(from, kUnknownUrlData); |
| 33 } |
| 34 |
| 35 } // namespace media |
OLD | NEW |