Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: media/base/browser_cdm_factory.cc

Issue 774423002: Provides method for setting a BrowserCdmFactory for IPC-based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include base/logging.h Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/browser_cdm_factory.h ('k') | media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "media/base/browser_cdm_factory.h"
6
7 #include "base/logging.h"
8
9 #if defined(OS_ANDROID)
10 #include "media/base/android/browser_cdm_factory_android.h"
11 #endif
12
13 namespace media {
14
15 namespace {
16 BrowserCdmFactory* g_cdm_factory = NULL;
17 }
18
19 void SetBrowserCdmFactory(BrowserCdmFactory* factory) {
20 DCHECK(!g_cdm_factory);
21 g_cdm_factory = factory;
22 }
23
24 scoped_ptr<BrowserCdm> CreateBrowserCdm(
25 const std::string& key_system,
26 const BrowserCdm::SessionCreatedCB& session_created_cb,
27 const BrowserCdm::SessionMessageCB& session_message_cb,
28 const BrowserCdm::SessionReadyCB& session_ready_cb,
29 const BrowserCdm::SessionClosedCB& session_closed_cb,
30 const BrowserCdm::SessionErrorCB& session_error_cb) {
31 if (!g_cdm_factory) {
32 #if defined(OS_ANDROID)
33 SetBrowserCdmFactory(new BrowserCdmFactoryAndroid);
34 #else
35 LOG(ERROR) << "Cannot create BrowserCdm: no BrowserCdmFactory available!";
36 return scoped_ptr<BrowserCdm>();
37 #endif
38 }
39
40 return g_cdm_factory->CreateBrowserCdm(key_system,
41 session_created_cb,
42 session_message_cb,
43 session_ready_cb,
44 session_closed_cb,
45 session_error_cb);
46 }
47
48 } // namespace media
OLDNEW
« no previous file with comments | « media/base/browser_cdm_factory.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698