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

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: rebase only Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/mojo_cdm_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b62b5cb8832ecd450b73737c15b5cfb3b9a179d3 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/strings/string_split.h"
@@ -202,14 +203,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 +222,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 +246,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 +261,7 @@ class FakeEncryptedMedia {
Decryptor* decryptor_;
};
- AesDecryptor decryptor_;
+ scoped_refptr<AesDecryptor> decryptor_;
TestCdmContext cdm_context_;
scoped_ptr<AppBase> app_;
};
« no previous file with comments | « 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