| 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 "media/cdm/ppapi/external_clear_key/clear_key_cdm.h" | 5 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 case media::MediaKeys::OUTPUT_ERROR: | 150 case media::MediaKeys::OUTPUT_ERROR: |
| 151 return cdm::kOutputError; | 151 return cdm::kOutputError; |
| 152 } | 152 } |
| 153 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
| 154 return cdm::kUnknownError; | 154 return cdm::kUnknownError; |
| 155 } | 155 } |
| 156 | 156 |
| 157 static media::MediaKeys::SessionType ConvertSessionType( | 157 static media::MediaKeys::SessionType ConvertSessionType( |
| 158 cdm::SessionType session_type) { | 158 cdm::SessionType session_type) { |
| 159 switch (session_type) { | 159 switch (session_type) { |
| 160 case cdm::kPersistent: | |
| 161 return media::MediaKeys::PERSISTENT_SESSION; | |
| 162 case cdm::kTemporary: | 160 case cdm::kTemporary: |
| 163 return media::MediaKeys::TEMPORARY_SESSION; | 161 return media::MediaKeys::TEMPORARY_SESSION; |
| 162 case cdm::kPersistentLicense: |
| 163 return media::MediaKeys::PERSISTENT_SESSION; |
| 164 case cdm::kPersistentKeyRelease: |
| 165 // TODO(jrummell): Return matching type when MediaKeys changes. |
| 166 return media::MediaKeys::PERSISTENT_SESSION; |
| 164 } | 167 } |
| 165 NOTIMPLEMENTED(); | 168 NOTIMPLEMENTED(); |
| 166 return media::MediaKeys::TEMPORARY_SESSION; | 169 return media::MediaKeys::TEMPORARY_SESSION; |
| 167 } | 170 } |
| 168 | 171 |
| 169 template<typename Type> | 172 template<typename Type> |
| 170 class ScopedResetter { | 173 class ScopedResetter { |
| 171 public: | 174 public: |
| 172 explicit ScopedResetter(Type* object) : object_(object) {} | 175 explicit ScopedResetter(Type* object) : object_(object) {} |
| 173 ~ScopedResetter() { object_->Reset(); } | 176 ~ScopedResetter() { object_->Reset(); } |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 host_->OnSessionMessage(last_session_id_.data(), | 843 host_->OnSessionMessage(last_session_id_.data(), |
| 841 last_session_id_.length(), | 844 last_session_id_.length(), |
| 842 message.data(), | 845 message.data(), |
| 843 message.length(), | 846 message.length(), |
| 844 NULL, | 847 NULL, |
| 845 0); | 848 0); |
| 846 file_io_test_runner_.reset(); | 849 file_io_test_runner_.reset(); |
| 847 } | 850 } |
| 848 | 851 |
| 849 } // namespace media | 852 } // namespace media |
| OLD | NEW |