Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / content / renderer / media / crypto / pepper_cdm_wrapper.h
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
16 namespace content {
17 class ContentDecryptorDelegate;
18
19 // PepperCdmWrapper provides access to the Pepper CDM instance.
20 class PepperCdmWrapper {
21  public:
22   virtual ~PepperCdmWrapper() {}
23
24   // Returns the ContentDecryptorDelegate* associated with this plugin.
25   virtual ContentDecryptorDelegate* GetCdmDelegate() = 0;
26
27  protected:
28   PepperCdmWrapper() {}
29
30  private:
31   DISALLOW_COPY_AND_ASSIGN(PepperCdmWrapper);
32 };
33
34 // Callback used to create a PepperCdmWrapper. This may return null if the
35 // Pepper CDM can not be created.
36 typedef base::Callback<scoped_ptr<PepperCdmWrapper>(
37     const std::string& pluginType)> CreatePepperCdmCB;
38
39 }  // namespace content
40
41 #endif  // CONTENT_RENDERER_MEDIA_CRYPTO_PEPPER_CDM_WRAPPER_H_