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

Side by Side Diff: media/renderers/renderer_impl.cc

Issue 2703993002: media: Resolve pending SetCdm() when WebMediaPlayerImpl is destructed (Closed)
Patch Set: add layout test Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderers/renderer_impl.h" 5 #include "media/renderers/renderer_impl.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.h" 10 #include "base/callback.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 DCHECK(task_runner_->BelongsToCurrentThread()); 136 DCHECK(task_runner_->BelongsToCurrentThread());
137 DCHECK_EQ(state_, STATE_UNINITIALIZED); 137 DCHECK_EQ(state_, STATE_UNINITIALIZED);
138 DCHECK(!init_cb.is_null()); 138 DCHECK(!init_cb.is_null());
139 DCHECK(client); 139 DCHECK(client);
140 140
141 client_ = client; 141 client_ = client;
142 media_resource_ = media_resource; 142 media_resource_ = media_resource;
143 init_cb_ = init_cb; 143 init_cb_ = init_cb;
144 144
145 if (HasEncryptedStream() && !cdm_context_) { 145 if (HasEncryptedStream() && !cdm_context_) {
146 DVLOG(1) << __func__ << ": Has encrypted stream but CDM is not set.";
146 state_ = STATE_INIT_PENDING_CDM; 147 state_ = STATE_INIT_PENDING_CDM;
147 return; 148 return;
148 } 149 }
149 150
150 state_ = STATE_INITIALIZING; 151 state_ = STATE_INITIALIZING;
151 InitializeAudioRenderer(); 152 InitializeAudioRenderer();
152 } 153 }
153 154
154 void RendererImpl::SetCdm(CdmContext* cdm_context, 155 void RendererImpl::SetCdm(CdmContext* cdm_context,
155 const CdmAttachedCB& cdm_attached_cb) { 156 const CdmAttachedCB& cdm_attached_cb) {
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 DCHECK(task_runner_->BelongsToCurrentThread()); 846 DCHECK(task_runner_->BelongsToCurrentThread());
846 client_->OnVideoNaturalSizeChange(size); 847 client_->OnVideoNaturalSizeChange(size);
847 } 848 }
848 849
849 void RendererImpl::OnVideoOpacityChange(bool opaque) { 850 void RendererImpl::OnVideoOpacityChange(bool opaque) {
850 DCHECK(task_runner_->BelongsToCurrentThread()); 851 DCHECK(task_runner_->BelongsToCurrentThread());
851 client_->OnVideoOpacityChange(opaque); 852 client_->OnVideoOpacityChange(opaque);
852 } 853 }
853 854
854 } // namespace media 855 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698