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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address timav@'s comments. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: media/test/pipeline_integration_test.cc
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc
index 9f979cebc601d97664865a8c2292c3823d70b634..5478324baec5efd8fd9676241fdd89a131c445a6 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -202,14 +202,15 @@ class FakeEncryptedMedia {
};
FakeEncryptedMedia(AppBase* app)
- : decryptor_(GURL::EmptyGURL(),
- base::Bind(&FakeEncryptedMedia::OnSessionMessage,
- base::Unretained(this)),
- base::Bind(&FakeEncryptedMedia::OnSessionClosed,
- base::Unretained(this)),
- base::Bind(&FakeEncryptedMedia::OnSessionKeysChange,
- base::Unretained(this))),
- cdm_context_(&decryptor_),
+ : decryptor_(new AesDecryptor(
+ GURL::EmptyGURL(),
+ base::Bind(&FakeEncryptedMedia::OnSessionMessage,
+ base::Unretained(this)),
+ base::Bind(&FakeEncryptedMedia::OnSessionClosed,
+ base::Unretained(this)),
+ base::Bind(&FakeEncryptedMedia::OnSessionKeysChange,
+ base::Unretained(this)))),
+ cdm_context_(decryptor_.get()),
app_(app) {}
CdmContext* GetCdmContext() { return &cdm_context_; }
@@ -220,7 +221,7 @@ class FakeEncryptedMedia {
const std::vector<uint8_t>& message,
const GURL& legacy_destination_url) {
app_->OnSessionMessage(session_id, message_type, message,
- legacy_destination_url, &decryptor_);
+ legacy_destination_url, decryptor_.get());
}
void OnSessionClosed(const std::string& session_id) {
@@ -244,7 +245,7 @@ class FakeEncryptedMedia {
void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
const std::vector<uint8_t>& init_data) {
- app_->OnEncryptedMediaInitData(init_data_type, init_data, &decryptor_);
+ app_->OnEncryptedMediaInitData(init_data_type, init_data, decryptor_.get());
}
private:
@@ -259,7 +260,7 @@ class FakeEncryptedMedia {
Decryptor* decryptor_;
};
- AesDecryptor decryptor_;
+ scoped_refptr<AesDecryptor> decryptor_;
TestCdmContext cdm_context_;
scoped_ptr<AppBase> app_;
};
« media/mojo/services/mojo_cdm_service.h ('K') | « media/mojo/services/mojo_cdm_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698