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

Side by Side Diff: media/remoting/remoting_cdm_controller.h

Issue 2457563002: Media Remoting: Add remoting control logic for encrypted contents. (Closed)
Patch Set: Addressed comments from PS#12. Fixed ASAN. Created 4 years, 1 month 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/remoting/remoting_cdm_context.cc ('k') | media/remoting/remoting_cdm_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_REMOTING_REMOTING_CDM_CONTROLLER_H_
6 #define MEDIA_REMOTING_REMOTING_CDM_CONTROLLER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "media/remoting/remoting_source_impl.h"
12
13 namespace media {
14
15 // This class controlls whether to start a remoting session to create CDM.
16 // The |remoting_source_| will be passed to the RemotingRendererController when
17 // the CDM is attached to a media element.
18 class RemotingCdmController final : public RemotingSourceImpl::Client {
19 public:
20 explicit RemotingCdmController(
21 scoped_refptr<RemotingSourceImpl> remoting_source);
22 ~RemotingCdmController();
23
24 // RemotingSourceImpl::Client implementations.
25 void OnStarted(bool success) override;
26 void OnSessionStateChanged() override;
27
28 // Returns whether we should create remoting CDM via |cb|, which could be run
29 // synchronously or asynchronously, depending on whether the required
30 // information is available now or later.
31 using CdmCheckCallback = base::Callback<void(bool is_remoting)>;
32 void ShouldCreateRemotingCdm(const CdmCheckCallback& cb);
33
34 RemotingSourceImpl* remoting_source() const {
35 DCHECK(thread_checker_.CalledOnValidThread());
36 return remoting_source_.get();
37 }
38
39 private:
40 const scoped_refptr<RemotingSourceImpl> remoting_source_;
41
42 // This callback is run once to report whether to create remoting CDM.
43 CdmCheckCallback cdm_check_cb_;
44
45 // Indicates if the session is in remoting.
46 bool is_remoting_ = false;
47
48 base::ThreadChecker thread_checker_;
49
50 DISALLOW_COPY_AND_ASSIGN(RemotingCdmController);
51 };
52
53 } // namespace media
54
55 #endif // MEDIA_REMOTING_REMOTING_CDM_CONTROLLER_H_
OLDNEW
« no previous file with comments | « media/remoting/remoting_cdm_context.cc ('k') | media/remoting/remoting_cdm_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698