| OLD | NEW |
| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 | 239 |
| 240 void WebMediaPlayerProxy::KeyAdded(const std::string& key_system, | 240 void WebMediaPlayerProxy::KeyAdded(const std::string& key_system, |
| 241 const std::string& session_id) { | 241 const std::string& session_id) { |
| 242 render_loop_->PostTask(FROM_HERE, base::Bind( | 242 render_loop_->PostTask(FROM_HERE, base::Bind( |
| 243 &WebMediaPlayerProxy::KeyAddedTask, this, key_system, session_id)); | 243 &WebMediaPlayerProxy::KeyAddedTask, this, key_system, session_id)); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void WebMediaPlayerProxy::KeyError(const std::string& key_system, | 246 void WebMediaPlayerProxy::KeyError(const std::string& key_system, |
| 247 const std::string& session_id, | 247 const std::string& session_id, |
| 248 media::AesDecryptor::KeyError error_code, | 248 media::Decryptor::KeyError error_code, |
| 249 int system_code) { | 249 int system_code) { |
| 250 render_loop_->PostTask(FROM_HERE, base::Bind( | 250 render_loop_->PostTask(FROM_HERE, base::Bind( |
| 251 &WebMediaPlayerProxy::KeyErrorTask, this, key_system, session_id, | 251 &WebMediaPlayerProxy::KeyErrorTask, this, key_system, session_id, |
| 252 error_code, system_code)); | 252 error_code, system_code)); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void WebMediaPlayerProxy::KeyMessage(const std::string& key_system, | 255 void WebMediaPlayerProxy::KeyMessage(const std::string& key_system, |
| 256 const std::string& session_id, | 256 const std::string& session_id, |
| 257 scoped_array<uint8> message, | 257 scoped_array<uint8> message, |
| 258 int message_length, | 258 int message_length, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 273 | 273 |
| 274 void WebMediaPlayerProxy::KeyAddedTask(const std::string& key_system, | 274 void WebMediaPlayerProxy::KeyAddedTask(const std::string& key_system, |
| 275 const std::string& session_id) { | 275 const std::string& session_id) { |
| 276 DCHECK(render_loop_->BelongsToCurrentThread()); | 276 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 277 if (webmediaplayer_) | 277 if (webmediaplayer_) |
| 278 webmediaplayer_->OnKeyAdded(key_system, session_id); | 278 webmediaplayer_->OnKeyAdded(key_system, session_id); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void WebMediaPlayerProxy::KeyErrorTask(const std::string& key_system, | 281 void WebMediaPlayerProxy::KeyErrorTask(const std::string& key_system, |
| 282 const std::string& session_id, | 282 const std::string& session_id, |
| 283 media::AesDecryptor::KeyError error_code, | 283 media::Decryptor::KeyError error_code, |
| 284 int system_code) { | 284 int system_code) { |
| 285 DCHECK(render_loop_->BelongsToCurrentThread()); | 285 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 286 if (webmediaplayer_) | 286 if (webmediaplayer_) |
| 287 webmediaplayer_->OnKeyError(key_system, session_id, | 287 webmediaplayer_->OnKeyError(key_system, session_id, |
| 288 error_code, system_code); | 288 error_code, system_code); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void WebMediaPlayerProxy::KeyMessageTask(const std::string& key_system, | 291 void WebMediaPlayerProxy::KeyMessageTask(const std::string& key_system, |
| 292 const std::string& session_id, | 292 const std::string& session_id, |
| 293 scoped_array<uint8> message, | 293 scoped_array<uint8> message, |
| 294 int message_length, | 294 int message_length, |
| 295 const std::string& default_url) { | 295 const std::string& default_url) { |
| 296 DCHECK(render_loop_->BelongsToCurrentThread()); | 296 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 297 if (webmediaplayer_) | 297 if (webmediaplayer_) |
| 298 webmediaplayer_->OnKeyMessage(key_system, session_id, | 298 webmediaplayer_->OnKeyMessage(key_system, session_id, |
| 299 message.Pass(), message_length, default_url); | 299 message.Pass(), message_length, default_url); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void WebMediaPlayerProxy::NeedKeyTask(const std::string& key_system, | 302 void WebMediaPlayerProxy::NeedKeyTask(const std::string& key_system, |
| 303 const std::string& session_id, | 303 const std::string& session_id, |
| 304 scoped_array<uint8> init_data, | 304 scoped_array<uint8> init_data, |
| 305 int init_data_size) { | 305 int init_data_size) { |
| 306 DCHECK(render_loop_->BelongsToCurrentThread()); | 306 DCHECK(render_loop_->BelongsToCurrentThread()); |
| 307 if (webmediaplayer_) | 307 if (webmediaplayer_) |
| 308 webmediaplayer_->OnNeedKey(key_system, session_id, | 308 webmediaplayer_->OnNeedKey(key_system, session_id, |
| 309 init_data.Pass(), init_data_size); | 309 init_data.Pass(), init_data_size); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace webkit_media | 312 } // namespace webkit_media |
| OLD | NEW |