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 "webkit/renderer/media/crypto/proxy_decryptor.h" | 5 #include "webkit/renderer/media/crypto/proxy_decryptor.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "media/crypto/aes_decryptor.h" | 10 #include "media/crypto/aes_decryptor.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 #if defined(ENABLE_PEPPER_CDMS) | 162 #if defined(ENABLE_PEPPER_CDMS) |
163 scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor( | 163 scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor( |
164 const std::string& key_system) { | 164 const std::string& key_system) { |
165 DCHECK(web_media_player_client_); | 165 DCHECK(web_media_player_client_); |
166 DCHECK(web_frame_); | 166 DCHECK(web_frame_); |
167 | 167 |
168 std::string plugin_type = GetPepperType(key_system); | 168 std::string plugin_type = GetPepperType(key_system); |
169 DCHECK(!plugin_type.empty()); | 169 DCHECK(!plugin_type.empty()); |
170 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance = | 170 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance = |
171 CreateHelperPlugin(plugin_type, web_media_player_client_, web_frame_); | 171 CreateHelperPlugin(plugin_type, web_media_player_client_, web_frame_); |
172 did_create_helper_plugin_ = plugin_instance != NULL; | 172 did_create_helper_plugin_ = plugin_instance.get() != NULL; |
173 if (!did_create_helper_plugin_) { | 173 if (!did_create_helper_plugin_) { |
174 DVLOG(1) << "ProxyDecryptor: plugin instance creation failed."; | 174 DVLOG(1) << "ProxyDecryptor: plugin instance creation failed."; |
175 return scoped_ptr<media::Decryptor>(); | 175 return scoped_ptr<media::Decryptor>(); |
176 } | 176 } |
177 | 177 |
178 return scoped_ptr<media::Decryptor>(new PpapiDecryptor( | 178 return scoped_ptr<media::Decryptor>(new PpapiDecryptor( |
179 plugin_instance, | 179 plugin_instance, |
180 base::Bind(&ProxyDecryptor::KeyAdded, weak_ptr_factory_.GetWeakPtr()), | 180 base::Bind(&ProxyDecryptor::KeyAdded, weak_ptr_factory_.GetWeakPtr()), |
181 base::Bind(&ProxyDecryptor::KeyError, weak_ptr_factory_.GetWeakPtr()), | 181 base::Bind(&ProxyDecryptor::KeyError, weak_ptr_factory_.GetWeakPtr()), |
182 base::Bind(&ProxyDecryptor::KeyMessage, weak_ptr_factory_.GetWeakPtr()), | 182 base::Bind(&ProxyDecryptor::KeyMessage, weak_ptr_factory_.GetWeakPtr()), |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 void ProxyDecryptor::NeedKey(const std::string& key_system, | 225 void ProxyDecryptor::NeedKey(const std::string& key_system, |
226 const std::string& session_id, | 226 const std::string& session_id, |
227 const std::string& type, | 227 const std::string& type, |
228 scoped_ptr<uint8[]> init_data, | 228 scoped_ptr<uint8[]> init_data, |
229 int init_data_size) { | 229 int init_data_size) { |
230 need_key_cb_.Run(key_system, session_id, type, | 230 need_key_cb_.Run(key_system, session_id, type, |
231 init_data.Pass(), init_data_size); | 231 init_data.Pass(), init_data_size); |
232 } | 232 } |
233 | 233 |
234 } // namespace webkit_media | 234 } // namespace webkit_media |
OLD | NEW |