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

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

Issue 1116683002: [media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch 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/cast/test/utility/udp_proxy_main.cc ('k') | media/filters/default_media_permission.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/message_loop/message_loop_proxy.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h"
11 #include "media/base/key_systems.h" 12 #include "media/base/key_systems.h"
12 #include "media/cdm/aes_decryptor.h" 13 #include "media/cdm/aes_decryptor.h"
13 #include "url/gurl.h" 14 #include "url/gurl.h"
14 15
15 namespace media { 16 namespace media {
16 17
17 DefaultCdmFactory::DefaultCdmFactory() { 18 DefaultCdmFactory::DefaultCdmFactory() {
18 } 19 }
19 20
20 DefaultCdmFactory::~DefaultCdmFactory() { 21 DefaultCdmFactory::~DefaultCdmFactory() {
21 } 22 }
22 23
23 void DefaultCdmFactory::Create( 24 void DefaultCdmFactory::Create(
24 const std::string& key_system, 25 const std::string& key_system,
25 bool allow_distinctive_identifier, 26 bool allow_distinctive_identifier,
26 bool allow_persistent_state, 27 bool allow_persistent_state,
27 const GURL& security_origin, 28 const GURL& security_origin,
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() || !CanUseAesDecryptor(key_system)) { 35 if (!security_origin.is_valid() || !CanUseAesDecryptor(key_system)) {
35 base::MessageLoopProxy::current()->PostTask( 36 base::ThreadTaskRunnerHandle::Get()->PostTask(
36 FROM_HERE, base::Bind(cdm_created_cb, nullptr)); 37 FROM_HERE, base::Bind(cdm_created_cb, nullptr));
37 return; 38 return;
38 } 39 }
39 40
40 scoped_ptr<MediaKeys> cdm( 41 scoped_ptr<MediaKeys> cdm(
41 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, 42 new AesDecryptor(security_origin, session_message_cb, session_closed_cb,
42 session_keys_change_cb)); 43 session_keys_change_cb));
43 base::MessageLoopProxy::current()->PostTask( 44 base::ThreadTaskRunnerHandle::Get()->PostTask(
44 FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm))); 45 FROM_HERE, base::Bind(cdm_created_cb, base::Passed(&cdm)));
45 } 46 }
46 47
47 } // namespace media 48 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/utility/udp_proxy_main.cc ('k') | media/filters/default_media_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698