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

Side by Side Diff: media/base/pipeline.cc

Issue 879483004: Don't touch the renderer without the lock! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 renderer_ended_ = false; 599 renderer_ended_ = false;
600 text_renderer_ended_ = false; 600 text_renderer_ended_ = false;
601 start_timestamp_ = seek_timestamp; 601 start_timestamp_ = seek_timestamp;
602 602
603 DoSeek(seek_timestamp, base::Bind(&Pipeline::StateTransitionTask, 603 DoSeek(seek_timestamp, base::Bind(&Pipeline::StateTransitionTask,
604 weak_factory_.GetWeakPtr())); 604 weak_factory_.GetWeakPtr()));
605 } 605 }
606 606
607 void Pipeline::SetCdmTask(CdmContext* cdm_context, 607 void Pipeline::SetCdmTask(CdmContext* cdm_context,
608 const CdmAttachedCB& cdm_attached_cb) { 608 const CdmAttachedCB& cdm_attached_cb) {
609 base::AutoLock auto_lock(lock_);
609 if (!renderer_) { 610 if (!renderer_) {
610 pending_cdm_context_ = cdm_context; 611 pending_cdm_context_ = cdm_context;
611 cdm_attached_cb.Run(true); 612 cdm_attached_cb.Run(true);
612 return; 613 return;
613 } 614 }
614 615
615 renderer_->SetCdm(cdm_context, cdm_attached_cb); 616 renderer_->SetCdm(cdm_context, cdm_attached_cb);
616 } 617 }
617 618
618 void Pipeline::OnRendererEnded() { 619 void Pipeline::OnRendererEnded() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 metadata_cb_.Run(metadata); 741 metadata_cb_.Run(metadata);
741 } 742 }
742 743
743 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { 744 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
744 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 745 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
745 DCHECK(task_runner_->BelongsToCurrentThread()); 746 DCHECK(task_runner_->BelongsToCurrentThread());
746 buffering_state_cb_.Run(new_buffering_state); 747 buffering_state_cb_.Run(new_buffering_state);
747 } 748 }
748 749
749 } // namespace media 750 } // 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