Chromium Code Reviews| Index: media/cdm/proxy_decryptor.cc |
| diff --git a/media/cdm/proxy_decryptor.cc b/media/cdm/proxy_decryptor.cc |
| index 28143f9fba16e26f7b58ff0792d254f1b3525bb6..8093da2fcc27345a219e2db989a36f49c554370b 100644 |
| --- a/media/cdm/proxy_decryptor.cc |
| +++ b/media/cdm/proxy_decryptor.cc |
| @@ -133,13 +133,14 @@ void ProxyDecryptor::GenerateKeyRequest(EmeInitDataType init_data_type, |
| // Returns true if |data| is prefixed with |header| and has data after the |
| // |header|. |
| -bool HasHeader(const std::vector<uint8>& data, const std::string& header) { |
| +static bool HasHeader(const std::vector<uint8>& data, |
| + const std::string& header) { |
| return data.size() > header.size() && |
| std::equal(header.begin(), header.end(), data.begin()); |
| } |
| // Removes the first |length| items from |data|. |
| -void StripHeader(std::vector<uint8>& data, size_t length) { |
| +static void StripHeader(std::vector<uint8>& data, size_t length) { |
| data.erase(data.begin(), data.begin() + length); |
| } |
| @@ -391,6 +392,13 @@ void ProxyDecryptor::OnLegacySessionError(const std::string& session_id, |
| void ProxyDecryptor::SetSessionId(SessionCreationType session_type, |
| const std::string& session_id) { |
| + // Load() returns empty |session_id| if the session is not found, so |
|
ddorwin
2015/07/09 00:29:35
LoadSession
jrummell
2015/07/10 00:16:49
Done.
|
| + // convert this into an error. |
| + if (session_type == LoadSession && session_id.empty()) { |
| + key_error_cb_.Run(session_id, MediaKeys::kUnknownError, 0); |
|
ddorwin
2015/07/09 00:29:35
Should we call OnLegacySessionError() for consiste
jrummell
2015/07/10 00:16:49
Sure. then it matches what was previously returned
|
| + return; |
| + } |
| + |
| // Loaded sessions are considered persistent. |
| bool is_persistent = |
| session_type == PersistentSession || session_type == LoadSession; |