OLD | NEW |
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" | |
10 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
11 #include "media/base/cdm_factory.h" | 10 #include "media/base/cdm_factory.h" |
12 #include "media/base/cdm_key_information.h" | 11 #include "media/base/cdm_key_information.h" |
13 #include "media/base/cdm_promise.h" | 12 #include "media/base/cdm_promise.h" |
14 #include "media/base/key_systems.h" | 13 #include "media/base/key_systems.h" |
15 #include "media/base/media_keys.h" | |
16 #include "media/blink/webcontentdecryptionmodule_impl.h" | 14 #include "media/blink/webcontentdecryptionmodule_impl.h" |
17 #include "media/blink/webcontentdecryptionmodulesession_impl.h" | 15 #include "media/blink/webcontentdecryptionmodulesession_impl.h" |
18 #include "url/gurl.h" | 16 #include "url/gurl.h" |
19 | 17 |
20 namespace media { | 18 namespace media { |
21 | 19 |
22 const char kMediaEME[] = "Media.EME."; | 20 const char kMediaEME[] = "Media.EME."; |
23 const char kDot[] = "."; | 21 const char kDot[] = "."; |
24 | 22 |
25 CdmSessionAdapter::CdmSessionAdapter() : weak_ptr_factory_(this) { | 23 CdmSessionAdapter::CdmSessionAdapter() : weak_ptr_factory_(this) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( | 191 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( |
194 const std::string& session_id) { | 192 const std::string& session_id) { |
195 // Since session objects may get garbage collected, it is possible that there | 193 // Since session objects may get garbage collected, it is possible that there |
196 // are events coming back from the CDM and the session has been unregistered. | 194 // are events coming back from the CDM and the session has been unregistered. |
197 // We can not tell if the CDM is firing events at sessions that never existed. | 195 // We can not tell if the CDM is firing events at sessions that never existed. |
198 SessionMap::iterator session = sessions_.find(session_id); | 196 SessionMap::iterator session = sessions_.find(session_id); |
199 return (session != sessions_.end()) ? session->second.get() : NULL; | 197 return (session != sessions_.end()) ? session->second.get() : NULL; |
200 } | 198 } |
201 | 199 |
202 } // namespace media | 200 } // namespace media |
OLD | NEW |