#ifndef CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_
#define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_
#include <string>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "third_party/WebKit/public/platform/WebContentDecryptionModule.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
namespace blink {
class WebSecurityOrigin;
}
namespace media {
class Decryptor;
class MediaKeys;
}
namespace content {
class CdmSessionAdapter;
class WebContentDecryptionModuleSessionImpl;
class WebContentDecryptionModuleImpl
: public blink::WebContentDecryptionModule {
public:
static WebContentDecryptionModuleImpl* Create(
blink::WebLocalFrame* frame,
const blink::WebSecurityOrigin& security_origin,
const base::string16& key_system);
virtual ~WebContentDecryptionModuleImpl();
media::Decryptor* GetDecryptor();
#if defined(OS_ANDROID)
int GetCdmId() const;
#endif
virtual blink::WebContentDecryptionModuleSession* createSession(
blink::WebContentDecryptionModuleSession::Client* client);
private:
WebContentDecryptionModuleImpl(scoped_refptr<CdmSessionAdapter> adapter);
scoped_refptr<CdmSessionAdapter> adapter_;
DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl);
};
inline WebContentDecryptionModuleImpl* ToWebContentDecryptionModuleImpl(
blink::WebContentDecryptionModule* cdm) {
return static_cast<WebContentDecryptionModuleImpl*>(cdm);
}
}
#endif