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

Side by Side Diff: media/test/fake_encrypted_media.h

Issue 2831963003: EME: Allow temporary sessions to be removed for ClearKey only. (Closed)
Patch Set: rebase Created 3 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/mojo/clients/mojo_cdm_factory.cc ('k') | media/test/fake_encrypted_media.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_ 5 #ifndef MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_
6 #define MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_ 6 #define MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_
7 7
8 #include "media/base/cdm_context.h" 8 #include "media/base/cdm_context.h"
9 #include "media/base/content_decryption_module.h" 9 #include "media/base/content_decryption_module.h"
10 10
(...skipping 15 matching lines...) Expand all
26 ContentDecryptionModule::MessageType message_type, 26 ContentDecryptionModule::MessageType message_type,
27 const std::vector<uint8_t>& message, 27 const std::vector<uint8_t>& message,
28 AesDecryptor* decryptor) = 0; 28 AesDecryptor* decryptor) = 0;
29 29
30 virtual void OnSessionClosed(const std::string& session_id) = 0; 30 virtual void OnSessionClosed(const std::string& session_id) = 0;
31 31
32 virtual void OnSessionKeysChange(const std::string& session_id, 32 virtual void OnSessionKeysChange(const std::string& session_id,
33 bool has_additional_usable_key, 33 bool has_additional_usable_key,
34 CdmKeysInfo keys_info) = 0; 34 CdmKeysInfo keys_info) = 0;
35 35
36 virtual void OnSessionExpirationUpdate(const std::string& session_id,
37 base::Time new_expiry_time) = 0;
38
36 virtual void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 39 virtual void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
37 const std::vector<uint8_t>& init_data, 40 const std::vector<uint8_t>& init_data,
38 AesDecryptor* decryptor) = 0; 41 AesDecryptor* decryptor) = 0;
39 }; 42 };
40 43
41 FakeEncryptedMedia(AppBase* app); 44 FakeEncryptedMedia(AppBase* app);
42 ~FakeEncryptedMedia(); 45 ~FakeEncryptedMedia();
43 CdmContext* GetCdmContext(); 46 CdmContext* GetCdmContext();
44 // Callbacks for firing session events. Delegate to |app_|. 47 // Callbacks for firing session events. Delegate to |app_|.
45 void OnSessionMessage(const std::string& session_id, 48 void OnSessionMessage(const std::string& session_id,
46 ContentDecryptionModule::MessageType message_type, 49 ContentDecryptionModule::MessageType message_type,
47 const std::vector<uint8_t>& message); 50 const std::vector<uint8_t>& message);
48 void OnSessionClosed(const std::string& session_id); 51 void OnSessionClosed(const std::string& session_id);
49 void OnSessionKeysChange(const std::string& session_id, 52 void OnSessionKeysChange(const std::string& session_id,
50 bool has_additional_usable_key, 53 bool has_additional_usable_key,
51 CdmKeysInfo keys_info); 54 CdmKeysInfo keys_info);
55 void OnSessionExpirationUpdate(const std::string& session_id,
56 base::Time new_expiry_time);
52 void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 57 void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
53 const std::vector<uint8_t>& init_data); 58 const std::vector<uint8_t>& init_data);
54 59
55 private: 60 private:
56 class TestCdmContext : public CdmContext { 61 class TestCdmContext : public CdmContext {
57 public: 62 public:
58 TestCdmContext(Decryptor* decryptor); 63 TestCdmContext(Decryptor* decryptor);
59 Decryptor* GetDecryptor() final; 64 Decryptor* GetDecryptor() final;
60 int GetCdmId() const final; 65 int GetCdmId() const final;
61 66
62 private: 67 private:
63 Decryptor* decryptor_; 68 Decryptor* decryptor_;
64 }; 69 };
65 70
66 scoped_refptr<AesDecryptor> decryptor_; 71 scoped_refptr<AesDecryptor> decryptor_;
67 TestCdmContext cdm_context_; 72 TestCdmContext cdm_context_;
68 std::unique_ptr<AppBase> app_; 73 std::unique_ptr<AppBase> app_;
69 74
70 DISALLOW_COPY_AND_ASSIGN(FakeEncryptedMedia); 75 DISALLOW_COPY_AND_ASSIGN(FakeEncryptedMedia);
71 }; 76 };
72 77
73 } // namespace media 78 } // namespace media
74 79
75 #endif // MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_ 80 #endif // MEDIA_TEST_FAKE_ENCRYPTED_MEDIA_H_
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_cdm_factory.cc ('k') | media/test/fake_encrypted_media.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698