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

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

Issue 2647483003: Stop requiring a reader in MultibufferDataSource::SetBitrateTask() (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/multibuffer_data_source.h" 5 #include "media/blink/multibuffer_data_source.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 ReadOperation::Run(std::move(read_op_), kReadError); 443 ReadOperation::Run(std::move(read_op_), kReadError);
444 } 444 }
445 445
446 void MultibufferDataSource::StopLoader() { 446 void MultibufferDataSource::StopLoader() {
447 DCHECK(render_task_runner_->BelongsToCurrentThread()); 447 DCHECK(render_task_runner_->BelongsToCurrentThread());
448 reader_.reset(nullptr); 448 reader_.reset(nullptr);
449 } 449 }
450 450
451 void MultibufferDataSource::SetBitrateTask(int bitrate) { 451 void MultibufferDataSource::SetBitrateTask(int bitrate) {
452 DCHECK(render_task_runner_->BelongsToCurrentThread()); 452 DCHECK(render_task_runner_->BelongsToCurrentThread());
453 DCHECK(reader_.get());
454 453
455 bitrate_ = bitrate; 454 bitrate_ = bitrate;
456 UpdateBufferSizes(); 455 UpdateBufferSizes();
457 } 456 }
458 457
459 ///////////////////////////////////////////////////////////////////////////// 458 /////////////////////////////////////////////////////////////////////////////
460 // BufferedResourceLoader callback methods. 459 // BufferedResourceLoader callback methods.
461 void MultibufferDataSource::StartCallback() { 460 void MultibufferDataSource::StartCallback() {
462 DCHECK(render_task_runner_->BelongsToCurrentThread()); 461 DCHECK(render_task_runner_->BelongsToCurrentThread());
463 462
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 reader_->SetPinRange(pin_backward, pin_forward); 633 reader_->SetPinRange(pin_backward, pin_forward);
635 634
636 if (preload_ == METADATA) { 635 if (preload_ == METADATA) {
637 reader_->SetPreload(0, 0); 636 reader_->SetPreload(0, 0);
638 } else { 637 } else {
639 reader_->SetPreload(preload_high, preload); 638 reader_->SetPreload(preload_high, preload);
640 } 639 }
641 } 640 }
642 641
643 } // namespace media 642 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698