| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "media/blink/resource_multibuffer_data_provider.h" | 5 #include "media/blink/resource_multibuffer_data_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 DCHECK(url_data_) << " pos = " << pos; | 64 DCHECK(url_data_) << " pos = " << pos; |
| 65 DCHECK_GE(pos, 0); | 65 DCHECK_GE(pos, 0); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ResourceMultiBufferDataProvider::Start() { | 68 void ResourceMultiBufferDataProvider::Start() { |
| 69 // Prepare the request. | 69 // Prepare the request. |
| 70 WebURLRequest request(url_data_->url()); | 70 WebURLRequest request(url_data_->url()); |
| 71 // TODO(mkwst): Split this into video/audio. | 71 // TODO(mkwst): Split this into video/audio. |
| 72 request.setRequestContext(WebURLRequest::RequestContextVideo); | 72 request.setRequestContext(WebURLRequest::RequestContextVideo); |
| 73 | 73 |
| 74 DVLOG(1) << __FUNCTION__ << " @ " << byte_pos(); | 74 DVLOG(1) << __func__ << " @ " << byte_pos(); |
| 75 if (url_data_->length() > 0 && byte_pos() >= url_data_->length()) { | 75 if (url_data_->length() > 0 && byte_pos() >= url_data_->length()) { |
| 76 base::ThreadTaskRunnerHandle::Get()->PostTask( | 76 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 77 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Terminate, | 77 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Terminate, |
| 78 weak_factory_.GetWeakPtr())); | 78 weak_factory_.GetWeakPtr())); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 | 81 |
| 82 request.setHTTPHeaderField( | 82 request.setHTTPHeaderField( |
| 83 WebString::fromUTF8(net::HttpRequestHeaders::kRange), | 83 WebString::fromUTF8(net::HttpRequestHeaders::kRange), |
| 84 WebString::fromUTF8( | 84 WebString::fromUTF8( |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 if (byte_pos() != first_byte_position) { | 541 if (byte_pos() != first_byte_position) { |
| 542 return false; | 542 return false; |
| 543 } | 543 } |
| 544 | 544 |
| 545 return true; | 545 return true; |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace media | 548 } // namespace media |
| OLD | NEW |