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

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

Issue 1132773003: Revert of Plumb |use_secure_codecs| through to BrowserCdmFactoryAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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/default_cdm_factory.h ('k') | media/cdm/proxy_decryptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cdm/default_cdm_factory.h" 5 #include "media/cdm/default_cdm_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "media/base/key_systems.h" 12 #include "media/base/key_systems.h"
13 #include "media/cdm/aes_decryptor.h" 13 #include "media/cdm/aes_decryptor.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 DefaultCdmFactory::DefaultCdmFactory() { 18 DefaultCdmFactory::DefaultCdmFactory() {
19 } 19 }
20 20
21 DefaultCdmFactory::~DefaultCdmFactory() { 21 DefaultCdmFactory::~DefaultCdmFactory() {
22 } 22 }
23 23
24 void DefaultCdmFactory::Create( 24 void DefaultCdmFactory::Create(
25 const std::string& key_system, 25 const std::string& key_system,
26 bool allow_distinctive_identifier,
27 bool allow_persistent_state,
26 const GURL& security_origin, 28 const GURL& security_origin,
27 const CdmConfig& cdm_config,
28 const SessionMessageCB& session_message_cb, 29 const SessionMessageCB& session_message_cb,
29 const SessionClosedCB& session_closed_cb, 30 const SessionClosedCB& session_closed_cb,
30 const LegacySessionErrorCB& legacy_session_error_cb, 31 const LegacySessionErrorCB& legacy_session_error_cb,
31 const SessionKeysChangeCB& session_keys_change_cb, 32 const SessionKeysChangeCB& session_keys_change_cb,
32 const SessionExpirationUpdateCB& session_expiration_update_cb, 33 const SessionExpirationUpdateCB& session_expiration_update_cb,
33 const CdmCreatedCB& cdm_created_cb) { 34 const CdmCreatedCB& cdm_created_cb) {
34 if (!security_origin.is_valid()) { 35 if (!security_origin.is_valid()) {
35 base::ThreadTaskRunnerHandle::Get()->PostTask( 36 base::ThreadTaskRunnerHandle::Get()->PostTask(
36 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin.")); 37 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin."));
37 return; 38 return;
38 } 39 }
39 if (!CanUseAesDecryptor(key_system)) { 40 if (!CanUseAesDecryptor(key_system)) {
40 base::ThreadTaskRunnerHandle::Get()->PostTask( 41 base::ThreadTaskRunnerHandle::Get()->PostTask(
41 FROM_HERE, 42 FROM_HERE,
42 base::Bind(cdm_created_cb, nullptr, "Unsupported key system.")); 43 base::Bind(cdm_created_cb, nullptr, "Unsupported key system."));
43 return; 44 return;
44 } 45 }
45 46
46 scoped_ptr<MediaKeys> cdm( 47 scoped_ptr<MediaKeys> cdm(
47 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, 48 new AesDecryptor(security_origin, session_message_cb, session_closed_cb,
48 session_keys_change_cb)); 49 session_keys_change_cb));
49 base::ThreadTaskRunnerHandle::Get()->PostTask( 50 base::ThreadTaskRunnerHandle::Get()->PostTask(
50 FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm), "")); 51 FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm), ""));
51 } 52 }
52 53
53 } // namespace media 54 } // namespace media
OLDNEW
« no previous file with comments | « media/cdm/default_cdm_factory.h ('k') | media/cdm/proxy_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698