Chromium Code Reviews| 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/webcontentdecryptionmodule_impl.h" | 5 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter()); | 33 scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter()); |
| 34 if (!adapter->Initialize( | 34 if (!adapter->Initialize( |
| 35 #if defined(ENABLE_PEPPER_CDMS) | 35 #if defined(ENABLE_PEPPER_CDMS) |
| 36 // TODO(jrummell): Figure out how to get a WebFrame from Blink (or | 36 // TODO(jrummell): Figure out how to get a WebFrame from Blink (or |
| 37 // something equivalent) so the plugin can actually get created. | 37 // something equivalent) so the plugin can actually get created. |
| 38 // http://crbug.com/250049 | 38 // http://crbug.com/250049 |
| 39 base::Bind(&PepperCdmWrapperImpl::Create, | 39 base::Bind(&PepperCdmWrapperImpl::Create, |
| 40 static_cast<blink::WebFrame*>(NULL)), | 40 static_cast<blink::WebFrame*>(NULL)), |
| 41 #endif | 41 #endif |
| 42 UTF16ToASCII(key_system))) { | 42 UTF16ToASCII(key_system))) { |
|
ddorwin
2014/03/11 18:05:14
Let's have an output parameter for the CDM ID and
xhwang
2014/03/12 01:07:52
Done.
| |
| 43 return NULL; | 43 return NULL; |
| 44 } | 44 } |
| 45 | 45 |
| 46 return new WebContentDecryptionModuleImpl(adapter); | 46 return new WebContentDecryptionModuleImpl(adapter); |
| 47 } | 47 } |
| 48 | 48 |
| 49 WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl( | 49 WebContentDecryptionModuleImpl::WebContentDecryptionModuleImpl( |
| 50 scoped_refptr<CdmSessionAdapter> adapter) | 50 scoped_refptr<CdmSessionAdapter> adapter) |
| 51 : adapter_(adapter) { | 51 : adapter_(adapter) { |
| 52 } | 52 } |
| 53 | 53 |
| 54 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { | 54 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { |
| 55 } | 55 } |
| 56 | 56 |
| 57 // The caller owns the created session. | 57 // The caller owns the created session. |
| 58 blink::WebContentDecryptionModuleSession* | 58 blink::WebContentDecryptionModuleSession* |
| 59 WebContentDecryptionModuleImpl::createSession( | 59 WebContentDecryptionModuleImpl::createSession( |
| 60 blink::WebContentDecryptionModuleSession::Client* client) { | 60 blink::WebContentDecryptionModuleSession::Client* client) { |
| 61 return adapter_->CreateSession(client); | 61 return adapter_->CreateSession(client); |
| 62 } | 62 } |
| 63 | 63 |
| 64 media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() { | 64 media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() { |
| 65 return adapter_->GetDecryptor(); | 65 return adapter_->GetDecryptor(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 int WebContentDecryptionModuleImpl::GetCdmId() { | |
| 69 return adapter_->GetCdmId(); | |
| 70 } | |
| 71 | |
| 68 } // namespace content | 72 } // namespace content |
| OLD | NEW |