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

Side by Side Diff: media/blink/resource_multibuffer_data_provider.cc

Issue 2910553002: fully cache small audio/video (Closed)
Patch Set: comment added Created 3 years, 7 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
« no previous file with comments | « media/blink/multibuffer_data_source_unittest.cc ('k') | media/blink/url_index.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 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
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
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
OLDNEW
« no previous file with comments | « media/blink/multibuffer_data_source_unittest.cc ('k') | media/blink/url_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698