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

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

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_audio_decoder_service.h" 5 #include "media/mojo/services/mojo_audio_decoder_service.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/logging.h" 9 #include "base/logging.h"
10 #include "media/base/cdm_context.h" 10 #include "media/base/cdm_context.h"
11 #include "media/base/media_keys.h" 11 #include "media/base/media_keys.h"
12 #include "media/mojo/common/media_type_converters.h" 12 #include "media/mojo/common/media_type_converters.h"
13 #include "media/mojo/common/mojo_decoder_buffer_converter.h" 13 #include "media/mojo/common/mojo_decoder_buffer_converter.h"
14 #include "media/mojo/services/mojo_cdm_service_context.h" 14 #include "media/mojo/services/mojo_cdm_service_context.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 MojoAudioDecoderService::MojoAudioDecoderService( 18 MojoAudioDecoderService::MojoAudioDecoderService(
19 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context, 19 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context,
20 std::unique_ptr<media::AudioDecoder> decoder, 20 std::unique_ptr<media::AudioDecoder> decoder)
21 mojo::InterfaceRequest<mojom::AudioDecoder> request) 21 : mojo_cdm_service_context_(mojo_cdm_service_context),
22 : binding_(this, std::move(request)),
23 mojo_cdm_service_context_(mojo_cdm_service_context),
24 decoder_(std::move(decoder)), 22 decoder_(std::move(decoder)),
25 weak_factory_(this) { 23 weak_factory_(this) {
26 weak_this_ = weak_factory_.GetWeakPtr(); 24 weak_this_ = weak_factory_.GetWeakPtr();
27 } 25 }
28 26
29 MojoAudioDecoderService::~MojoAudioDecoderService() {} 27 MojoAudioDecoderService::~MojoAudioDecoderService() {}
30 28
31 void MojoAudioDecoderService::Initialize(mojom::AudioDecoderClientPtr client, 29 void MojoAudioDecoderService::Initialize(mojom::AudioDecoderClientPtr client,
32 mojom::AudioDecoderConfigPtr config, 30 mojom::AudioDecoderConfigPtr config,
33 int32_t cdm_id, 31 int32_t cdm_id,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 124
127 void MojoAudioDecoderService::OnAudioBufferReady( 125 void MojoAudioDecoderService::OnAudioBufferReady(
128 const scoped_refptr<AudioBuffer>& audio_buffer) { 126 const scoped_refptr<AudioBuffer>& audio_buffer) {
129 DVLOG(1) << __FUNCTION__; 127 DVLOG(1) << __FUNCTION__;
130 128
131 // TODO(timav): Use DataPipe. 129 // TODO(timav): Use DataPipe.
132 client_->OnBufferDecoded(mojom::AudioBuffer::From(audio_buffer)); 130 client_->OnBufferDecoded(mojom::AudioBuffer::From(audio_buffer));
133 } 131 }
134 132
135 } // namespace media 133 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_audio_decoder_service.h ('k') | media/mojo/services/mojo_cdm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698