Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6608)

Unified Diff: chromecast/media/cdm/cast_cdm.cc

Issue 2891683002: Remove ScopedVector from all other codes in media/ (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}
}
« no previous file with comments | « no previous file | content/renderer/pepper/content_decryptor_delegate.cc » ('j') | media/base/android/media_drm_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698