| OLD | NEW |
| 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 "content/renderer/media/crypto/ppapi_decryptor.h" | 5 #include "content/renderer/media/crypto/ppapi_decryptor.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 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 18 matching lines...) Expand all Loading... |
| 29 const media::KeyErrorCB& key_error_cb, | 29 const media::KeyErrorCB& key_error_cb, |
| 30 const media::KeyMessageCB& key_message_cb, | 30 const media::KeyMessageCB& key_message_cb, |
| 31 const base::Closure& destroy_plugin_cb) { | 31 const base::Closure& destroy_plugin_cb) { |
| 32 ContentDecryptorDelegate* plugin_cdm_delegate = | 32 ContentDecryptorDelegate* plugin_cdm_delegate = |
| 33 plugin_instance->GetContentDecryptorDelegate(); | 33 plugin_instance->GetContentDecryptorDelegate(); |
| 34 if (!plugin_cdm_delegate) { | 34 if (!plugin_cdm_delegate) { |
| 35 DVLOG(1) << "PpapiDecryptor: plugin cdm delegate creation failed."; | 35 DVLOG(1) << "PpapiDecryptor: plugin cdm delegate creation failed."; |
| 36 return scoped_ptr<PpapiDecryptor>(); | 36 return scoped_ptr<PpapiDecryptor>(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 plugin_cdm_delegate->Initialize(key_system); | 39 // TODO(jrummell): How do we get this value from the browser? |
| 40 PP_KeySystemFlags flags = { PP_FALSE }; |
| 41 plugin_cdm_delegate->Initialize(key_system, flags); |
| 40 | 42 |
| 41 return scoped_ptr<PpapiDecryptor>(new PpapiDecryptor(plugin_instance, | 43 return scoped_ptr<PpapiDecryptor>(new PpapiDecryptor(plugin_instance, |
| 42 plugin_cdm_delegate, | 44 plugin_cdm_delegate, |
| 43 key_added_cb, | 45 key_added_cb, |
| 44 key_error_cb, | 46 key_error_cb, |
| 45 key_message_cb, | 47 key_message_cb, |
| 46 destroy_plugin_cb)); | 48 destroy_plugin_cb)); |
| 47 } | 49 } |
| 48 | 50 |
| 49 PpapiDecryptor::PpapiDecryptor( | 51 PpapiDecryptor::PpapiDecryptor( |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 300 } |
| 299 | 301 |
| 300 void PpapiDecryptor::KeyMessage(const std::string& session_id, | 302 void PpapiDecryptor::KeyMessage(const std::string& session_id, |
| 301 const std::vector<uint8>& message, | 303 const std::vector<uint8>& message, |
| 302 const std::string& default_url) { | 304 const std::string& default_url) { |
| 303 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 305 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
| 304 key_message_cb_.Run(session_id, message, default_url); | 306 key_message_cb_.Run(session_id, message, default_url); |
| 305 } | 307 } |
| 306 | 308 |
| 307 } // namespace content | 309 } // namespace content |
| OLD | NEW |