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

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

Issue 855773002: Pass keyschange event to blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for blink changes Created 5 years, 11 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 | « no previous file | media/blink/webcontentdecryptionmodulesession_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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id, 132 void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id,
133 bool has_additional_usable_key, 133 bool has_additional_usable_key,
134 CdmKeysInfo keys_info) { 134 CdmKeysInfo keys_info) {
135 // TODO(jrummell): Pass |keys_info| on. 135 // TODO(jrummell): Pass |keys_info| on.
136 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); 136 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id);
137 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " 137 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session "
138 << web_session_id; 138 << web_session_id;
139 if (session) 139 if (session)
140 session->OnSessionKeysChange(has_additional_usable_key); 140 session->OnSessionKeysChange(has_additional_usable_key, keys_info.Pass());
141 } 141 }
142 142
143 void CdmSessionAdapter::OnSessionExpirationUpdate( 143 void CdmSessionAdapter::OnSessionExpirationUpdate(
144 const std::string& web_session_id, 144 const std::string& web_session_id,
145 const base::Time& new_expiry_time) { 145 const base::Time& new_expiry_time) {
146 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); 146 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id);
147 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " 147 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session "
148 << web_session_id; 148 << web_session_id;
149 if (session) 149 if (session)
150 session->OnSessionExpirationUpdate(new_expiry_time); 150 session->OnSessionExpirationUpdate(new_expiry_time);
(...skipping 19 matching lines...) Expand all
170 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( 170 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession(
171 const std::string& web_session_id) { 171 const std::string& web_session_id) {
172 // Since session objects may get garbage collected, it is possible that there 172 // Since session objects may get garbage collected, it is possible that there
173 // are events coming back from the CDM and the session has been unregistered. 173 // are events coming back from the CDM and the session has been unregistered.
174 // We can not tell if the CDM is firing events at sessions that never existed. 174 // We can not tell if the CDM is firing events at sessions that never existed.
175 SessionMap::iterator session = sessions_.find(web_session_id); 175 SessionMap::iterator session = sessions_.find(web_session_id);
176 return (session != sessions_.end()) ? session->second.get() : NULL; 176 return (session != sessions_.end()) ? session->second.get() : NULL;
177 } 177 }
178 178
179 } // namespace media 179 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/webcontentdecryptionmodulesession_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698