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

Side by Side Diff: media/mojo/services/mojo_cdm_service.cc

Issue 2083433002: Mojo: Remove url type converters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/mojo/interfaces/content_decryption_module.mojom ('k') | mojo/common/BUILD.gn » ('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/mojo/services/mojo_cdm_service.h" 5 #include "media/mojo/services/mojo_cdm_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "media/base/cdm_config.h" 15 #include "media/base/cdm_config.h"
16 #include "media/base/cdm_context.h" 16 #include "media/base/cdm_context.h"
17 #include "media/base/cdm_factory.h" 17 #include "media/base/cdm_factory.h"
18 #include "media/base/cdm_key_information.h" 18 #include "media/base/cdm_key_information.h"
19 #include "media/base/key_systems.h" 19 #include "media/base/key_systems.h"
20 #include "media/mojo/common/media_type_converters.h" 20 #include "media/mojo/common/media_type_converters.h"
21 #include "media/mojo/services/mojo_cdm_service_context.h" 21 #include "media/mojo/services/mojo_cdm_service_context.h"
22 #include "mojo/common/common_type_converters.h" 22 #include "mojo/common/common_type_converters.h"
23 #include "mojo/common/url_type_converters.h"
24 #include "url/gurl.h" 23 #include "url/gurl.h"
25 24
26 namespace media { 25 namespace media {
27 26
28 namespace { 27 namespace {
29 28
30 // Manages all CDMs created by MojoCdmService. Can only have one instance per 29 // Manages all CDMs created by MojoCdmService. Can only have one instance per
31 // process so use a LazyInstance to ensure this. 30 // process so use a LazyInstance to ensure this.
32 class CdmManager { 31 class CdmManager {
33 public: 32 public:
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 cdm_promise_result->success = true; 218 cdm_promise_result->success = true;
220 callback.Run(std::move(cdm_promise_result), cdm_id_, 219 callback.Run(std::move(cdm_promise_result), cdm_id_,
221 std::move(decryptor_service)); 220 std::move(decryptor_service));
222 } 221 }
223 222
224 void MojoCdmService::OnSessionMessage(const std::string& session_id, 223 void MojoCdmService::OnSessionMessage(const std::string& session_id,
225 MediaKeys::MessageType message_type, 224 MediaKeys::MessageType message_type,
226 const std::vector<uint8_t>& message, 225 const std::vector<uint8_t>& message,
227 const GURL& legacy_destination_url) { 226 const GURL& legacy_destination_url) {
228 DVLOG(2) << __FUNCTION__ << "(" << message_type << ")"; 227 DVLOG(2) << __FUNCTION__ << "(" << message_type << ")";
229 client_->OnSessionMessage(session_id, 228 client_->OnSessionMessage(
230 static_cast<mojom::CdmMessageType>(message_type), 229 session_id, static_cast<mojom::CdmMessageType>(message_type),
231 mojo::Array<uint8_t>::From(message), 230 mojo::Array<uint8_t>::From(message), legacy_destination_url);
232 mojo::String::From(legacy_destination_url));
233 } 231 }
234 232
235 void MojoCdmService::OnSessionKeysChange(const std::string& session_id, 233 void MojoCdmService::OnSessionKeysChange(const std::string& session_id,
236 bool has_additional_usable_key, 234 bool has_additional_usable_key,
237 CdmKeysInfo keys_info) { 235 CdmKeysInfo keys_info) {
238 DVLOG(2) << __FUNCTION__ 236 DVLOG(2) << __FUNCTION__
239 << " has_additional_usable_key=" << has_additional_usable_key; 237 << " has_additional_usable_key=" << has_additional_usable_key;
240 238
241 mojo::Array<mojom::CdmKeyInformationPtr> keys_data; 239 mojo::Array<mojom::CdmKeyInformationPtr> keys_data;
242 for (const auto& key : keys_info) 240 for (const auto& key : keys_info)
(...skipping 27 matching lines...) Expand all
270 268
271 void MojoCdmService::OnDecryptorConnectionError() { 269 void MojoCdmService::OnDecryptorConnectionError() {
272 DVLOG(2) << __FUNCTION__; 270 DVLOG(2) << __FUNCTION__;
273 271
274 // MojoDecryptorService has lost connectivity to it's client, so it can be 272 // MojoDecryptorService has lost connectivity to it's client, so it can be
275 // freed. 273 // freed.
276 decryptor_.reset(); 274 decryptor_.reset();
277 } 275 }
278 276
279 } // namespace media 277 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/interfaces/content_decryption_module.mojom ('k') | mojo/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698