| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 } else { | 445 } else { |
| 446 active_loader_ = nullptr; | 446 active_loader_ = nullptr; |
| 447 url_data_->Fail(); | 447 url_data_->Fail(); |
| 448 return; // "this" may be deleted now. | 448 return; // "this" may be deleted now. |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 url_data_->set_length(size); | 452 url_data_->set_length(size); |
| 453 fifo_.push_back(DataBuffer::CreateEOSBuffer()); | 453 fifo_.push_back(DataBuffer::CreateEOSBuffer()); |
| 454 | 454 |
| 455 if (url_data_->url_index()) { |
| 456 url_data_->url_index()->TryInsert(url_data_); |
| 457 } |
| 458 |
| 455 DCHECK(Available()); | 459 DCHECK(Available()); |
| 456 url_data_->multibuffer()->OnDataProviderEvent(this); | 460 url_data_->multibuffer()->OnDataProviderEvent(this); |
| 457 | 461 |
| 458 // Beware, this object might be deleted here. | 462 // Beware, this object might be deleted here. |
| 459 } | 463 } |
| 460 | 464 |
| 461 void ResourceMultiBufferDataProvider::DidFail(const WebURLError& error) { | 465 void ResourceMultiBufferDataProvider::DidFail(const WebURLError& error) { |
| 462 DVLOG(1) << "didFail: reason=" << error.reason | 466 DVLOG(1) << "didFail: reason=" << error.reason |
| 463 << ", isCancellation=" << error.is_cancellation | 467 << ", isCancellation=" << error.is_cancellation |
| 464 << ", domain=" << error.domain.Utf8().data() | 468 << ", domain=" << error.domain.Utf8().data() |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 } | 563 } |
| 560 | 564 |
| 561 if (byte_pos() != first_byte_position) { | 565 if (byte_pos() != first_byte_position) { |
| 562 return false; | 566 return false; |
| 563 } | 567 } |
| 564 | 568 |
| 565 return true; | 569 return true; |
| 566 } | 570 } |
| 567 | 571 |
| 568 } // namespace media | 572 } // namespace media |
| OLD | NEW |