Chromium Code Reviews| Index: chromecast/media/cdm/cast_cdm.cc |
| diff --git a/chromecast/media/cdm/cast_cdm.cc b/chromecast/media/cdm/cast_cdm.cc |
| index e0b02821f0dc143c2302b9b24077f524c5b6206c..e8fc07ba4397490afa22dbe177bbbe949939622d 100644 |
| --- a/chromecast/media/cdm/cast_cdm.cc |
| +++ b/chromecast/media/cdm/cast_cdm.cc |
| @@ -127,7 +127,7 @@ void CastCdm::OnSessionKeysChange(const std::string& session_id, |
| logging::LogMessage log_message(__FILE__, __LINE__, logging::LOG_INFO); |
| log_message.stream() << "keystatuseschange "; |
| int status_count[::media::CdmKeyInformation::KEY_STATUS_MAX] = {0}; |
| - for (const auto* key_info : keys_info) { |
| + for (const auto& key_info : keys_info) { |
| status_count[key_info->status]++; |
| } |
| for (int i = 0; i != ::media::CdmKeyInformation::KEY_STATUS_MAX; ++i) { |
| @@ -156,10 +156,9 @@ void CastCdm::KeyIdAndKeyPairsToInfo(const ::media::KeyIdAndKeyPairs& keys, |
| ::media::CdmKeysInfo* keys_info) { |
| DCHECK(keys_info); |
| for (const std::pair<std::string, std::string>& key : keys) { |
| - std::unique_ptr<::media::CdmKeyInformation> cdm_key_information( |
| - new ::media::CdmKeyInformation(key.first, |
| - ::media::CdmKeyInformation::USABLE, 0)); |
| - keys_info->push_back(cdm_key_information.release()); |
| + auto cdm_key_information(base::MakeUnique<::media::CdmKeyInformation>( |
|
alokp
2017/05/17 12:07:02
nit: the two lines can now be combined:
keys_info
xiaofengzhang
2017/05/18 05:43:26
Done.
|
| + key.first, ::media::CdmKeyInformation::USABLE, 0)); |
| + keys_info->push_back(std::move(cdm_key_information)); |
| } |
| } |