Switch to using shared_ptr for Session Metrics
[ Merge from http://go/wvgerrit/71443 ] The assumption that the metrics will always outlive the CdmSession instance appears not to always hold (at least in a non-android multi-threaded solution). The shared_ptr ensures that the metrics are available even in these rare race conditions. BUG: http://b/123321465 Test: CDM unit tests. Also http://go/wvgerrit/71264 parallel tests. Change-Id: Iaa6a8f6c0fdc46a911789759d6e1228d849aa237
This commit is contained in:
@@ -133,8 +133,8 @@ CdmResponseType CdmEngine::OpenSession(
|
||||
|
||||
CloseExpiredReleaseSessions();
|
||||
|
||||
std::unique_ptr<CdmSession> new_session(new CdmSession(file_system_,
|
||||
metrics_->AddSession()));
|
||||
std::unique_ptr<CdmSession> new_session(
|
||||
new CdmSession(file_system_, metrics_->AddSession()));
|
||||
CdmResponseType sts = new_session->Init(property_set, forced_session_id,
|
||||
event_listener);
|
||||
if (sts != NO_ERROR) {
|
||||
|
||||
Reference in New Issue
Block a user