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 "chromecast/media/cdm/browser_cdm_cast.h" | 5 #include "chromecast/media/cdm/browser_cdm_cast.h" |
6 | 6 |
7 #include "media/base/cdm_key_information.h" | 7 #include "media/base/cdm_key_information.h" |
8 | 8 |
9 namespace chromecast { | 9 namespace chromecast { |
10 namespace media { | 10 namespace media { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 } | 50 } |
51 | 51 |
52 void BrowserCdmCast::UnregisterPlayer(int registration_id) { | 52 void BrowserCdmCast::UnregisterPlayer(int registration_id) { |
53 base::AutoLock auto_lock(callback_lock_); | 53 base::AutoLock auto_lock(callback_lock_); |
54 DCHECK(ContainsKey(new_key_callbacks_, registration_id)); | 54 DCHECK(ContainsKey(new_key_callbacks_, registration_id)); |
55 DCHECK(ContainsKey(cdm_unset_callbacks_, registration_id)); | 55 DCHECK(ContainsKey(cdm_unset_callbacks_, registration_id)); |
56 new_key_callbacks_.erase(registration_id); | 56 new_key_callbacks_.erase(registration_id); |
57 cdm_unset_callbacks_.erase(registration_id); | 57 cdm_unset_callbacks_.erase(registration_id); |
58 } | 58 } |
59 | 59 |
60 void BrowserCdmCast::LoadSession( | |
61 ::media::MediaKeys::SessionType session_type, | |
62 const std::string& session_id, | |
63 scoped_ptr<::media::NewSessionCdmPromise> promise) { | |
64 NOTIMPLEMENTED() << "LoadSession not supported"; | |
ddorwin
2015/03/05 20:59:57
I think maybe this should be a DCHECK. At least in
gunsch
2015/03/05 21:12:49
Changed to a NOTREACHED.
| |
65 session_error_cb_.Run(session_id, | |
66 ::media::MediaKeys::Exception::NOT_SUPPORTED_ERROR, | |
67 0, | |
68 std::string()); | |
69 } | |
70 | |
71 ::media::CdmContext* BrowserCdmCast::GetCdmContext() { | |
72 NOTREACHED(); | |
ddorwin
2015/03/05 20:59:57
Are you sure this is not reachable? I thought this
xhwang
2015/03/05 21:12:39
This is okay and is actually what MediaDrmBridge i
gunsch
2015/03/05 21:12:49
MediaDrmBridge does the same:
https://code.google
| |
73 return nullptr; | |
74 } | |
75 | |
60 void BrowserCdmCast::OnSessionMessage(const std::string& session_id, | 76 void BrowserCdmCast::OnSessionMessage(const std::string& session_id, |
61 const std::vector<uint8>& message, | 77 const std::vector<uint8>& message, |
62 const GURL& destination_url) { | 78 const GURL& destination_url) { |
63 // Note: Message type is not supported in Chromecast. Do our best guess here. | 79 // Note: Message type is not supported in Chromecast. Do our best guess here. |
64 ::media::MediaKeys::MessageType message_type = | 80 ::media::MediaKeys::MessageType message_type = |
65 destination_url.is_empty() ? ::media::MediaKeys::LICENSE_REQUEST | 81 destination_url.is_empty() ? ::media::MediaKeys::LICENSE_REQUEST |
66 : ::media::MediaKeys::LICENSE_RENEWAL; | 82 : ::media::MediaKeys::LICENSE_RENEWAL; |
67 session_message_cb_.Run(session_id, | 83 session_message_cb_.Run(session_id, |
68 message_type, | 84 message_type, |
69 message, | 85 message, |
(...skipping 21 matching lines...) Expand all Loading... | |
91 base::AutoLock auto_lock(callback_lock_); | 107 base::AutoLock auto_lock(callback_lock_); |
92 for (std::map<uint32_t, base::Closure>::const_iterator it = | 108 for (std::map<uint32_t, base::Closure>::const_iterator it = |
93 new_key_callbacks_.begin(); it != new_key_callbacks_.end(); ++it) { | 109 new_key_callbacks_.begin(); it != new_key_callbacks_.end(); ++it) { |
94 it->second.Run(); | 110 it->second.Run(); |
95 } | 111 } |
96 } | 112 } |
97 } | 113 } |
98 | 114 |
99 } // namespace media | 115 } // namespace media |
100 } // namespace chromecast | 116 } // namespace chromecast |
OLD | NEW |