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