1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PEPPER_CDM_WRAPPER_H_ 6#define CONTENT_RENDERER_MEDIA_CRYPTO_PEPPER_CDM_WRAPPER_H_ 7 8#if !defined(ENABLE_PEPPER_CDMS) 9#error This file should only be included when ENABLE_PEPPER_CDMS is defined 10#endif 11 12#include <string> 13 14#include "base/callback.h" 15 16class GURL; 17 18namespace content { 19class ContentDecryptorDelegate; 20 21// PepperCdmWrapper provides access to the Pepper CDM instance. 22class PepperCdmWrapper { 23 public: 24 virtual ~PepperCdmWrapper() {} 25 26 // Returns the ContentDecryptorDelegate* associated with this plugin. 27 virtual ContentDecryptorDelegate* GetCdmDelegate() = 0; 28 29 protected: 30 PepperCdmWrapper() {} 31 32 private: 33 DISALLOW_COPY_AND_ASSIGN(PepperCdmWrapper); 34}; 35 36// Callback used to create a PepperCdmWrapper. This may return null if the 37// Pepper CDM can not be created. 38typedef base::Callback<scoped_ptr<PepperCdmWrapper>( 39 const std::string& pluginType, 40 const GURL& security_origin)> CreatePepperCdmCB; 41 42} // namespace content 43 44#endif // CONTENT_RENDERER_MEDIA_CRYPTO_PEPPER_CDM_WRAPPER_H_ 45