Use UsbIds::GetVendorName to retrieve USB vendor name.
[chromium-blink-merge.git] / media / base / browser_cdm_factory.h
blobb2ff0c75a467ef5863412e3f2b5027b027750c1e
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.
5 #ifndef MEDIA_BASE_BROWSER_CDM_FACTORY_H_
6 #define MEDIA_BASE_BROWSER_CDM_FACTORY_H_
8 #include <string>
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/browser_cdm.h"
13 #include "media/base/media_export.h"
15 namespace media {
17 class MEDIA_EXPORT BrowserCdmFactory {
18 public:
19 BrowserCdmFactory() {}
20 virtual ~BrowserCdmFactory() {}
22 virtual scoped_ptr<BrowserCdm> CreateBrowserCdm(
23 const std::string& key_system,
24 bool use_secure_surface,
25 const SessionMessageCB& session_message_cb,
26 const SessionClosedCB& session_closed_cb,
27 const LegacySessionErrorCB& legacy_session_error_cb,
28 const SessionKeysChangeCB& session_keys_change_cb,
29 const SessionExpirationUpdateCB& session_expiration_update_cb) = 0;
31 private:
32 DISALLOW_COPY_AND_ASSIGN(BrowserCdmFactory);
35 // Provides a factory for creating BrowserCdm instances. There is only one
36 // BrowserCdmFactory per process.
37 void SetBrowserCdmFactory(BrowserCdmFactory* factory);
39 // Creates a BrowserCdm for |key_system|. Returns NULL if the CDM cannot be
40 // created.
41 // |use_secure_surface| indicates that the CDM should be configured to output
42 // to a secure surface (for platforms that support it).
43 // TODO(xhwang): Add ifdef for IPC based CDM.
44 scoped_ptr<BrowserCdm> MEDIA_EXPORT
45 CreateBrowserCdm(const std::string& key_system,
46 bool use_secure_surface,
47 const SessionMessageCB& session_message_cb,
48 const SessionClosedCB& session_closed_cb,
49 const LegacySessionErrorCB& legacy_session_error_cb,
50 const SessionKeysChangeCB& session_keys_change_cb,
51 const SessionExpirationUpdateCB& session_expiration_update_cb);
53 } // namespace media
55 #endif // MEDIA_BASE_BROWSER_CDM_FACTORY_H_