| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 WebContentDecryptionModuleSessionImpl* ReferenceIdAdapter::GetSession( | 143 WebContentDecryptionModuleSessionImpl* ReferenceIdAdapter::GetSession( |
| 144 uint32 reference_id) { | 144 uint32 reference_id) { |
| 145 DCHECK(sessions_.find(reference_id) != sessions_.end()); | 145 DCHECK(sessions_.find(reference_id) != sessions_.end()); |
| 146 return sessions_[reference_id]; | 146 return sessions_[reference_id]; |
| 147 } | 147 } |
| 148 | 148 |
| 149 //------------------------------------------------------------------------------ | 149 //------------------------------------------------------------------------------ |
| 150 | 150 |
| 151 WebContentDecryptionModuleImpl* | 151 WebContentDecryptionModuleImpl* |
| 152 WebContentDecryptionModuleImpl::Create(const string16& key_system) { | 152 WebContentDecryptionModuleImpl::Create(const base::string16& key_system) { |
| 153 // TODO(ddorwin): Guard against this in supported types check and remove this. | 153 // TODO(ddorwin): Guard against this in supported types check and remove this. |
| 154 // Chromium only supports ASCII key systems. | 154 // Chromium only supports ASCII key systems. |
| 155 if (!IsStringASCII(key_system)) { | 155 if (!IsStringASCII(key_system)) { |
| 156 NOTREACHED(); | 156 NOTREACHED(); |
| 157 return NULL; | 157 return NULL; |
| 158 } | 158 } |
| 159 | 159 |
| 160 // ReferenceIdAdapter creates the MediaKeys so it can provide its callbacks to | 160 // ReferenceIdAdapter creates the MediaKeys so it can provide its callbacks to |
| 161 // during creation of the MediaKeys. | 161 // during creation of the MediaKeys. |
| 162 scoped_ptr<media::MediaKeys> media_keys; | 162 scoped_ptr<media::MediaKeys> media_keys; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 191 | 191 |
| 192 adapter_->AddSession(session->reference_id(), session); | 192 adapter_->AddSession(session->reference_id(), session); |
| 193 return session; | 193 return session; |
| 194 } | 194 } |
| 195 | 195 |
| 196 void WebContentDecryptionModuleImpl::OnSessionClosed(uint32 reference_id) { | 196 void WebContentDecryptionModuleImpl::OnSessionClosed(uint32 reference_id) { |
| 197 adapter_->RemoveSession(reference_id); | 197 adapter_->RemoveSession(reference_id); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace content | 200 } // namespace content |
| OLD | NEW |