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

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

Issue 1200323003: media: Quit MojoMediaApplication when no service is bound. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 5 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/services/mojo_cdm_service.h ('k') | media/mojo/services/mojo_media_application.h » ('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 "base/bind.h" 7 #include "base/bind.h"
8 #include "media/base/cdm_key_information.h" 8 #include "media/base/cdm_key_information.h"
9 #include "media/base/key_systems.h" 9 #include "media/base/key_systems.h"
10 #include "media/cdm/aes_decryptor.h" 10 #include "media/cdm/aes_decryptor.h"
11 #include "media/mojo/services/media_type_converters.h" 11 #include "media/mojo/services/media_type_converters.h"
12 #include "media/mojo/services/mojo_cdm_promise.h" 12 #include "media/mojo/services/mojo_cdm_promise.h"
13 #include "media/mojo/services/mojo_cdm_service_context.h" 13 #include "media/mojo/services/mojo_cdm_service_context.h"
14 #include "mojo/application/public/cpp/app_lifetime_helper.h"
14 #include "mojo/common/common_type_converters.h" 15 #include "mojo/common/common_type_converters.h"
15 #include "mojo/common/url_type_converters.h" 16 #include "mojo/common/url_type_converters.h"
16 #include "url/gurl.h" 17 #include "url/gurl.h"
17 18
18 namespace media { 19 namespace media {
19 20
20 typedef MojoCdmPromise<> SimpleMojoCdmPromise; 21 typedef MojoCdmPromise<> SimpleMojoCdmPromise;
21 typedef MojoCdmPromise<std::string> NewSessionMojoCdmPromise; 22 typedef MojoCdmPromise<std::string> NewSessionMojoCdmPromise;
22 23
23 MojoCdmService::MojoCdmService( 24 MojoCdmService::MojoCdmService(
25 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request,
24 MojoCdmServiceContext* context, 26 MojoCdmServiceContext* context,
25 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) 27 scoped_ptr<mojo::AppRefCount> parent_app_refcount)
26 : binding_(this, request.Pass()), 28 : binding_(this, request.Pass()),
27 context_(context), 29 context_(context),
30 parent_app_refcount_(parent_app_refcount.Pass()),
28 cdm_id_(CdmContext::kInvalidCdmId), 31 cdm_id_(CdmContext::kInvalidCdmId),
29 weak_factory_(this) { 32 weak_factory_(this) {
33 DVLOG(1) << __FUNCTION__;
30 } 34 }
31 35
32 MojoCdmService::~MojoCdmService() { 36 MojoCdmService::~MojoCdmService() {
37 DVLOG(1) << __FUNCTION__;
33 if (cdm_id_ != CdmContext::kInvalidCdmId) 38 if (cdm_id_ != CdmContext::kInvalidCdmId)
34 context_->UnregisterCdm(cdm_id_); 39 context_->UnregisterCdm(cdm_id_);
35 } 40 }
36 41
37 void MojoCdmService::SetClient(mojo::ContentDecryptionModuleClientPtr client) { 42 void MojoCdmService::SetClient(mojo::ContentDecryptionModuleClientPtr client) {
38 client_ = client.Pass(); 43 client_ = client.Pass();
39 } 44 }
40 45
41 void MojoCdmService::Initialize( 46 void MojoCdmService::Initialize(
42 const mojo::String& key_system, 47 const mojo::String& key_system,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 MediaKeys::Exception exception, 182 MediaKeys::Exception exception,
178 uint32_t system_code, 183 uint32_t system_code,
179 const std::string& error_message) { 184 const std::string& error_message) {
180 DVLOG(2) << __FUNCTION__; 185 DVLOG(2) << __FUNCTION__;
181 client_->OnLegacySessionError(session_id, 186 client_->OnLegacySessionError(session_id,
182 static_cast<mojo::CdmException>(exception), 187 static_cast<mojo::CdmException>(exception),
183 system_code, error_message); 188 system_code, error_message);
184 } 189 }
185 190
186 } // namespace media 191 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_service.h ('k') | media/mojo/services/mojo_media_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698