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

Side by Side Diff: media/cdm/android_cdm_factory.cc

Issue 1408793009: media: Remove BrowserCdmFactory inferface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment for DEPS change. Created 5 years, 1 month 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/cdm/android_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 2015 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/cdm/android_cdm_factory.h"
6
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
9 #include "base/location.h"
10 #include "base/thread_task_runner_handle.h"
11 #include "media/base/android/media_drm_bridge.h"
12 #include "media/base/key_systems.h"
13 #include "url/gurl.h"
14
15 namespace media {
16
17 AndroidCdmFactory::AndroidCdmFactory() {}
18
19 AndroidCdmFactory::~AndroidCdmFactory() {}
20
21 void AndroidCdmFactory::Create(
22 const std::string& key_system,
23 const GURL& security_origin,
24 const CdmConfig& cdm_config,
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,
30 const CdmCreatedCB& cdm_created_cb) {
31 if (!security_origin.is_valid()) {
32 base::ThreadTaskRunnerHandle::Get()->PostTask(
33 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin."));
34 return;
35 }
36
37 if (!MediaDrmBridge::IsKeySystemSupported(key_system)) {
38 NOTREACHED() << "Key system not supported unexpectedly: " << key_system;
39 base::ThreadTaskRunnerHandle::Get()->PostTask(
40 FROM_HERE, base::Bind(cdm_created_cb, nullptr,
41 "Key system not supported unexpectedly."));
42 return;
43 }
44
45 // TODO(xhwang): Currently MediaDrmBridge can only be created on the Browser
46 // UI thread. Create it here after that is fixed. See http://crbug.com/546108
47 NOTIMPLEMENTED();
48
49 base::ThreadTaskRunnerHandle::Get()->PostTask(
50 FROM_HERE,
51 base::Bind(cdm_created_cb, nullptr, "MediaDrmBridge cannot be created."));
52 }
53
54 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/android_cdm_factory.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698