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 "webcontentdecryptionmodulesession_impl.h" | 5 #include "webcontentdecryptionmodulesession_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 case media::CdmKeyInformation::EXPIRED: | 69 case media::CdmKeyInformation::EXPIRED: |
70 return blink::WebEncryptedMediaKeyInformation::KeyStatus::Expired; | 70 return blink::WebEncryptedMediaKeyInformation::KeyStatus::Expired; |
71 case media::CdmKeyInformation::OUTPUT_RESTRICTED: | 71 case media::CdmKeyInformation::OUTPUT_RESTRICTED: |
72 return blink::WebEncryptedMediaKeyInformation::KeyStatus:: | 72 return blink::WebEncryptedMediaKeyInformation::KeyStatus:: |
73 OutputRestricted; | 73 OutputRestricted; |
74 case media::CdmKeyInformation::OUTPUT_DOWNSCALED: | 74 case media::CdmKeyInformation::OUTPUT_DOWNSCALED: |
75 return blink::WebEncryptedMediaKeyInformation::KeyStatus:: | 75 return blink::WebEncryptedMediaKeyInformation::KeyStatus:: |
76 OutputDownscaled; | 76 OutputDownscaled; |
77 case media::CdmKeyInformation::KEY_STATUS_PENDING: | 77 case media::CdmKeyInformation::KEY_STATUS_PENDING: |
78 return blink::WebEncryptedMediaKeyInformation::KeyStatus::StatusPending; | 78 return blink::WebEncryptedMediaKeyInformation::KeyStatus::StatusPending; |
| 79 case media::CdmKeyInformation::RELEASED: |
| 80 return blink::WebEncryptedMediaKeyInformation::KeyStatus::Released; |
79 } | 81 } |
80 | 82 |
81 NOTREACHED(); | 83 NOTREACHED(); |
82 return blink::WebEncryptedMediaKeyInformation::KeyStatus::InternalError; | 84 return blink::WebEncryptedMediaKeyInformation::KeyStatus::InternalError; |
83 } | 85 } |
84 | 86 |
85 static MediaKeys::SessionType convertSessionType( | 87 static MediaKeys::SessionType convertSessionType( |
86 blink::WebEncryptedMediaSessionType session_type) { | 88 blink::WebEncryptedMediaSessionType session_type) { |
87 switch (session_type) { | 89 switch (session_type) { |
88 case blink::WebEncryptedMediaSessionType::Temporary: | 90 case blink::WebEncryptedMediaSessionType::Temporary: |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 return blink::WebContentDecryptionModuleResult::SessionNotFound; | 430 return blink::WebContentDecryptionModuleResult::SessionNotFound; |
429 | 431 |
430 DCHECK(session_id_.empty()) << "Session ID may not be changed once set."; | 432 DCHECK(session_id_.empty()) << "Session ID may not be changed once set."; |
431 session_id_ = session_id; | 433 session_id_ = session_id; |
432 return adapter_->RegisterSession(session_id_, weak_ptr_factory_.GetWeakPtr()) | 434 return adapter_->RegisterSession(session_id_, weak_ptr_factory_.GetWeakPtr()) |
433 ? blink::WebContentDecryptionModuleResult::NewSession | 435 ? blink::WebContentDecryptionModuleResult::NewSession |
434 : blink::WebContentDecryptionModuleResult::SessionAlreadyExists; | 436 : blink::WebContentDecryptionModuleResult::SessionAlreadyExists; |
435 } | 437 } |
436 | 438 |
437 } // namespace media | 439 } // namespace media |
OLD | NEW |