OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/webcontentdecryptionmodule_impl.h" | 5 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 scoped_ptr<media::MediaKeys> media_keys, | 163 scoped_ptr<media::MediaKeys> media_keys, |
164 scoped_ptr<SessionIdAdapter> adapter) | 164 scoped_ptr<SessionIdAdapter> adapter) |
165 : media_keys_(media_keys.Pass()), | 165 : media_keys_(media_keys.Pass()), |
166 adapter_(adapter.Pass()) { | 166 adapter_(adapter.Pass()) { |
167 } | 167 } |
168 | 168 |
169 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { | 169 WebContentDecryptionModuleImpl::~WebContentDecryptionModuleImpl() { |
170 } | 170 } |
171 | 171 |
172 // The caller owns the created session. | 172 // The caller owns the created session. |
173 WebKit::WebContentDecryptionModuleSession* | 173 blink::WebContentDecryptionModuleSession* |
174 WebContentDecryptionModuleImpl::createSession( | 174 WebContentDecryptionModuleImpl::createSession( |
175 WebKit::WebContentDecryptionModuleSession::Client* client) { | 175 blink::WebContentDecryptionModuleSession::Client* client) { |
176 DCHECK(media_keys_); | 176 DCHECK(media_keys_); |
177 WebContentDecryptionModuleSessionImpl* session = | 177 WebContentDecryptionModuleSessionImpl* session = |
178 new WebContentDecryptionModuleSessionImpl( | 178 new WebContentDecryptionModuleSessionImpl( |
179 media_keys_.get(), | 179 media_keys_.get(), |
180 client, | 180 client, |
181 base::Bind(&WebContentDecryptionModuleImpl::OnSessionClosed, | 181 base::Bind(&WebContentDecryptionModuleImpl::OnSessionClosed, |
182 base::Unretained(this))); | 182 base::Unretained(this))); |
183 | 183 |
184 // TODO(ddorwin): session_id is not populated yet! | 184 // TODO(ddorwin): session_id is not populated yet! |
185 adapter_->AddSession(session->session_id(), session); | 185 adapter_->AddSession(session->session_id(), session); |
186 return session; | 186 return session; |
187 } | 187 } |
188 | 188 |
189 void WebContentDecryptionModuleImpl::OnSessionClosed( | 189 void WebContentDecryptionModuleImpl::OnSessionClosed( |
190 const std::string& session_id) { | 190 const std::string& session_id) { |
191 adapter_->RemoveSession(session_id); | 191 adapter_->RemoveSession(session_id); |
192 } | 192 } |
193 | 193 |
194 } // namespace content | 194 } // namespace content |
OLD | NEW |