| 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/crypto/ppapi_decryptor.h" | 5 #include "webkit/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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 plugin_cdm_delegate_->SetKeyEventCallbacks( | 62 plugin_cdm_delegate_->SetKeyEventCallbacks( |
| 63 base::Bind(&PpapiDecryptor::KeyAdded, weak_this_), | 63 base::Bind(&PpapiDecryptor::KeyAdded, weak_this_), |
| 64 base::Bind(&PpapiDecryptor::KeyError, weak_this_), | 64 base::Bind(&PpapiDecryptor::KeyError, weak_this_), |
| 65 base::Bind(&PpapiDecryptor::KeyMessage, weak_this_), | 65 base::Bind(&PpapiDecryptor::KeyMessage, weak_this_), |
| 66 base::Bind(&PpapiDecryptor::NeedKey, weak_this_)); | 66 base::Bind(&PpapiDecryptor::NeedKey, weak_this_)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 if (!plugin_cdm_delegate_->GenerateKeyRequest( | 69 if (!plugin_cdm_delegate_->GenerateKeyRequest( |
| 70 key_system, type, init_data, init_data_length)) { | 70 key_system, type, init_data, init_data_length)) { |
| 71 ReportFailureToCallPlugin(key_system, ""); | 71 ReportFailureToCallPlugin(key_system, std::string()); |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| 74 | 74 |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void PpapiDecryptor::AddKey(const std::string& key_system, | 78 void PpapiDecryptor::AddKey(const std::string& key_system, |
| 79 const uint8* key, | 79 const uint8* key, |
| 80 int key_length, | 80 int key_length, |
| 81 const uint8* init_data, | 81 const uint8* init_data, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 const std::string& session_id, | 282 const std::string& session_id, |
| 283 const std::string& type, | 283 const std::string& type, |
| 284 scoped_ptr<uint8[]> init_data, | 284 scoped_ptr<uint8[]> init_data, |
| 285 int init_data_size) { | 285 int init_data_size) { |
| 286 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 286 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
| 287 need_key_cb_.Run(key_system, session_id, type, | 287 need_key_cb_.Run(key_system, session_id, type, |
| 288 init_data.Pass(), init_data_size); | 288 init_data.Pass(), init_data_size); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace webkit_media | 291 } // namespace webkit_media |
| OLD | NEW |