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

Side by Side Diff: webkit/media/webmediaplayer_proxy.cc

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « webkit/media/webmediaplayer_proxy.h ('k') | 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 "webkit/media/webmediaplayer_proxy.h" 5 #include "webkit/media/webmediaplayer_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "media/base/pipeline_status.h" 10 #include "media/base/pipeline_status.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 render_loop_->PostTask(FROM_HERE, base::Bind( 170 render_loop_->PostTask(FROM_HERE, base::Bind(
171 &WebMediaPlayerProxy::DemuxerOpenedTask, this, 171 &WebMediaPlayerProxy::DemuxerOpenedTask, this,
172 scoped_refptr<media::ChunkDemuxer>(demuxer))); 172 scoped_refptr<media::ChunkDemuxer>(demuxer)));
173 } 173 }
174 174
175 void WebMediaPlayerProxy::DemuxerClosed() { 175 void WebMediaPlayerProxy::DemuxerClosed() {
176 render_loop_->PostTask(FROM_HERE, base::Bind( 176 render_loop_->PostTask(FROM_HERE, base::Bind(
177 &WebMediaPlayerProxy::DemuxerClosedTask, this)); 177 &WebMediaPlayerProxy::DemuxerClosedTask, this));
178 } 178 }
179 179
180 void WebMediaPlayerProxy::KeyNeeded(scoped_array<uint8> init_data, 180 void WebMediaPlayerProxy::DemuxerNeedKey(scoped_array<uint8> init_data,
181 int init_data_size) { 181 int init_data_size) {
182 render_loop_->PostTask(FROM_HERE, base::Bind( 182 render_loop_->PostTask(FROM_HERE, base::Bind(
183 &WebMediaPlayerProxy::KeyNeededTask, this, 183 &WebMediaPlayerProxy::NeedKeyTask, this, "", "",
184 base::Passed(&init_data), init_data_size)); 184 base::Passed(&init_data), init_data_size));
185 } 185 }
186 186
187 void WebMediaPlayerProxy::DemuxerStartWaitingForSeek() { 187 void WebMediaPlayerProxy::DemuxerStartWaitingForSeek() {
188 if (chunk_demuxer_.get()) 188 if (chunk_demuxer_.get())
189 chunk_demuxer_->StartWaitingForSeek(); 189 chunk_demuxer_->StartWaitingForSeek();
190 } 190 }
191 191
192 media::ChunkDemuxer::Status WebMediaPlayerProxy::DemuxerAddId( 192 media::ChunkDemuxer::Status WebMediaPlayerProxy::DemuxerAddId(
193 const std::string& id, 193 const std::string& id,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 DCHECK(render_loop_->BelongsToCurrentThread()); 230 DCHECK(render_loop_->BelongsToCurrentThread());
231 chunk_demuxer_ = demuxer; 231 chunk_demuxer_ = demuxer;
232 if (webmediaplayer_) 232 if (webmediaplayer_)
233 webmediaplayer_->OnDemuxerOpened(); 233 webmediaplayer_->OnDemuxerOpened();
234 } 234 }
235 235
236 void WebMediaPlayerProxy::DemuxerClosedTask() { 236 void WebMediaPlayerProxy::DemuxerClosedTask() {
237 chunk_demuxer_ = NULL; 237 chunk_demuxer_ = NULL;
238 } 238 }
239 239
240 void WebMediaPlayerProxy::KeyNeededTask(scoped_array<uint8> init_data, 240 void WebMediaPlayerProxy::KeyAdded(const std::string& key_system,
241 int init_data_size) { 241 const std::string& session_id) {
242 render_loop_->PostTask(FROM_HERE, base::Bind(
243 &WebMediaPlayerProxy::KeyAddedTask, this, key_system, session_id));
244 }
245
246 void WebMediaPlayerProxy::KeyError(const std::string& key_system,
247 const std::string& session_id,
248 media::AesDecryptor::KeyError error_code,
249 int system_code) {
250 render_loop_->PostTask(FROM_HERE, base::Bind(
251 &WebMediaPlayerProxy::KeyErrorTask, this, key_system, session_id,
252 error_code, system_code));
253 }
254
255 void WebMediaPlayerProxy::KeyMessage(const std::string& key_system,
256 const std::string& session_id,
257 scoped_array<uint8> message,
258 int message_length,
259 const std::string& default_url) {
260 render_loop_->PostTask(FROM_HERE, base::Bind(
261 &WebMediaPlayerProxy::KeyMessageTask, this, key_system, session_id,
262 base::Passed(&message), message_length, default_url));
263 }
264
265 void WebMediaPlayerProxy::NeedKey(const std::string& key_system,
266 const std::string& session_id,
267 scoped_array<uint8> init_data,
268 int init_data_size) {
269 render_loop_->PostTask(FROM_HERE, base::Bind(
270 &WebMediaPlayerProxy::NeedKeyTask, this, key_system, session_id,
271 base::Passed(&init_data), init_data_size));
272 }
273
274 void WebMediaPlayerProxy::KeyAddedTask(const std::string& key_system,
275 const std::string& session_id) {
242 DCHECK(render_loop_->BelongsToCurrentThread()); 276 DCHECK(render_loop_->BelongsToCurrentThread());
243 if (webmediaplayer_) 277 if (webmediaplayer_)
244 webmediaplayer_->OnKeyNeeded(init_data.Pass(), init_data_size); 278 webmediaplayer_->OnKeyAdded(key_system, session_id);
279 }
280
281 void WebMediaPlayerProxy::KeyErrorTask(const std::string& key_system,
282 const std::string& session_id,
283 media::AesDecryptor::KeyError error_code,
284 int system_code) {
285 DCHECK(render_loop_->BelongsToCurrentThread());
286 if (webmediaplayer_)
287 webmediaplayer_->OnKeyError(key_system, session_id,
288 error_code, system_code);
289 }
290
291 void WebMediaPlayerProxy::KeyMessageTask(const std::string& key_system,
292 const std::string& session_id,
293 scoped_array<uint8> message,
294 int message_length,
295 const std::string& default_url) {
296 DCHECK(render_loop_->BelongsToCurrentThread());
297 if (webmediaplayer_)
298 webmediaplayer_->OnKeyMessage(key_system, session_id,
299 message.Pass(), message_length, default_url);
300 }
301
302 void WebMediaPlayerProxy::NeedKeyTask(const std::string& key_system,
303 const std::string& session_id,
304 scoped_array<uint8> init_data,
305 int init_data_size) {
306 DCHECK(render_loop_->BelongsToCurrentThread());
307 if (webmediaplayer_)
308 webmediaplayer_->OnNeedKey(key_system, session_id,
309 init_data.Pass(), init_data_size);
245 } 310 }
246 311
247 } // namespace webkit_media 312 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698