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

Side by Side Diff: media/blink/cdm_session_adapter.cc

Issue 2402563002: Keep reference to CDM to avoid it's premature destruction (Closed)
Patch Set: nits Created 4 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 unified diff | Download patch
« no previous file with comments | « media/blink/cdm_session_adapter.h ('k') | media/blink/webcontentdecryptionmodule_impl.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "media/blink/cdm_session_adapter.h" 5 #include "media/blink/cdm_session_adapter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::unique_ptr<SimpleCdmPromise> promise) { 116 std::unique_ptr<SimpleCdmPromise> promise) {
117 cdm_->CloseSession(session_id, std::move(promise)); 117 cdm_->CloseSession(session_id, std::move(promise));
118 } 118 }
119 119
120 void CdmSessionAdapter::RemoveSession( 120 void CdmSessionAdapter::RemoveSession(
121 const std::string& session_id, 121 const std::string& session_id,
122 std::unique_ptr<SimpleCdmPromise> promise) { 122 std::unique_ptr<SimpleCdmPromise> promise) {
123 cdm_->RemoveSession(session_id, std::move(promise)); 123 cdm_->RemoveSession(session_id, std::move(promise));
124 } 124 }
125 125
126 CdmContext* CdmSessionAdapter::GetCdmContext() { 126 scoped_refptr<MediaKeys> CdmSessionAdapter::GetCdm() {
127 return cdm_->GetCdmContext(); 127 return cdm_;
128 } 128 }
129 129
130 const std::string& CdmSessionAdapter::GetKeySystem() const { 130 const std::string& CdmSessionAdapter::GetKeySystem() const {
131 return key_system_; 131 return key_system_;
132 } 132 }
133 133
134 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { 134 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const {
135 DCHECK(!key_system_uma_prefix_.empty()); 135 DCHECK(!key_system_uma_prefix_.empty());
136 return key_system_uma_prefix_; 136 return key_system_uma_prefix_;
137 } 137 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // Note: This leaks memory, which is expected behavior. 222 // Note: This leaks memory, which is expected behavior.
223 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet( 223 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet(
224 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName, 224 GetKeySystemUMAPrefix() + kTimeToCreateCdmUMAName,
225 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10), 225 base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromSeconds(10),
226 50, base::HistogramBase::kUmaTargetedHistogramFlag); 226 50, base::HistogramBase::kUmaTargetedHistogramFlag);
227 227
228 histogram->AddTime(time); 228 histogram->AddTime(time);
229 } 229 }
230 230
231 } // namespace media 231 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/cdm_session_adapter.h ('k') | media/blink/webcontentdecryptionmodule_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698